Data Representation · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 12% of your exam marks.
Binary/hex conversion and binary arithmetic appear in every Paper 1. Consistently 8 to 15 marks.
A computer stores numbers using a fixed number of bits. An 8-bit register can hold values from 0 to 255. An overflow error happens when the result of an addition is too big to fit in the available bits.
Adding 11111111 (255) and 00000001 (1) should give 256. In binary, 256 is 100000000, which is 9 bits long. An 8-bit register can only hold 8 bits, so the leftmost 1 has nowhere to go. The register ends up holding 00000000 and a carry of 1 has been generated out of the most significant bit.
An overflow has occurred when the result of an addition needs more bits than the register can hold, producing a carry out of the leftmost column.
If the program does not check for overflow, the carried-out bit is silently lost and the result inside the register is wrong. In safety-critical software (aircraft, medical devices, financial systems), undetected overflow can cause serious failures. Real CPUs set an overflow flag in a status register so that the program can detect and handle it.
Example exam answer for "explain what an overflow error is":