- Why the number of bits available limits the values a computer can store.
- What overflow means for 8-bit unsigned binary values.
- How overflow can also happen with 8-bit two’s-complement signed values.
- How to spot common overflow traps in GCSE questions.
A bit is a binary digit: it can store either 0 or 1. When you put several bits together, each different arrangement of 0s and 1s is called a bit pattern.
A computer does not have unlimited space for every value. In exam questions, you are often told a value is stored using a fixed number of bits, such as 8 bits.
Bits and bytes
A byte is 8 bits. In Edexcel GCSE questions, 8-bit binary values are usually written in two groups of four bits, such as 1111 1111.
If you have more bits, you can store more patterns. If you have fewer bits, you can store fewer patterns.
For nnn bits, the number of possible bit patterns is 2n2^n2n.
Finding the unsigned 8-bit range
-
Each bit has 2 possible states, so the number of patterns for nnn bits is 2n2^n2n.
-
Substitute 8 bits: 28=2562^8 = 25628=256, so 8 bits can store 256 different patterns.
-
For an unsigned integer, counting starts at 0, so the highest value is one less than the number of patterns: 28−1=2552^8 - 1 = 25528−1=255.
-
Therefore, an 8-bit unsigned integer can store denary values from 0 to 255.
An integer is a whole number. A binary integer can be interpreted in different ways depending on the representation being used.
Unsigned and signed integers
- An unsigned integer represents zero and positive values only. For 8 bits, the range is 0 to 255.
- A signed integer can represent negative and positive values. In this specification, signed 8-bit integers use two’s complement, with a range of −128 to +127.
The same bit pattern can mean different things depending on whether it is treated as unsigned or signed. For example, 1000 0000 is 128 if it is unsigned, but −128 if it is two’s-complement signed.
The range depends on the representation
Overflow is not just about the bit pattern itself. It is about whether the correct denary value can fit in the range allowed by the number of bits and the representation being used.
Overflow happens when the result of a calculation, or the value being stored, is outside the range that can be represented using the available number of bits.
Overflow
Overflow is when a value needs more bits than are available, so the correct value cannot be represented in the fixed-size binary storage.
For an 8-bit unsigned integer:
- 0000 0000 represents 0
- 1111 1111 represents 255
- 1 0000 0000 represents 256, but this needs 9 bits
So if you only have 8 bits, 256 cannot be stored as an unsigned 8-bit value.
This diagram shows the two main 8-bit overflow cases: unsigned overflow when a carry goes beyond 8 bits, and signed overflow when the correct signed answer is outside −128 to +127.

In unsigned 8-bit arithmetic, overflow happens if the correct answer is greater than 255.
A common sign is a carry out beyond the leftmost bit. A carry out is an extra 1 that would need another bit position to be stored.
For example, 1111 1111 plus 0000 0001 gives 1 0000 0000. That answer needs 9 bits. If the storage only has 8 bits, the extra leftmost 1 cannot fit.
Checking overflow in unsigned addition
-
Identify the values being added: 1100 1000 is denary 200, and 0110 0100 is denary 100.
-
Add the denary values to know the correct result: 200 + 100 gives 300.
-
Compare the correct result with the unsigned 8-bit range, 0 to 255. Since 300 is greater than 255, the correct result cannot fit.
-
In binary, the result is 1 0010 1100, which needs 9 bits. If only the lowest 8 bits are stored, the stored pattern would be 0010 1100, which is denary 44, not 300.
Thinking the leftmost bit is overflow
The leftmost bit of an 8-bit value is still part of the value. For example, 1000 0000 is a valid 8-bit pattern. Overflow only occurs when the correct answer needs a bit beyond the available 8 bits, or is outside the allowed range.
In some fixed-size binary systems, if a result is too large, the extra bit is discarded and only the bits that fit are stored. This can make the value appear to “wrap around” to the start of the range.
For unsigned 8-bit values:
- 255 is 1111 1111
- adding 1 gives 1 0000 0000
- only 8 bits fit, so 0000 0000 may be stored
- the stored value looks like 0, even though the correct answer was 256
Overflow produces an incorrect stored value
The computer has not magically calculated 255 + 1 as 0. The correct answer needs 9 bits, but only 8 bits are available, so the stored bit pattern no longer represents the true answer.
Hexadecimal shortcut
A nibble is 4 bits, and one hexadecimal digit represents one nibble. So an 8-bit value is two hexadecimal digits. FF is the largest unsigned 8-bit value; needing a third hexadecimal digit, such as hexadecimal 100, means the value will not fit in 8 bits.
For 8-bit two’s-complement signed integers, the range is −128 to +127.
This means overflow can happen in two directions:
- the answer is greater than +127
- the answer is less than −128
In two’s complement, the leftmost bit helps show whether the value is negative or non-negative:
- values starting with 0 are non-negative
- values starting with 1 are negative
However, do not treat this as a simple “minus sign”. Two’s complement is a representation system that allows addition to work neatly with both positive and negative numbers.
For signed two’s-complement addition, the carry out by itself is not a reliable test.
Instead, use this rule:
- positive + positive should give a positive result
- negative + negative should give a negative result
- if adding two numbers with the same sign gives a result with the opposite sign, signed overflow has happened
Checking overflow in two's-complement addition
-
Identify the signs: 0110 0100 is +100, and 0011 0010 is +50. Both are positive because they start with 0.
-
Add the binary values: 0110 0100 + 0011 0010 gives 1001 0110.
-
Check the correct denary answer: +100 + +50 gives +150.
-
Compare +150 with the signed 8-bit range, −128 to +127. Since +150 is too large, it cannot be stored.
-
The stored pattern 1001 0110 starts with 1, so it would be interpreted as a negative two’s-complement value. A positive plus a positive has produced a negative-looking result, so this is signed overflow.
Using the unsigned carry rule for signed values
For unsigned addition, a carry out beyond 8 bits shows overflow. For signed two’s-complement addition, overflow is about the signed range −128 to +127, not just whether there is a carry out.
The same denary value might overflow in one situation but fit perfectly in another.
For example, denary 256 cannot fit in 8-bit unsigned binary because 8 bits only allow 0 to 255. But it can fit if 9 or more bits are available, because 256 is 1 0000 0000 in binary.
So when you answer an overflow question, always ask:
- How many bits are available?
- Is the value unsigned or signed two’s complement?
- What is the allowed range?
- Is the correct answer inside or outside that range?
Real systems may behave differently
GCSE overflow questions normally assume fixed-size binary storage, such as 8 bits. Some programming languages or systems may automatically use more storage or raise an error, but the exam concept is about what happens when only a fixed number of bits are available.
Overflow happens because binary storage is finite. With 8 bits, there are only 256 possible bit patterns.
For Edexcel GCSE Computer Science, remember these key ranges:
- 8-bit unsigned: 0 to 255
- 8-bit two’s-complement signed: −128 to +127
If the correct value is outside the relevant range, it cannot be represented using those 8 bits, so overflow has occurred.
In the exam
-
First identify the number of bits and whether the question is using unsigned or two’s-complement signed values.
-
Compare the correct denary result with the allowed range before trusting the stored binary pattern.
-
For unsigned addition, look for a carry out beyond 8 bits; for signed addition, check whether adding two values with the same sign gives a result with the opposite sign.
Check yourself
- Why is the largest 8-bit unsigned value 255 rather than 256?
- What happens to 1111 1111 + 0000 0001 if only 8 bits can be stored?
- How can you tell that signed overflow has happened when adding two positive two’s-complement numbers?