GCSE · Computer Science · Edexcel · Spec 1CP2
Limitations of binary representation
Add 1 to 15 and you get 16. Ask a computer with only four bits and it says 0000. Not a glitch, a limit, and you're about to see why.
Computer Science · Data
Fill a four-bit register
You have exactly four bits. Switch them on one at a time and watch the denary value. Every number in this lesson is a positive whole number.
Computer Science · Overflow
Add 1 to 1111 in four bits
Add column by column, starting on the right. You only have four places to write the answer.
Four bits to work with. What ends up stored?
| Place | Adding | Write | Carry | Stored so far |
|---|---|---|---|---|
| start | 1111 + 0001 | - | - | ---- |
Output
Step 1: 1111 is 15 and 0001 is 1, so by hand we expect 16. We have four places to write in.
Step through with Next. Watch the Stored so far column fill up.
Computer Science · Naming the error
What went wrong?
Which error does each situation show?
Still to sort
Overflow (0)
The result is too large for the available bits.
Where the line is: Overflow is about a result being too big, whatever the calculation.
Underflow (0)
The result is so close to 0 that it can't be stored accurately, so it's treated as 0.
Where the line is: Underflow is about being too close to 0, not about a remainder being cut off.
Truncation (0)
A division leaves a remainder and everything after the decimal place is discarded.
Where the line is: Truncation needs a remainder. If the division comes out exactly, nothing is discarded.
No error (0)
The answer fits and nothing is lost.
Where the line is: A big-looking number can still be fine as long as it fits in the bits.
Every item is a four-bit situation. Pick the error, or decide there isn't one.
Predict, then check
A programmer is fed up with overflow and underflow errors.
What can the programmer do to avoid overflow and underflow, and what does it cost?
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
1111 + 1 = 0000
What you need to know
- A computer sets aside a fixed number of bits to store each binary number.
- So the biggest number you can store depends on the bits available: in four bits it's 1111, which is 15.
Have a goSam says a three-bit register can hold 10, "because it's a nice round number". Switch on every bit of a three-bit register. What's the biggest it can really hold?
111, which is 7 (4 + 2 + 1).
Once every bit is already 1 there is nowhere further to go, so the number of bits fixes the biggest value. Roundness doesn't come into it.
- Overflow is when a number is too large to store in the available bits. It happens when a calculation's result is too large.
- Try 1111 + 1 in four bits: 15 + 1 = 16 overflows, and the stored answer is 0000, which is incorrect.
Have a goSam claims both 7 + 8 and 9 + 8 overflow in four bits. Only one does. Which one, and why?
9 + 8. It makes 17, which is bigger than 15.
7 + 8 makes exactly 15, which still fits in 1111. Overflow needs a result that is too large for the bits, not just a big-looking sum.
- Underflow is the other end: the result is so close to 0 that the computer can't store it accurately, so it treats it as 0.
- Binary shifting moves the digits left or right, and the gaps are filled with 0s.
- Shifting left multiplies by a power of 2. Shifting right divides by a power of 2.
- A left shift can give a result that needs more bits than are available, which introduces an error.
- Only whole numbers (integers) are used here, so a division with a remainder is truncated: 5 ÷ 4 gives 1, not 1.25.
Have a goShift 0111 (which is 7) right by one place. What whole number is left, and where did the rest go?
0011, which is 3. The .5 from 7 ÷ 2 is discarded.
A right shift divides by a power of 2, and with only whole numbers a remainder is truncated. It isn't rounded up to 4.
- More bits avoid overflow and underflow, but they cost more storage space, so you must decide what matters more: space or error.
The big picture
A computer stores each binary number in a fixed number of bits, so there is a biggest number it can hold. Go past it and you get overflow, run too close to 0 and you get underflow, and shifting right can truncate a remainder. Using more bits avoids some errors, but it costs storage space.
Key points
Worked example
Problem
A four-bit register holds 0110 (that's 6). It is shifted left by two places. What should the answer be, and can four bits hold it?
⚠ Watch out
Assuming the computer always stores the right answer. It doesn't. With a fixed number of bits, a result that is too large overflows, a result too close to 0 is treated as 0, and a remainder is truncated.
Memory hook
Overflow is too BIG, underflow is too close to NOTHING, truncation is the remainder CHOPPED off. And in four bits, 1111 + 1 = 0000.
Check yourself
Name the error: (a) 17 in four bits, (b) a result so close to 0 it's stored as 0, (c) 13 ÷ 4 stored as 3. How could a programmer avoid (a) and (b)?
Flashcards
(11)What limits the size of a binary number a computer can store?
Biggest number that fits in four bits?
What is overflow?
In four bits, what is stored when you add 1 to 1111, and is it correct?
What is underflow?
In a binary shift, what fills the gaps?
What does shifting left do? Shifting right?
What error can a left shift cause?
What is truncation?
How can overflow and underflow be avoided, and what's the catch?
True or false: a computer always stores the correct result of a calculation.
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 11 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.