Appendix A. Tutorial: Working with Binary and Hex

 

The best way to gain an understanding of binary and hexadecimal numbering is to begin by examining the decimal numbering system. The decimal system is a base 10 numbering system (the root deci means "ten"). Base 10 means that there are 10 digits with which to represent numbers : through 9 . Most likely, we work in base 10 because our ancient ancestors began counting their cattle and children and enemies on their fingers (in fact, the word digit means "finger").

The use of place values allows the representation of large numbers with a few digits, such as the 10 decimal digits. The place values of all numbering systems begin at the right, with the base raised to the power of 0. Reading to the left, each place value is the base raised to a power that is one more than the power of the previous place value:

B 4 B 3 B 2 B 1 B

In base 10, the first five place values are:

10 4 10 3 10 2 10 1 10

The first two place values are easy to calculate for any base. Any number raised to the power of 0 is 1; so 10 = 1. Any number raised to the power of 1 is simply that number; so 10 1 = 10. Working from the left-most place value, simply multiply the number to the right by the base:

10 = 1

10 1 = 1 x 10 = 10

10 2 = 10 x 10 = 100

10 3 = 100 x 10 = 1000

10 4 = 1000 x 10 = 10,000

So, the first five place values of the base 10 numbering system are:

10,000 1,000 100 10 1

Reading a number such as 57,258 in terms of place values means there are five quantities of 10,000, seven quantities of 1000, two quantities of 100, five quantities of 10, and eight quantities of 1. That is,

5 x 10,000 = 50,000

7 x 1,000 = 7,000

2 x 100 = 200

5 x 10 = 50

8 x 1 = 8

Adding these individual results together, the result is 50,000 + 7,000 + 200 + 50 + 8 = 57,258.

All of us are so acquainted with working in base 10 that we seldom think of breaking a number down into its place values. However, this technique is essential to being able to decipher numbers in other bases.



Routing TCP[s]IP (Vol. 11998)
Routing TCP[s]IP (Vol. 11998)
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 224

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net