How computers store negative numbers — and add them without subtraction circuits
Every time a game character loses health, a bank processes a debit, or a sensor reads a temperature below zero, a computer must represent a negative number. But transistors only understand 0 and 1. So how do you store −47? The answer, used in every processor ever made, is two's complement — a beautifully elegant trick discovered in the 1950s. It means a CPU can add −47 and +100 using exactly the same addition circuit it uses for positive numbers. No separate subtraction hardware needed. The entire system of banking debits, game scores, temperature sensors, and physics engines runs on this one elegant encoding. In Cambridge examinations, two's complement appears in nearly every Paper 1 — master it here.
In standard (unsigned) binary, all numbers are positive. Two's complement is a signed binary system that uses the Most Significant Bit (MSB) as a sign bit to represent both positive and negative numbers.
The MSB has a negative place value of −128. All other bits keep their normal positive values.
To represent a negative number, start with its positive binary form and apply two steps:
If the MSB is 0 → read it as normal binary. If the MSB is 1 → there are two approaches:
Forgetting to add 1 after inverting — one's complement (just flipping) is not two's complement. The +1 step is essential.
Treating the MSB as +128 in a two's complement number — when reading a negative two's complement number, the MSB place value is −128, not +128.
Confusing the range — 8-bit two's complement goes from −128 to +127, not −127 to +127. The asymmetry is because zero takes up one positive slot.
Applying two's complement to a positive number — if the MSB is 0, just read it as normal unsigned binary. Two's complement conversion only applies when the number is negative (MSB = 1).
Enter a negative denary number (−1 to −128) to see its 8-bit two's complement representation.
Work through each step before revealing — this is exactly how a 3-mark exam question unfolds.
Show the positive binary, the inverted row, and the final +1 result in every encoding question.
Test encoding, decoding, range, and sign bit knowledge. Earn your Topic 6 badge!