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

0 = 0

4-bit binary 0000 = 0 in denary

Denary0
Click a bit to flip it. Can you make the value bigger than 15?

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.

Exam line: Four bits can hold at most 1111, which is 15 in denary.
Watch out: There is no fifth switch. Once every bit is a 1, there is no way to make the number bigger.

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?

PlaceAddingWriteCarryStored so far
start1111 + 0001------

Output

 

Step 1: 1111 is 15 and 0001 is 1, so by hand we expect 16. We have four places to write in.

1 / 6

Step through with Next. Watch the Stored so far column fill up.

Step 1 of 6: 1111 is 15 and 0001 is 1, so by hand we expect 16. We have four places to write in..

Exam line: Overflow: the result is too large for the available bits, so the stored answer is wrong.
Watch out: Overflow is the too-big end. At the other end, a result so close to 0 that it can't be stored accurately is treated as 0. That's underflow.

Computer Science · Binary shifts

Shift right, then check the answer

A four-bit register holds 0101 (that's 5). Shift it right by two places. What is stored?

  1. Start with 0101 = 5. Shifting right divides by a power of 2, and two places means dividing by 4.So we expect 5 ÷ 4.
  2. missing step
Which line is step 2?

Exam line: A right shift divides by a power of 2, gaps fill with 0s, and any remainder is truncated.

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.

6 of 6 still to sort.

Every item is a four-bit situation. Pick the error, or decide there isn't one.

Exam line: Too big for the bits: overflow. So close to 0 it's treated as 0: underflow. A remainder discarded: truncation.

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

1A fixed number of bits means a fixed biggest number. Four bits top out at 1111 = 15.
2Overflow: the result is too large for the bits. Underflow: the result is so close to 0 it's treated as 0.
3Shift left to multiply by a power of 2, shift right to divide by one, and fill gaps with 0s.
4Truncation: with whole numbers only, a remainder is discarded, so 5 ÷ 4 gives 1.
5More bits avoid overflow and underflow but need more storage space, so there's a space-versus-error choice.

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?
The fixed number of bits allocated to store it.
Biggest number that fits in four bits?
1111, which is 15 in denary.
What is overflow?
A number is too large to be represented in the available binary digits. It happens when the result of a calculation is too large.
In four bits, what is stored when you add 1 to 1111, and is it correct?
0000. It's incorrect: 15 + 1 = 16 overflows.
What is underflow?
A number is too small to be stored in the available binary digits: so close to 0 that the computer can't store it accurately and treats it as 0.
In a binary shift, what fills the gaps?
0s.
What does shifting left do? Shifting right?
Left multiplies by a power of 2. Right divides by a power of 2.
What error can a left shift cause?
The result can need more bits than are available, which introduces an error.
What is truncation?
With only whole numbers, a division's remainder is discarded: anything after the decimal place goes. 5 ÷ 4 gives 1, not 1.25.
How can overflow and underflow be avoided, and what's the catch?
Allocate more binary digits. But more digits need more storage space, so you weigh up space against the error.
True or false: a computer always stores the correct result of a calculation.
False. A fixed number of bits can cause overflow, underflow or truncation.

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 posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

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.