🔢 Chapter 1 · Topic 6 · Paper 1 & 2

Two's Complement

How computers store negative numbers — and add them without subtraction circuits

🔥 01 · Did You Know?

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.

Representing Negative Numbers

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.

🔑 In 8-bit two's complement: MSB = 0 → positive. MSB = 1 → negative. Range: −128 to +127.

The Sign Bit — Position of the MSB

The MSB has a negative place value of −128. All other bits keep their normal positive values.

MSB
−128
bit 6
+64
bit 5
+32
bit 4
+16
bit 3
+8
bit 2
+4
bit 1
+2
LSB
+1

8-Bit Two's Complement Range

Negative: −128 to −1
MSB = 1
Positive: 0 to +127
MSB = 0
0
10000000 = −128 01111111 = +127

Method: Converting a Positive Number to Two's Complement Negative

To represent a negative number, start with its positive binary form and apply two steps:

⬇ Flip & Add 1 — the Two's Complement Method
1
Write the positive number in 8-bit binary (e.g. +47 = 00101111).
2
Invert all bits (flip every 0 to 1 and every 1 to 0). This is called the one's complement.
3
Add 1 to the result. The final 8-bit value is the two's complement representation of −47.
+47
0
0
1
0
1
1
1
1
Step 2: invert
1
1
0
1
0
0
0
0
Step 3: +1 → −47
1
1
0
1
0
0
0
1

Method: Converting Two's Complement Back to Denary

If the MSB is 0 → read it as normal binary. If the MSB is 1 → there are two approaches:

Approach A — Weighted Place Value (fastest in exams)
1
Treat the MSB as −128. All other bits keep their normal positive values.
2
Add: (MSB × −128) + (bit6 × 64) + … + (bit0 × 1). The sum is the denary value.
Example: 11010001 = −128 + 64 + 16 + 1 = −47
Approach B — Flip & Add 1 Again (find the magnitude)
1
Invert all bits, then add 1. The result is the positive magnitude.
2
The original number was negative that magnitude.
Example: 11010001 → invert → 00101110 → +1 → 00101111 = 47 → answer is −47

⚠️ Common Exam Mistakes

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).

🏆
Cambridge Exam Tip: Two's complement questions are worth 2–4 marks and typically ask you to (1) express a negative denary number in 8-bit two's complement binary, or (2) find the denary value of a given two's complement pattern. Show every step — inversion row, then +1 row. Both rows earn method marks.
Two's Complement Converter
// Two modes: encode a negative number · or decode a two's complement pattern · full working shown

Enter a negative denary number (−1 to −128) to see its 8-bit two's complement representation.

Quick examples:
−1
−47
−64
−100
−128
−13
⚠ Enter a negative integer between −128 and −1.

Expressing −83 in 8-Bit Two's Complement

Work through each step before revealing — this is exactly how a 3-mark exam question unfolds.

📋 Question: Express the denary number −83 as an 8-bit two's complement binary number. Show all working. [3]
1
📊 Write the positive in binary
What is +83 in 8-bit binary? Which place values make up 83?
▶ Click to reveal
83 = 64 + 16 + 2 + 1 +83 = 0 1 0 1 0 0 1 1 Place values used: 64, 16, 2, 1
2
🔄 Invert all bits (one's complement)
Flip every single bit of 01010011. What is the result?
▶ Click to reveal
Original: 0 1 0 1 0 0 1 1 Inverted: 1 0 1 0 1 1 0 0 Every 0 becomes 1, every 1 becomes 0.
3
➕ Add 1
Add binary 1 to 10101100. Watch for carries.
▶ Click to reveal
10101100 + 1 ───────── 10101101 No carry issues — last bit was 0, so +1 simply sets it to 1.
4
✅ Verify the answer
Confirm 10101101 equals −83 using the weighted place value method.
▶ Click to reveal
−83 in two's complement = 10101101 Verification (weighted method): MSB: 1 × −128 = −128 bit6: 0 × 64 = 0 bit5: 1 × 32 = +32 bit4: 0 × 16 = 0 bit3: 1 × 8 = +8 bit2: 1 × 4 = +4 bit1: 0 × 2 = 0 bit0: 1 × 1 = +1 Sum: −128 + 32 + 8 + 4 + 1 = −83 ✓ [3 marks: +83 binary ✓ | inversion row ✓ | +1 / final answer ✓]

Cambridge-Style Practice

Show the positive binary, the inverted row, and the final +1 result in every encoding question.

Question 1
3 marks
Express the denary number −35 as an 8-bit two's complement binary number. Show all working.
+35 = 00100011  (32 + 2 + 1 = 35)[1]
Inverted (one's complement): 11011100[1]
Add 1: 11011101  — this is −35 in two's complement[1]
Verify: −128+64+16+8+4+1 = −128+93 = −35 ✓
Question 2
2 marks
The 8-bit two's complement pattern 10110110 represents a negative number. Find its denary value using the weighted place value method.
Correct working: 1×(−128) + 0×64 + 1×32 + 1×16 + 0×8 + 1×4 + 1×2 + 0×1 = −128+54[1]
Denary value = −74[1]
Question 3
2 marks
State the range of values that can be stored in 8-bit two's complement, and explain why the range is not symmetrical around zero.
Range: −128 to +127[1]
The range is asymmetric because zero (00000000) occupies one of the positive slots — so there are 128 negative values (−128 to −1) but only 127 positive values (1 to 127) plus zero[1]
Question 4
3 marks
Using two's complement 8-bit binary, calculate +53 + (−29). Show the two's complement encoding of −29, then perform the addition. State the final denary result.
−29 in two's complement: +29=00011101 → invert=11100010 → +1=11100011[1]
Addition: 00110101 (+53) + 11100011 (−29) = 00011000 (carry out of MSB is discarded — expected in TC addition)[1]
Result: 00011000 = 16+8 = +24  (53 − 29 = 24 ✓)[1]

5-Question Challenge

Test encoding, decoding, range, and sign bit knowledge. Earn your Topic 6 badge!

Score:
0 / 5
💜
Topic 6 Complete — Two's Complement Mastered!
+50 XP · Chapter 1 · Data Representation