Binary addition and overflow explained
Learn eight-bit binary arithmetic with worked sums, practical overflow examples and independent questions.
8-bit examples · original GCSE practice
Why do we add binary numbers?
Binary uses only 0 and 1. Computer hardware represents values using fixed numbers of bits; for an unsigned 8-bit value the range is 0 to 255. Binary addition uses carrying, just like denary addition, except a column containing 1 + 1 becomes binary 10: write 0 and carry 1.
Worked example: 13 + 7 = 20
Convert the two denary numbers into eight-bit binary:
00001101 (13)
+ 00000111 (7)
----------
00010100 (20)From right to left: 1 + 1 = 10, so write 0 and carry 1. On the next columns, include the carried 1 before moving left. The final result is 00010100, which represents 16 + 4 = 20.
What is overflow in an unsigned 8-bit number?
Overflow happens if the result is larger than the maximum value representable in the chosen number of bits. An unsigned byte can represent 0 to 255. Adding one to 255 needs nine bits:
11111111 (255)
+ 00000001 (1)
----------
100000000 (256, needs 9 bits)If only eight bits are stored, the retained pattern is 00000000 and the carry out is lost. That is unsigned overflow; it is not evidence that 255 + 1 really equals zero.
Signed interpretation is different
In eight-bit two's-complement representation, the range is −128 to +127. The pattern 01111111 represents +127. Adding 00000001 gives 10000000, which is interpreted as −128. That is signed overflow because the true result, +128, is outside the signed range. A carry-out flag alone is not the correct test for signed overflow.
Always check whether an exam question specifies unsigned binary, two's complement or a fixed bit-width before deciding if overflow has occurred.
Three original self-check questions
- Add
00000101and00000011. Give the answer as eight bits. - Add unsigned
11111110and00000010. What is the real sum, and what eight-bit result remains? - Can the signed eight-bit value +100 be added to +50 without signed overflow?
Reveal the worked answers
- 5 + 3 = 8, so
00001000. - 254 + 2 = 256, written as
100000000. An eight-bit register retains00000000; unsigned overflow occurs. - No. 150 exceeds the largest signed eight-bit value, +127. The eight-bit pattern would represent a negative number, not +150.
How to check your exam working
- Identify the number of bits and whether the values are signed or unsigned.
- Line the bits up by place value and work from right to left.
- Write carry bits carefully and include them in the next column.
- Convert the result to denary as a reasonableness check.
- Explain overflow using the range of values that can be stored.
