Two's Complement - Representing Negative Numbers
Part of Binary Arithmetic — GCSE Computer Science
This key facts covers Two's Complement - Representing Negative Numbers within Binary Arithmetic for GCSE Computer Science. Revise Binary Arithmetic in Memory & Storage for GCSE Computer Science with 15 exam-style questions and 18 flashcards. This topic appears regularly enough that it should still be part of a steady revision cycle. It is section 6 of 10 in this topic. Use this key facts to connect the idea to the wider topic before moving on to questions and flashcards.
Topic position
Section 6 of 10
Practice
15 questions
Recall
18 flashcards
Two's Complement - Representing Negative Numbers
The Problem with Simple Sign Bit:
You might think: "Just use the leftmost bit as a sign (0=positive, 1=negative)." This causes problems: two representations of zero (±0), addition doesn't work without special logic.
Two's Complement Solution:
A clever system where the MSB has a negative place value. For 8-bit:
Place values: -128 64 32 16 8 4 2 1 Example: 10000101 = (-128) + 4 + 1 = -123 Range for 8-bit two's complement: -128 to +127
How to Convert to Two's Complement (Make Negative):
Method: Flip all bits, then add 1
Example: Convert +5 to -5
Step 1: Start with +5: 00000101 Step 2: Flip all bits: 11111010 Step 3: Add 1: 11111011 = -5 Check: -128 + 64 + 32 + 16 + 8 + 2 + 1 = -5 ✓
Why Two's Complement is Brilliant:
- Addition works the same for positive and negative numbers!
- Only one representation of zero (00000000)
- Easy to detect sign: if MSB = 1, it's negative
- Subtraction = add the negative (3 - 5 = 3 + (-5))
Example: Add -5 + 3 (Should = -2)
11111011 (-5)
+ 00000011 (+3)
----------
¹¹¹¹¹¹¹¹ ← carries (overflow bit discarded)
1 11111110 (-2)
↑
Overflow bit is ignored in two's complement addition
Check: 11111110 = -128 + 64 + 32 + 16 + 8 + 4 + 2 = -2 ✓