Pearson Edexcel · GCSE · Computer Science
Course version: 1CP2 · Version from Sept 2020
Understand the concept of overflow in relation to the number of bits…
Full specification wording
Binary: 2.1.5 understand the concept of overflow in relation to the number of bits available to store a value
Overflow happens when a value needs more bits than the storage location provides, so the extra most significant bits cannot be held and the stored result is wrong.
Checked against the Pearson Edexcel 1CP2 specification (opens in a new tab) on .
- Point 5 of 6
- 4 key terms
Study notes
From the checked teaching notes for this specification point.
The idea
Overflow happens when a value needs more bits than the storage location provides, so the extra most significant bits cannot be held and the stored result is wrong. With n bits you can represent 2ⁿ distinct patterns; for unsigned integers these are 0 to 2ⁿ − 1. An 8-bit register holds 0 to 255, so adding 200 + 100 gives a true value of 300, which needs 9 bits (1 0010 1100₂); the register keeps only the low 8 bits, 0010 1100₂ = 44, and the carry out of the most significant bit is lost. A 4-bit register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3. Overflow is therefore about the number of bits available, not about a calculation being mathematically impossible.
What earns the marks
- Overflow occurs when the result of a calculation requires more bits than are available in the storage location.
- With n bits there are 2ⁿ possible bit patterns; for unsigned values the range is 0 to 2ⁿ − 1.
- An 8-bit unsigned register holds 0 to 255, so 200 + 100 = 300 overflows and stores 44 because the ninth bit is discarded.
- A 4-bit unsigned register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3.
- The carry out of the most significant bit position is lost, so the stored value is incorrect.
- Overflow depends on the fixed width of the register or field, not on the size of the numbers alone.
Common mistakes and how to put them right
Thinking overflow means the answer is mathematically impossible.
Put it right: It means the fixed number of bits is too few, so the stored result is truncated.
Believing a larger number always overflows.
Put it right: Overflow depends on the bit width, so 300 overflows in 8 bits but not in 16 bits.
Forgetting that the range for n unsigned bits is 0 to 2ⁿ − 1, not 0 to 2ⁿ, so 8 bits give 255 as the maximum, not 256.
Assuming the extra bit is rounded rather than discarded.
Put it right: The most significant carry is simply lost.
Exam tips
- State the bit width and the unsigned range before deciding whether a sum overflows.
- Show the binary addition and identify the carry out of the most significant bit to justify your answer.
- Check the stored result by subtracting the modulus 2ⁿ from the true value, for example 300 − 256 = 44.
Try the lesson
The start of the Binary: 2.1.5 understand the concept of overflow in relation to the number of bits available to store a value lesson, made from checked teaching notes for this specification point.
Have a go first
An 8-bit register stores unsigned whole numbers. What is the largest denary value it can hold without overflow?
Listen
Overflow happens when a value needs more bits than the storage location provides, so the extra most significant bits cannot be held and the stored result is wrong. With n bits you can represent 2ⁿ distinct patterns; for unsigned integers these are 0 to 2ⁿ − 1. An 8-bit register holds 0 to 255, so adding 200 + 100 gives a true value of 300, which needs 9 bits (1 0010 1100₂); the register keeps only the low 8 bits, 0010 1100₂ = 44, and the carry out of the most significant bit is lost. A 4-bit register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3. Overflow is therefore about the number of bits available, not about a calculation being mathematically impossible. A strong answer earns marks for these points. Overflow occurs when the result of a calculation requires more bits than are available in the storage location. With n bits there are 2ⁿ possible bit patterns; for unsigned values the range is 0 to 2ⁿ − 1. An 8-bit unsigned register holds 0 to 255, so 200 + 100 = 300 overflows and stores 44 because the ninth bit is discarded. A 4-bit unsigned register holds 0 to 15, so 12 + 7 = 19 overflows and stores 3. Exam tip: State the bit width and the unsigned range before deciding whether a sum overflows.
Key words
Say what each word means before you turn the card.
Fixed-width storage
Try answering aloud or in your head before turning the card.
Unsigned range 0 to 2ⁿ − 1
Try answering aloud or in your head before turning the card.
Carry out of the most significant bit
Try answering aloud or in your head before turning the card.
Truncated stored result
Try answering aloud or in your head before turning the card.
See every definition
- Fixed-width storage
- A storage location with a set number of bits, so a value needing more bits than it provides cannot be held.
- Unsigned range 0 to 2ⁿ − 1
- With n bits there are 2ⁿ possible bit patterns, and for unsigned values these give the range 0 to 2ⁿ − 1.
- Carry out of the most significant bit
- The extra most significant bit produced by a calculation, which is lost because the storage location cannot hold it.
- Truncated stored result
- The incorrect value kept when only the low bits are stored and the extra most significant bits are discarded.
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Binary: 2.1.5 understand the concept of overflow in relation to the number of bits available to store a value
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge