Two's complement
AQA GCSE Computer Science (8525), specification 3.3.1 Two's complement (8-bit numbers only)
Two's complement is the method modern computers use to represent positive and negative integers in binary. In AQA GCSE Computer Science (8525), you only ever need to work with 8-bit numbers, which gives a range from -128 to +127.
What you need to know
- Two's complement represents both positive and negative integers using standard binary adder circuits.
- In an 8-bit number, the Most Significant Bit (MSB, bit 7) has a place value of
-128(the sign bit). - If the MSB is
0, the number is positive (from0to+127). If the MSB is1, the number is negative (from-128to-1). - The total 8-bit range is
-128to+127(256 distinct values). - To negate a number: invert all bits (
0becomes1,1becomes0) and add1.
What you don’t need
- Sign and magnitude representation
- One's complement arithmetic
- Numbers larger than 8 bits in two's complement
Worked examples
Convert the 8-bit two's complement binary number
1101 0110into denary.- Write the place values:
-128,64,32,16,8,4,2,1. - Add the active values:
(-128 × 1) + (64 × 1) + (16 × 1) + (4 × 1) + (2 × 1). -128 + 64 + 16 + 4 + 2 = -42.
Answer:
-42- Write the place values:
Represent the denary number
-19as an 8-bit two's complement binary number.- Step 1: Write
+19in 8-bit binary:0001 0011(16 + 2 + 1). - Step 2: Invert all bits:
1110 1100. - Step 3: Add 1:
1110 1100 + 1 = 1110 1101.
Answer:
1110 1101- Step 1: Write
Common mistakes
- Thinking the range is -128 to +128 — zero takes up one positive pattern, so the maximum positive is
+127. - Confusing two's complement with sign and magnitude (which is out of scope on AQA 8525).
- Forgetting that bit 7 has a negative value (
-128), not+128.
Practise it
Learn it
A video lesson on this topic is on the way.
Not a subscriber? Watch a sample lesson or see pricing.
Revise next
Written to the published AQA specification. UpperGrades isn’t affiliated with or endorsed by AQA.
