← IGCSE Computer Science Paper 1

Overflow in an 8-bit register

An error when an 8-bit addition gives a result over 255. It needs a 9th bit, so the carry out of the leftmost column is lost and the stored result is wrong.

Understanding Overflow in an 8-bit register in IGCSE Computer Science Paper 1

What it does: The true answer 300 is 100101100 in binary. Only the right-hand 8 bits, 00101100 (44), are stored, so the result is wrong. The largest value 8 bits can hold is 255. Any sum over 255 needs a 9th bit, so it causes an overflow error. Overflow happens when a carry comes out of the leftmost (128s) column. There is no 9th column to store it. 255 + 1 = 256. In binary that is 1 followed by eight 0s, so 9 bits are needed. 255 + 1 = 256, which needs a 9th bit. An 8-bit register can only hold 0 to 255, so this addition overflows.

Common mistakes: The largest value an 8-bit register can hold is 255, not 256. 256 needs a 9th bit. It should be max8 <- 255. 255 + 1 = 256, which is 100000000 in binary and needs 9 bits. An 8-bit register cannot hold it. It should be bitsNeeded <- 9.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 18–27) and word search (Modules 3–27).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
An 8-bit register adds 11111111 + 00000001. What happens?
The answer 256 fits in 8 bitsOverflow: the answer needs a 9th bit
Matches
11111111 + 00000001 = 00000000, no overflow
↓
The answer 0 looks fine, but 255 + 1 = 256 needs 9 bits. The carry out of the leftmost column is lost, so this is an overflow error.
Applying
Meanings
Term
overflow
Meaning
An error when an 8-bit addition gives a result over 255. It needs a 9th bit, so the carry out of the leftmost column is lost and the stored result is wrong.
Practice
11111111 + 00000001 = 1 00000000
Testing
Gaps
11111111 + 00000001 =
Check Answer
Spots
1max8 <- 256
2total <- 200 + 100

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Arctic Hare' badge — Speed Indexer, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. An 8-bit register adds 11111111 + 00000001. What happens?
A. The answer 256 fits in 8 bits
B. Overflow: the answer needs a 9th bit ✓
255 + 1 = 256, which needs 9 bits (100000000). An 8-bit register can only hold 0 to 255, so overflow occurs.
2. Which addition causes overflow in an 8-bit register?
A. 100 + 100
B. 200 + 100 ✓
200 + 100 = 300, which is over 255. 100 + 100 = 200 fits in 8 bits, so there is no overflow.
3. Where does the overflow bit come from?
A. A carry out of the leftmost column ✓
B. A carry out of the rightmost column
Overflow happens when a carry comes out of the leftmost (128s) column. There is no 9th column to store it.
4. What is the result stored in the register when overflow happens?
A. Wrong, because the 9th bit is lost ✓
B. Correct, because the computer adds an extra bit
An 8-bit register cannot grow a 9th bit. The carry is lost, so the stored result is wrong.
5. What is the largest denary result an 8-bit register can store without overflow?
A. 255 ✓
B. 256
8 bits store 0 to 255. A result of 256 or more is too big and causes overflow.

Match the Pairs

11111111 + 00000001 = 1 00000000 → The true answer needs 9 bits, because 255 + 1 = 256 is too big for 8 bits
11001000 + 01100100 = 1 00101100 → A carry out of the leftmost column, so overflow has happened
The 8-bit register keeps only 8 bits, so the carried 9th bit is lost and the stored result is wrong → stored result = 00101100 (should be 300)
Overflow happens when the sum of two 8-bit numbers is greater than 255 → IF sum > 255 THEN overflow
11111111 + 00000001 = 00000000, no overflow → The answer 0 looks fine, but 255 + 1 = 256 needs 9 bits. The carry out of the leftmost column is lost, so this is an overflow error.
An 8-bit register can store 100 + 200 = 300 → An 8-bit register can only hold values up to 255, so 300 cannot be stored and an overflow occurs.

Key Term

overflow
An error when an 8-bit addition gives a result over 255. It needs a 9th bit, so the carry out of the leftmost column is lost and the stored result is wrong.

Fill in the Blanks

1. 11111111 + 00000001 = 100000000
Hint: Type the full result of the addition. It is longer than 8 bits.
2. 255 + 1 = 256, which needs 9 bits
Hint: Type how many bits are needed to store this result.
3. Result over 255 in 8 bits: overflow error
Hint: Type the name of the error that happens when the result is too big for the register.
4. Overflow: carry out of the leftmost column
Hint: Type the word for which end column the extra carry comes out of.
5. 11111111 + 00000010 = 100000001 Stored in 8 bits: 00000001
Hint: Type the 8 bits that are kept once the carry out of the leftmost column is lost.

Spot the Error

Question 1
A max8 <- 256
B total <- 200 + 100
C IF total > max8 THEN
D OUTPUT "Overflow"
E ENDIF
Line A — The largest value an 8-bit register can hold is 255, not 256. 256 needs a 9th bit. It should be max8 <- 255.
Question 2
A a <- 255
B b <- 1
C bitsNeeded <- 8
D OUTPUT "Overflow"
Line C — 255 + 1 = 256, which is 100000000 in binary and needs 9 bits. An 8-bit register cannot hold it. It should be bitsNeeded <- 9.
Question 3
A 11111111 (255)
B + 00000001 (1)
C ----------
D 1 00000000 (255)
Line D — The 9-bit answer 100000000 is 256 in denary, not 255. It should be 1 00000000 (256).
Question 4
A total <- 250 + 10
B IF total < 255 THEN
C OUTPUT "Overflow"
D ELSE
E OUTPUT total
F ENDIF
Line B — Overflow happens when the result is over 255, so the test must use >. It should be IF total > 255 THEN.
Question 5
A a <- 200
B b <- 100
C total <- a - b
D carry <- total DIV 256
E OUTPUT carry
Line C — Overflow comes from an addition whose result is over 255. Subtracting does not produce it. It should be total <- a + b.

Student with a class code? Join your class →