One quantity, three ways to write it
Denary is base 10, binary is base 2 and hexadecimal is base 16. Changing the base changes the notation, not the quantity. A bit has two possible values, 0 and 1; an eight-bit unsigned value represents integers from 0 to 255.
Binary place values double as you move left. A 1 includes that place value in the total; a 0 does not. Leading zeroes preserve a requested width without changing the value.
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| 10101101 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
Read 10101101
- Select the columns containing 1: 128, 32, 8, 4 and 1.
- Add those values: 128 + 32 + 8 + 4 + 1 = 173.
10101101 in binary and 173 in denary represent the same integer.
Build the binary value from the largest places
To convert an unsigned denary number to eight bits, inspect each place from 128 down to 1. Write 1 when that place fits the remaining value, subtract it, then continue. Otherwise write 0.
Convert 173
- 173 includes 128: write 1 and keep remainder 45.
- 64 does not fit; 32 fits, leaving 13. The first three bits are 101.
- 16 does not fit; 8 fits, leaving 5; 4 fits, leaving 1.
- 2 does not fit; 1 fits. Result: 10101101.
- Check: 128 + 32 + 8 + 4 + 1 = 173.
Keep all eight columns in order; do not squeeze out the zero columns.
A hexadecimal digit can hold four bits
Hexadecimal uses 0–9 and then A, B, C, D, E and F for ten through fifteen. In a two-digit hexadecimal value, the left digit counts sixteens and the right digit counts ones.
Four bits have sixteen combinations, so split an eight-bit number into two groups of four. Convert each group separately, keeping zeroes inside each group.
| Hex digit | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| Denary | 10 | 11 | 12 | 13 | 14 | 15 |
| Binary | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
Connect AD, 10101101 and 173
- Split 10101101 as 1010 | 1101.
- 1010 is ten, written A. 1101 is thirteen, written D.
- AD in denary is 10 × 16 + 13 = 173.
AD is not 10 + 13: the A occupies the sixteens column.
Why people use hexadecimal
Computers ultimately store binary patterns. Hexadecimal is a compact, readable way for people to represent those patterns, for example in a memory address or a colour value. It is not a different kind of memory, and it does not make the underlying bit pattern smaller.
Continue with your exam board
The course combines lesson videos, interactive activities, topic questions and original exam mocks. Sign in to use the learning tools and save your progress; your account’s course access applies.
Independent learning resources. Not endorsed by AQA or OCR. These public introductions complement the full course and the official specification.