Hexadecimal numbers are base 16.
There are 16 different hex digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, or f
Hex Digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | a | b | c | d | e | f |
Decimal Value | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Binary Value | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
161 | 160 |
16 | 1 |
Example 1: Convert the hex number
Step 1: Multiply each hex digit by its place value.
Step 2: Add the resulting numbers.
16 | 1 |
Example 2: Convert the 4-bit binary number
Find the hex digit by looking it up in the table.
Example 3: Convert the 8-bit binary number
Step 1: Separate the binary digits into groups of 4: | ||
Step 2: Convert each group of digits to hex: |
Example 4: Convert the hex number
Look up each hex digit in the table, and write its binary value.
hex
hex
Therefore,
We use hexadecimal to represent numbers because it is:
a) easy to convert hex to binary,
b) easy to convert binary to hex,
c) easier to read 2 digits than 8 digits.