Spec & Goals 3 min
AQA Spec 3.3.4 · Binary arithmetic
By the end of this lesson you can:
- Add two 8-bit binary numbers, working column by column with carries.
- State what is meant by an overflow error.
- 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.
| Sum | Result | What you write / carry |
|---|---|---|
0 + 0 | 0 | write 0, no carry |
0 + 1 | 1 | write 1, no carry |
1 + 1 | 10 | write 0, carry 1 |
1 + 1 + 1 | 11 | write 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.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 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.
| Place | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| Carry in | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| A | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| B | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| Sum | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 |
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) | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|
| Carry in | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| A | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| B | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
| Sum | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
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
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.
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.
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.
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 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 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
| Place | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|
| A | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| B | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 |
| Sum | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 |
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).