CS01-07 Computer Science Watch
Overflow
Subscribe on YouTubeLike this lesson on YouTube
In this lesson
In this video you'll learn about overflow for GCSE Computer Science.
By the end: Explain overflow in relation to the number of bits available to store a value, and identify when a binary addition has overflowed.
What it covers
- 0:51 Overflow: the fixed container
- 2:49 The worked addition
- 5:17 Your turn, spot the overflow
- 7:04 Overflow in a running system
- 8:41 Exam technique
Key words
About this video
GCSE Computer Science - Overflow | Binary and number bases 7/9 (2026/27 exams)
In this video you'll learn about overflow for GCSE Computer Science.
Video code: CS01-07 - search YouTube for "ScholaFly CS01-07" to come straight back to this video.
Videos in this chapter:
CS01-00 — Binary and number bases - Intro
CS01-01 — Why computers use binary
CS01-02 — Denary to binary and back
CS01-03 — Why hexadecimal exists
CS01-04 — Denary and hexadecimal
CS01-05 — Binary and hexadecimal
CS01-06 — Binary addition
CS01-07 — Overflow
CS01-08 — Binary shifts
CS01-09 — Negative numbers and two's complement
#Overflow #GCSEComputerScience #ComputerScience
For more, visit ScholaFly: https://scholafly.com
Read the transcript
An arcade cabinet from the early eighties keeps your score in six digits. You are sitting on nine hundred and ninety nine thousand, nine hundred and ninety nine, you grab one more point, and the whole display rolls back to zero. Nothing inside that machine broke. The addition was done perfectly. There were simply no digits left for the answer to live in, so the top of it fell off the end.
This is video seven of nine in the chapter on Binary and number bases. If today feels shaky, C S oh one, oh six, Binary addition, covers the step just before this one.
Nothing in a computer gets a bigger box just because the number grew. So start with exactly how much eight bits can hold. Eight bits means eight slots, and every slot is one on-or-off value. Two choices, eight times over, gives two hundred and fifty six different patterns, and that is all of them. Those patterns run from all zeros at the bottom to all ones at the top. All zeros is nought. All ones is the largest value eight slots can carry, and there is nothing above it. Put the header back over the row: one twenty eight, sixty four, thirty two, sixteen, eight, four, two, one. Switch every one of those on, add them up, and you have the top of the range.
So, a quick one before we go further. With eight bits and nothing else, is the biggest whole number you can store one hundred and twenty eight, two hundred and fifty five, or two hundred and fifty six? Pick one. I'll wait. Two hundred and fifty five. Two hundred and fifty six is how many patterns exist, and because the counting starts at nought, the largest single value lands one below that.
Eight bits, nought to two hundred and fifty five, and no room anywhere for anything bigger.
Now run a real addition all the way through, and keep one eye on the far left column. Two eight-bit patterns are on screen, and in ordinary numbers they are two hundred and fourteen and one hundred and thirteen. Adding in binary never needs a trip through ordinary numbers, and C S oh one, oh six, Binary addition, makes that point. I am converting here only so you can check the true total against the stored one. Right to left, the first four columns are quiet: one, one, one, then a zero, and nothing carried yet. Halfway along, two ones meet in the same column. Write zero, carry one. From there a carry lands in every column that is left. The eight answer bits come out as oh one oh oh oh one one one, and then one more carry drops out of the leftmost column. That carry is a ninth bit. The true total is three hundred and twenty seven, and three hundred and twenty seven cannot be written in eight bits. The store is eight bits wide from start to finish. There is no ninth slot for that carry to be written into, so it is discarded. What is left behind reads as seventy one. Two hundred and fourteen plus one hundred and thirteen, added correctly, stored as seventy one. That is overflow, and notice what it is not. Every column was added correctly. The answer is wrong because it did not fit, not because the working went wrong. Here is your line for this video: nine bits of answer, eight bits of box. Eight slots in, eight slots out, however big the true total turns out to be.
Time to catch it yourself, in three additions that somebody else has already finished. Three eight-bit additions are on screen, labelled A, B and C, each one worked out in full. Exactly one of them has overflowed. Ignore how big the answers look, and ignore how many carries happened inside the row. Only one thing on that screen counts as overflow. Take your pick, and hold on to your reason. I'll wait. It is B. In B, and only in B, a carry comes out of the leftmost column and finds no ninth slot waiting for it. A lands on two hundred and twenty three. It starts with a one and it looks enormous, and it still sits inside eight bits with room to spare. C carries through almost every column on the way and finishes on sixty four. Carries inside the row are ordinary addition. Only a carry leaving the row is overflow. So the check is one thing and one thing only. Look at the leftmost column, and see whether anything came out of it. Find that carry and you have found the overflow, every single time.
This is not only a paper exercise, so put those same eight bits inside something that runs. A program keeps a count of items in an eight-bit variable. The count climbs all day, reaches two hundred and fifty five, and then one more item arrives. The addition gives two hundred and fifty six, which needs nine bits. Eight bits are stored, so the count now reads zero, and a screen somewhere says the shelf is empty. Give both halves of that in an answer: the new bit pattern, which is all zeros, and what it did to the value, which is a count of nothing at all. And here is the sentence worth copying out. Not, the number was too big. Say it as, the result needs nine bits and only eight bits are available to store it. One more thing worth knowing. Addition is not the only way a bit escapes, because a shift can push one off the end too, and C S oh one, oh eight, Binary shifts, is where that lives. Right answer, wrong container, and a system that quietly carries on with a wrong number.
The boards split on this topic, so before anything else, check whose exam you are actually sitting. Edexcel and OCR both set overflow. OCR asks you to explain overflow errors that come from adding two eight-bit numbers. Edexcel words it as overflow in relation to the number of bits available to store a value. A Q A sets no overflow statement at all. Its binary addition content says answers will not carry beyond the eighth bit, so if you are sitting A Q A, treat this as useful background rather than something you will be asked. Where the command word is explain, Edexcel publishes what that demands: describe gives an account, explain has to carry reasoning. So the reason goes in the answer, not just the label. Take a question like this one: explain what has happened when an eight-bit addition produces a ninth bit. A half answer says the number was too big. A full answer says the result needs nine bits, only eight bits are available, the extra bit is lost, and the stored value is wrong. Wording is what earns it here, and the two words doing the heavy lifting are bits available.
Nine bits of answer, eight bits of box. Say that once, then take the rest of it back in order. A fixed number of bits holds a fixed range of values, and eight bits runs from nought to two hundred and fifty five. Overflow is what happens when a result needs more bits than there are available to store it. You spot it in an addition as a carry coming out of the leftmost column, with no ninth slot to take it. And the arithmetic was right the whole way along. The stored answer is still wrong, and a real system carries on using it.
Before you go, a quick way of keeping track of this chapter. A thumbs up on a video means you have properly nailed it, so you never have to sit through that one again. Anything left without one is your own list to come back to. If this has not clicked yet, save the video or the whole playlist and try again in a few days, because it often lands second time round.
Next in the chapter: Binary shifts, where bits move sideways inside that same fixed frame.
For more, visit scholafly.com, or watch the next video.
Related terms
For: Edexcel GCSE 1CP2, OCR GCSE J277
On the specification
For teachers
This GCSE Computer Science lesson teaches overflow. By the end, students should be able to explain overflow in relation to the number of bits available to store a value, and identify when a binary addition has overflowed. It works through two worked examples and the mistakes examiners report.