Two's complement
A method representing negative integers in binary by inverting all bits and adding 1. Two's complement enables subtraction through addition and supports efficient hardware implementation. Symmetric representation with one zero and equal ranges for positive and negative numbers.
Formula
−n = invert all bits of +n, then add 1
Real World
When a bank's system records a £50 withdrawal, the processor stores −50 in two's complement so the CPU can subtract by simply adding the negative value, which is how Barclays' ATM hardware processes every transaction.
Exam Focus
State the range for n bits as −2^(n−1) to +2^(n−1)−1; many students incorrectly make the positive and negative ranges equal.
How well did you know this?