Hexadecimal numbering system
Unlike the octal numbering system, hexadecimal numbering system is used a lot in mathematics and computing. It is a base sixteen (16) numbering system that consists of sixteen digits, that is, 0 to 9 and A to F. Similarly to decimal to octal conversion, you need to use binary in between whenever you are converting from decimal to hexadecimal.
Table C.6. Represents decimal, binary, and hexadecimal numbering systems.
Decimal | Binary | Octal | Hexadecimal |
0 | 0000 | 0 | 0 |
1 | 0001 | 1 | 1 |
2 | 0010 | 2 | 2 |
3 | 0011 | 3 | 3 |
4 | 0100 | 4 | 4 |
5 | 0101 | 5 | 5 |
6 | 0110 | 6 | 6 |
7 | 0111 | 7 | 7 |
8 | 1000 | 10 | 8 |
9 | 1001 | 11 | 9 |
10 | 1010 | 12 | A |
11 | 1011 | 13 | B |
12 | 1100 | 14 | C |
13 | 1101 | 15 | D |
14 | 1110 | 16 | E |
15 | 1111 | 17 | F |
Decimal to hexadecimal conversion
As explained earlier, to convert a decimal number to hexadecimal number, binary comes into play. First, the decimal number must be converted into binary. Next, the binary number gets divided into groups of four bits (a nibble) and then from that, gets converted to a hexadecimal number.
Example: The conversion of the decimal number 19610to hexadecimal ?16
As we have already completed conversion of the decimal number 196 to the binary number 11000100, let's divide the binary number into two sets of four bits each, as follows:
1100 | 0100 - binary number 11000100 divided in two sets of four bits each C | 4 - result in hexadecimal referring to numbering representation in Table C.6
In this way, the decimal number 196 in hexadecimal is C4.
Note
You can learn more about numbering conversions at http://fourier.eng.hmc.edu/e85_old/lectures/arithmetic/node3.html.