AQA GCSE CSPaper 2 · Unit 3Lesson 5

Paper 2 · Unit 3 · CS-L3-05

Binary Addition

60 minutes · AQA 8525 · Paper 2 — Fundamentals of data representation

Spec & Goals 3 min

AQA Spec 3.3.4 · Binary arithmetic

By the end of this lesson you can:

  1. Add two 8-bit binary numbers, working column by column with carries.
  2. State what is meant by an overflow error.
  3. Explain when an overflow error occurs during binary addition.

Warm-Up 5 min

Last lesson you measured data with units of information — bits, nibbles and bytes. A byte holds 8 bits.

Quick starter

In denary, what is the largest whole number you can store in 8 bits?

Reveal the answer

All eight bits set to 1 gives 11111111 = 128+64+32+16+8+4+2+1 = 255. Add one more and it no longer fits — that is the idea of overflow.

Key Concept — adding in binary 14 min

Binary addition works just like denary addition, but you only have the digits 0 and 1. You add each column from the right, carrying into the next column when needed.

The four rules

Every column uses one of these four rules.

SumResultWhat you write / carry
0 + 00write 0, no carry
0 + 11write 1, no carry
1 + 110write 0, carry 1
1 + 1 + 111write 1, carry 1 (this happens when a carry arrives)

Place values

An 8-bit number uses these place values. The rightmost bit is the least significant; the leftmost is the most significant bit.

1286432168421
bit 7bit 6bit 5bit 4bit 3bit 2bit 1bit 0

Overflow

An 8-bit byte can hold only the numbers 0 to 255. If a sum produces a carry out of the most significant bit, the answer needs a 9th bit — but there is no room for it.

Worked Example — two 8-bit sums 12 min

Problem 1: add 01011010 and 00110011.

Work from the right. The carry row shows the 1 carried into each column.

Place1286432168421
Carry in00110000
A01011010
B00110011
Sum10001101

Answer: 01011010 + 00110011 = 10001101. Check in denary: 90 + 51 = 141, and 10001101 = 128+8+4+1 = 141. Correct, and it fits in 8 bits — no overflow.

Problem 2 (overflow): add 11111111 and 00000001.

Place(carry out)1286432168421
Carry in111111110
A 11111111
B 00000001
Sum100000000

The true answer is 255 + 1 = 256 = 100000000 — that needs 9 bits. The carry out of the 128 column has nowhere to go in an 8-bit byte. This is an overflow error: the stored result wrongly shows 00000000.

Try It Yourself 12 min

🟢 Easy

Goal: Add 00000101 and 00000011. Give the 8-bit result.

Hint: that is 5 + 3 in denary. Check your binary answer converts back to 8.

🟡 Medium

Goal: Add 01101100 and 00101010. Show the carry in each column.

Hint: work right to left; 1 + 1 writes 0 and carries 1 into the next column.

🔴 Stretch

Goal: Add 10110011 and 01010101. State whether the sum overflows an 8-bit byte, and explain why.

📝 Exam Practice 10 min

Answer the way the examiner expects — the command word and the marks tell you how much to write.

Calculate[2 marks]

Add the binary numbers 00101101 and 00011010. Give your answer as an 8-bit binary number.

Mark scheme
  • Correct working shown column by column with carries (1).
  • Answer 01000111 (1). Check: 45 + 26 = 71 = 64+4+2+1.
State[1 mark]

State what is meant by an overflow error.

Mark scheme
  • The result is too large to be stored / represented in the number of bits available (1).
Explain[2 marks]

Explain when an overflow error occurs when adding two binary numbers.

Mark scheme
  • When the addition produces a carry out of the most significant bit (1).
  • So the answer needs more bits than are available / will not fit in the byte (1).

Recap & Key Terms 3 min

Binary addition adds two numbers column by column from the right, carrying a 1 when a column total is too big for one bit. If a carry escapes the most significant bit, the byte cannot hold the answer — that is an overflow error.

Binary addition
Adding binary numbers column by column, right to left, with carries — using the four rules 0+0, 0+1, 1+1 and 1+1+1.
Carry
A 1 passed into the next column to the left when a column total is 2 or more.
Overflow
An error where the result is too large for the number of bits available — caused by a carry out of the most significant bit.

Homework 1 min

Task (≤ 15 min): Add 11001100 and 01000111. State whether the result overflows an 8-bit byte.

Model answer
Place1286432168421
A11001100
B01000111
Sum10010011

True total: 204 + 71 = 275, which is above 255. There is a carry out of the 128 column, so the answer overflows an 8-bit byte. Award marks for: correct column working (1), and identifying the overflow (1).