GCSE · Computer Science · Edexcel · Spec 1CP2
Overflow
1111 + 1 should be 16. Put it in a four-bit register and you get 0000. How does a correct calculation turn into zero?
Computer Science · Data representation
1111 + 1 in a four-bit register
Four boxes. Watch the carry move left, box by box, until it has nowhere to go.
Make a prediction first: when the carry reaches the end, what will the four boxes hold?
1 1 1 1 1 (15)2 + 0 0 0 1 (1)3 _ _ _ _ only four boxes
| Column | Bit of 1111 | Bit of 0001 | Carry in | Stored | Carry out |
|---|---|---|---|---|---|
| 1st (right) | 1 | 1 | 0 | 0 | 1 |
Output
Register: _ _ _ 0
Step 1: Start at the right-hand box. 1 + 1 makes 10 in binary, so we write 0 in the box and carry the 1 to the left.
Press Next to move the carry one box to the left. The Back button lets you replay it.
Computer Science · Data representation
Fits or overflows?
Each calculation must be stored in four bits. Work out the decimal result, then decide where it goes.
Still to sort
Fits in four bits (0)
The decimal result is 15 or less.
Where the line is: Exactly 15 still fits, because 1111 is the largest four-bit number.
Overflows (0)
The decimal result is more than 15.
Where the line is: The first result that overflows is 16, not 15.
Four bits again. Work out the decimal result, then compare it with 15.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
When a correct answer is too big for the bits you gave it
What you need to know
- A number is stored in a fixed number of bits, and those bits set the largest value it can hold.
- The largest number four bits can store is 1111, which is 15 in decimal.
Have a goSam is confidently wrong: 'The biggest number four bits can hold is 10000, because that's 16.' What is the real biggest number, in binary and decimal?
1111, which is 15 in decimal.
10000 has five digits, so it cannot fit in four bits. 1111 is the largest four-digit pattern.
- Overflow is when a number is too large to be stored in the bits allocated for it.
- Add 1 to 1111 with four bits and 16 will not fit: an overflow error occurs and the stored answer is 0000, which is incorrect.
- To check a sum, convert to decimal, add, then compare the result with 15 for four bits.
Have a goTry it before you look: does 0110 + 1011 fit in four bits? Convert, add, compare.
No. 6 + 11 = 17, which is more than 15, so it overflows.
The check is the decimal result against 15. Anything above 15 is too large for four bits.
- 1101 + 11 overflows in four bits (13 + 3 = 16), but 1000 + 101 (13) and 101 + 111 (12) fit.
- Shifting left multiplies by a power of 2, so a left shift can overflow too, not just addition.
Have a goPredict: 1000 is shifted left by 1 place in a four-bit register. Does it overflow? Say yes or no and show the decimal check.
Yes. 8 × 2 = 16, which is more than 15.
A left shift by 1 place doubles the value. It is not only addition that can push a result past 15.
- Allocating more binary digits avoids overflow errors, but more digits need more storage space.
Have a goTom has a plan: 'Give every number loads of bits and overflow can never bother us. It's free!' What is the catch?
More binary digits need more storage space.
Extra bits do avoid overflow errors, but they cost storage, so it is a trade-off rather than a free fix.
- Overflow errors can have serious consequences, so check that enough memory is allocated for the result.
The big picture
A number is stored in a fixed number of bits, so a calculation or a left shift can give a result too large to fit. That is an overflow error and the stored value is incorrect. More bits avoid it, but need more storage.
Key points
Worked example
Problem
Four bits are allocated for the answer. Will 1011 + 110 fit?
⚠ Watch out
Thinking the computer will simply hold the bigger answer. Four bits stop at 1111 (15), and a larger result is an overflow error.
Memory hook
Four boxes, one ceiling: 15. A result that needs a fifth box has nowhere to go.
Check yourself
0101 is shifted left by 3 places in a four-bit register. Without looking back, work out whether the result overflows, and show the decimal check.
Flashcards
(10)What is the largest number four bits can store?
What is overflow?
Four bits, 1111 + 1. What goes wrong?
How do you check whether a binary sum fits in four bits?
Why does 1101 + 11 overflow in four bits?
Is a result of exactly 15 an overflow in four bits?
Why can shifting left cause overflow?
How can overflow errors be avoided, and what is the cost?
Why check that enough memory has been allocated to a result?
What does the 0000 in 1111 + 1 picture show?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore Edexcel GCSE Computer Science topics
How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 21 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.