Hexadecimal Number System
OEES 235
The following are excerpts from Wikipedia.org's article on hexidecimal numbers. Here's a link to the full article: http://en.wikipedia.org/wiki/Hexadecimal
Mapping to binarySometimes it is necessary to use binary data when working with computers, but it is difficult for humans to work with the large number of digits in binary. Although most humans are more familiar with the base 10 system, it is much easier to map binary to hexadecimal than to decimal because each hexadecimal digit maps to a whole number of bits (410). The following is an example of converting 11112 to base 10. Since each position in a binary numeral can only contain either a 1 or 0, its value may be easily determined by its position from the right:
Therefore:
This example shows addition of 4 numbers; but with some practice, 11112 can be mapped directly to F16 in one step (see table in Representing hexadecimal). The advantage of using hexadecimal rather than decimal increases with the size of the number. When the number becomes large, conversion to decimal becomes much more tedious; however, when mapping to hexadecimal, it is simple to divide the binary string into blocks of 4 positions and map each block of 4 bits to a single position hexadecimal digit. This example shows the conversion of a binary number to decimal, mapping each digit to the decimal value, and adding the results.
Compare this to the conversion to hexadecimal, where each group of four digits can be considered independently, and converted directly:
Conversion from hexadecimal back to binary is just as direct. The octal system can also be useful as a tool for people who need to deal directly with binary computer data, as in reading and understanding it. Compared to hexadecimal, octal represents data in blocks of 3 bits each, rather than 4. One advantage of hexadecimal is that every unique 2-digit pair (or octet) always represents the same byte value. To "translate" a hexadecimal value into bytes, one needs only to separate the value into individual 2-digit groups, translate each group into its respective byte value, and then combine the results together to form an accurate translation of the entire original hexadecimal word. Conversely, bytes can also be easily translated into hexadecimal values by translating each byte individually into its hexadecimal 2-digit value, and then recombining the hexadecimal values into a "word". The resulting "word" will be an accurate hexadecimal representation of the original string of bytes. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||