Converting between number bases
You must be able to convert between denary (decimal), binary and hexadecimal confidently — and AQA expects 8-bit unsigned binary work in particular. The methods are quick once you've practised.
Binary → denary (decimal)
Write the place values above each bit and add the values where the bit is 1.
Place: 128 64 32 16 8 4 2 1
Bits: 1 0 1 1 0 0 1 0
Add: 128 + 32 + 16 + 2 = 178.
Denary → binary (8-bit)
Two reliable methods.
Method A — subtract place values. Take the largest power of 2 ≤ the number. Subtract. Repeat.
Convert 178 to binary:
- 178 - 128 = 50, place a 1 in the 128 column.
- 50 - 32 = 18, place a 1 in the 32 column.
- 18 - 16 = 2, place a 1 in the 16 column.
- 2 - 2 = 0, place a 1 in the 2 column.
- All other columns are 0.
- Result: 10110010.
Method B — divide by 2 repeatedly. Read remainders bottom up.
178 ÷ 2 = 89 r 0 (LSB)
89 ÷ 2 = 44 r 1
44 ÷ 2 = 22 r 0
22 ÷ 2 = 11 r 0
11 ÷ 2 = 5 r 1
5 ÷ 2 = 2 r 1
2 ÷ 2 = 1 r 0
1 ÷ 2 = 0 r 1 (MSB)
Reading remainders bottom-up: 10110010.
Pad with leading zeros to 8 bits if needed.
Binary → hex
Group the bits into nibbles of 4, starting from the right, then convert each nibble.
Convert 10110010:
- Right nibble: 0010 = 2.
- Left nibble: 1011 = 8 + 2 + 1 = 11 = B.
- Result: B2.
If the number of bits isn't a multiple of 4, pad with leading zeros.
Hex → binary
Replace each hex digit with its 4-bit binary form. Always 4 bits per digit — pad with leading zeros if needed.
Convert 4F:
- 4 = 0100
- F = 1111
- Result: 01001111.
Denary → hex
Two methods.
Method A — go via binary. Convert to binary, group into nibbles, convert each nibble.
Method B — divide by 16. Read remainders bottom-up.
Convert 254 to hex:
- 254 ÷ 16 = 15 r 14 → E (LSB)
- 15 ÷ 16 = 0 r 15 → F (MSB)
- Result: FE.
Hex → denary
Multiply each digit by its place value (powers of 16) and sum.
Convert C3:
- C is in the 16s column: 12 × 16 = 192.
- 3 is in the 1s column: 3 × 1 = 3.
- Total: 195.
Quick reference table
| Decimal | Binary | Hex |
|---|---|---|
| 0 | 0000 | 0 |
| 5 | 0101 | 5 |
| 10 | 1010 | A |
| 15 | 1111 | F |
| 16 | 10000 | 10 |
| 64 | 1000000 | 40 |
| 128 | 10000000 | 80 |
| 255 | 11111111 | FF |
Memorise the bottom row — it appears constantly.
⚠Common mistakes— Pitfalls
- Grouping nibbles from the wrong end. Always group binary → hex starting from the right.
- Forgetting to pad to 8 bits. Many AQA questions specify "8-bit unsigned" — pad with leading zeros.
- Treating A as 11. A=10, B=11. Easy to slip.
- Reading remainder lists upside down. Remainders are read bottom-up (LSB at top of the list).
- Confusing place values. In hex, the second column is 16, not 10. In binary, the third column is 4, not 3.
✦Worked example— Worked example — full conversion
Convert decimal 173 to binary and hex.
Binary (subtract place values): 173 - 128 = 45 → 1 45 - 32 = 13 → 1 13 - 8 = 5 → 1 5 - 4 = 1 → 1 1 - 1 = 0 → 1 Other columns 0. Result: 10101101.
Hex (group into nibbles): 1010 1101 = A D = AD.
Verify: A×16 + D = 160 + 13 = 173. ✓
AI-generated · claude-opus-4-7 · v3-deep-computer-science