2
Hexadecimal to binary: four bits for each symbol
ICT Secondary 3 Term 1, Unit 1, Topic 1: pp. 22–26
GoalConvert hexadecimal to binary symbol by symbol.
New words
group of four bits · the 4 bits that stand for one hexadecimal symbollookup table · a table you read the answer from; here 16 rows, symbol and four bitsleading zeros · zeros at the left end of a number; they may be dropped only at the very start of the whole answer
Explanation
Because 16 = 2×2×2×2, one hexadecimal symbol is exactly four bits. To convert hexadecimal to binary, replace each symbol by its group of four bits from the lookup table and put the groups side by side. Every group must have four bits, so write zeros on its left when needed: 7 is 0111, not 111. At the end you may drop the zeros at the very start of the whole answer, but never the zeros inside it. For example (3B)₁₆ is 0011 for the 3 and 1011 for the B, so 00111011, and without the leading zeros (111011)₂, which is 59.
| Hexadecimal | Four bits | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| B | 1011 | 11 |
| C | 1100 | 12 |
| D | 1101 | 13 |
| E | 1110 | 14 |
| F | 1111 | 15 |
Worked examples
| Symbol | 9 | C | 0 |
|---|---|---|---|
| Four bits | 1001 | 1100 | 0000 |
| Symbol | 7 | F |
|---|---|---|
| Four bits | 0111 | 1111 |
Class activity
Write the 16-row table from memory, from 0000 for 0 up to 1111 for F. Then use it to convert (D4)₁₆ and (2F5)₁₆ to binary.
Practice
1
Convert (A5)₁₆ to binary.
A = 1010 and 5 = 0101, so 10100101.
2
Convert (B2)₁₆ to binary.
B = 1011 and 2 = 0010, so 10110010.
3
Convert (100)₁₆ to binary.
0001 0000 0000, and without the leading zeros 100000000: a 1 followed by eight 0s.
4
A hexadecimal number has 6 symbols. How many bits does it stand for, keeping all the zeros?
6 × 4 = 24 bits.
5
Why do we write 7 as 0111 inside a longer answer?
Every symbol must take exactly four bits, so that the next group stays in its correct place.