Data Representation · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 12% of your exam marks.
Binary/hex conversion and binary arithmetic appear in every Paper 1. Consistently 8 to 15 marks.
So far every binary number has been unsigned, meaning all the bits represent positive values. To store negative numbers, the syllabus uses , an 8-bit format where the leftmost bit's place value is negative.
In an 8-bit two's complement value, the column headings are:
| −128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|
Notice the leftmost column is −128, not +128. The other columns keep their normal positive values. The leftmost bit is therefore the sign bit: if it is 0, the number is positive (or zero); if it is 1, the number is negative.
| Bit pattern | Denary value |
|---|---|
| 00000000 | 0 |
| 01111111 | +127 (the largest positive value) |
| 10000000 | −128 (the smallest negative value) |
| 11111111 | −1 |
So the range is −128 to +127 inclusive.
To find the denary value of a two's complement number, sum every column heading whose bit is set to 1, treating the leftmost column as −128.
The fastest method on paper is the copy-and-invert trick:
A second standard method gives the same answer:
Both methods are accepted in the exam; pick whichever you find easier and stick with it.
Two's complement is the dominant way of storing signed integers in modern computers because:
Converting a negative denary number to two's complement
Express −114 as an 8-bit two's complement integer.
Solution:
Check: −128 + 8 + 4 + 2 = −114 ✓