Click here to purchase the entire book in PDF format.
|
|
So, now we wind up with these strange numbers that include the letters A through F. So we'll see something like 3D4A. What number is this exactly?
|
If this seems a little confusing at this point, don't panic. It does for everyone. I think that the confusion with hexadecimal arises from the fact that it's so close to decimal - you can have the number 246 in decimal and the number 246 in hexadecimal - but these are not the same number, so you have to translate. (for example, the German word for ``poison'' is ``Gift'' - so if you're reading in German, this is not a word that you should think in English. An English ``gift'' and a German ``Gift'' are different things... hopefully...)
Of course, this raises the question ``Why would we use such a confusing system in the first place!?'' The answer actually lies back in the binary system. All of our computers and DSP and digital audio everything use the binary system to fire numbers around. This is inescapable. The problem is that those binary words are just so long to write down that, if you had to write them in a book, you'd waste a lot of paper. You could translate the numbers into decimal, but there's no correlation between binary and decimal - it's difficult to translate. However, check back to Table 3. Notice that going from the number fifteen to the number sixteen results in the hexadecimal number going from a 1-digit number to a 2-digit number. Also notice that, at the same time, the binary word goes from 4 bits to 5. This is where the magic lies. A single hexadecimal digit (0 - F) corresponds directly to a four-bit binary word (0000 - 1111). Not only this, but if you have a longer binary word, you can slice it up into four-bit sections and represent each section with its corresponding hexadecimal digit. For example, take the number 38069:
1001010010110101
Slice this number into 4-bit sections (start slicing from the right)
1001 0100 1011 0101
Now, look up the corresponding hexadecimal equivalents for each 4-bit section using Table 1.4:
9 4 B 5
94B5
So, as can be seen from the example above, there is a direct relationship between each 4-bit ``slice'' of the binary word and a corresponding hexadecimal number. If we were to try to convert the binary word into decimal, it would be much more of a headache. Since this translation is so simple, and because we use one quarter the number of digits, you'll often see hexadecimal used to denote numbers that are actually sent through the computer as a binary word.