📄 Paper 1 · 1.1 Data Representation
1.1.2 Binary Arithmetic & Two's Complement
Cambridge 9618 · International A Level Computer Science · ~15 min read
Notes
Video
Slides
Worksheet
Quiz

Binary Addition

Binary addition follows the same rules as denary addition but carries at 2 instead of 10. There are four basic rules:

OperationResultCarry
0 + 000
0 + 110
1 + 010
1 + 101 (carry)
1 + 1 + 111 (carry)

Example: Add 01101011 + 00110110:

  01101011
+ 00110110
----------
  10100001

Result: 10100001 = 161 in denary (107 + 54 = 161 ✓)

Overflow in Binary Addition

Overflow occurs when the result of an addition is too large to be stored in the available number of bits. In an 8-bit system, if the result exceeds 255 (unsigned) or goes outside the signed range, a carry out of the most significant bit indicates overflow.

Two's Complement

Computers represent negative numbers using two's complement notation. This allows the same addition circuits to handle both positive and negative numbers.

Representing Negative Numbers with Two's Complement

In n-bit two's complement:

  • The most significant bit (MSB) has a negative place value: −2^(n−1)
  • All other bits have their normal positive place values
  • Range: −2^(n−1) to +2^(n−1)−1

For 8-bit two's complement:

Bit position7 (MSB)6543210
Place value−1286432168421

Example: 11110100 in 8-bit two's complement:
= −128 + 64 + 32 + 16 + 0 + 4 + 0 + 0 = −128 + 116 = −12

Converting a Positive Denary to Two's Complement

For positive numbers, two's complement is the same as unsigned binary (as long as the MSB is 0).

Converting a Negative Denary to Two's Complement

Method 1 — Invert and add 1:

  1. Write the positive value in binary
  2. Invert all bits (flip 0→1 and 1→0) — this is the one's complement
  3. Add 1 to the result

Example: Represent −37 in 8-bit two's complement:

  • +37 in binary: 00100101
  • Invert: 11011010 (one's complement)
  • Add 1: 11011011
  • Verify: −128+64+16+8+2+1 = −128+91 = −37 ✓

Subtraction Using Two's Complement

To subtract A − B, compute A + (−B), where −B is the two's complement of B. This means computers only need addition circuits — no separate subtraction hardware.

Example: 53 − 37 = 16
Two's complement of 37 = 11011011
00110101 + 11011011 = 100010000
The carry out of bit 7 is discarded → 00010000 = 16 ✓

Sign and Magnitude (for comparison)

An alternative method where the MSB is a sign bit (0=positive, 1=negative) and the remaining bits represent the magnitude. This is not two's complement. Cambridge 9618 focuses on two's complement as the standard method.

Exam tip: When checking two's complement, verify by computing the value directly: sum the place values (with MSB = −128 for 8-bit). Always check the range: 8-bit two's complement stores −128 to +127. If asked to show subtraction, use A + two's complement of B and note the carry out should be discarded for correct results.
⚠️ Common Mistakes
  • Forgetting that the MSB in two's complement has a negative place value (−128 for 8-bit)
  • Adding 1 to get two's complement but carrying out incorrectly
  • Thinking all 1s = −1 is wrong — 11111111 = −1 in 8-bit two's complement (−128+127 = −1)
  • Confusing sign-magnitude with two's complement — they are different representations
  • Not noting overflow when the carry into the MSB ≠ carry out of MSB
✅ Notes completed!
Video coming soon

What's covered in this video

  • • Binary addition rules and worked examples with carry
  • • Two's complement representation and why computers use it
  • • Converting negative denary to two's complement (invert and add 1)
  • • Binary subtraction using two's complement and detecting overflow
Click slide or press arrow keys to navigate

Worksheet — 1.1.2 Binary Arithmetic & Two's Complement

8 questions · instantly marked · Cambridge 9618 standard

Q1Perform the binary addition: 01011010 + 00110111. Show your working and give the result in binary.[2]
✅ Mark scheme
Mark scheme
Working shown with carries [1]; Result: 10010001 [1]. (90+55=145 in denary. Check: 128+16+1=145 ✓)
Q2State what is meant by overflow in binary addition and give one situation where it would occur.[2]
✅ Mark scheme
Mark scheme
Overflow occurs when the result of an arithmetic operation is too large to be represented in the available number of bits [1]; e.g. adding two large positive numbers in 8-bit that produce a result greater than 127 (signed) or 255 (unsigned) [1].
Q3Represent the denary value −85 in 8-bit two's complement. Show all steps.[3]
✅ Mark scheme
Mark scheme
Step 1: +85 in binary = 01010101 [1]; Step 2: Invert all bits = 10101010 [1]; Step 3: Add 1 = 10101011 [1]. Verify: −128+32+8+2+1=−128+43=−85 ✓
Q4Convert the 8-bit two's complement value 11100110 to denary. Show your working.[2]
✅ Mark scheme
Mark scheme
MSB has value −128 (bit 7 set) [1]; −128+64+32+0+0+4+2+0 = −128+102 = −26 [1].
Q5Calculate 76 − 49 using 8-bit two's complement. Show all working.[3]
✅ Mark scheme
Mark scheme
76 = 01001100; −49: 49=00110001, invert=11001110, +1=11001111 [1]; Add: 01001100+11001111=100011011; Discard carry [1]; Result 00011011 = 27 [1]. (76−49=27 ✓)
Q6State the range of values that can be represented by 8-bit two's complement.[2]
✅ Mark scheme
Mark scheme
Minimum value: −128 (= −2⁷) [1]; Maximum value: +127 (= 2⁷−1) [1].
Q7Explain why two's complement is used rather than sign-magnitude for representing negative numbers in computers.[3]
✅ Mark scheme
Mark scheme
Only one representation of zero (sign-magnitude has +0 and −0) [1]; Addition and subtraction can use the same circuits — no special hardware needed for subtraction [1]; Arithmetic operations work correctly without any special cases [1].
Q8What is the denary value of the 8-bit two's complement number 10000000?[1]
✅ Mark scheme
Mark scheme
−128 [1]. The MSB has place value −128 and all other bits are 0.
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — 1.1.2 Binary Arithmetic & Two's Complement

10 questions · 10 marks · 10 minutes

← 1.1.1 Number Systems
2 of 82 · Cambridge 9618
1.1.3 Floating-Point →