Computers store and process all data using the binary number system (base 2), which uses only the digits 0 and 1. Each binary digit is called a bit. Humans typically use the denary (decimal) system (base 10), using digits 0–9. Hexadecimal (base 16) is used as a shorthand for binary because it is more compact and easier for humans to read.
Binary uses place values that are powers of 2. An 8-bit binary number has the following column values:
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
Example: Convert 10110101 to denary:
128+0+32+16+0+4+0+1 = 181
Repeatedly divide by 2 and record the remainders (read remainders from bottom to top).
Example: Convert 45 to binary: 45÷2=22r1, 22÷2=11r0, 11÷2=5r1, 5÷2=2r1, 2÷2=1r0, 1÷2=0r1 → reading remainders upward: 101101
Hexadecimal uses 16 digits: 0–9 then A(=10), B(=11), C(=12), D(=13), E(=14), F(=15).
| Hex digit | Denary value | 4-bit binary |
|---|---|---|
| 0 | 0 | 0000 |
| 9 | 9 | 1001 |
| A | 10 | 1010 |
| F | 15 | 1111 |
Split the binary number into groups of 4 bits from the right, then convert each group to its hex digit.
Example: 10111010 → split: 1011 | 1010 → B | A → BA (hex)
Replace each hex digit with its 4-bit binary equivalent.
Example: 3F → 0011 | 1111 → 00111111
Multiply each digit by its place value (powers of 16).
Example: 2A hex = (2×16) + (10×1) = 32 + 10 = 42
5 Cambridge-style questions · 10 marks · instantly marked
| Term | Definition |
|---|
Timed exam-style conditions. No feedback until you submit.