Custom Search

Overflow

A 'word' is a binary number. Registers are designed to hold 'words' of a certain number of bits. For example a 32-bit register holds 'words' of 32-bits (or 4 bytes).

Fixed word size means a fixed range of numbers will fit into that word. For example a 4-bit word can hold numbers from 0000 to 1111 (in decimal zero to fifteen).

Overflow sometimes occurs when the computer is doing arithmetic operations. When you perform calculations, the answer you get might have too many digits to fit in the register - the word size of the answer may be too big.

If this happens there is said to be an overflow.

Overflow occurs when a value cannot be represented in the number of bits allowed

The ALU must signal overflow so that no attempt will be made to use the result. The circuitry is made to detect overflow. For example if both inputs to an addition have the same sign and the output sign is different, the circuit knows that an overflow occurred. See the Cyberphysics page on ADDERS for detail of circuitry.