Overflow in Binary Arithmetic
. Discussion with examples.
In terms of computing, two numbers are loaded into registers before performing any arithmetic operations. For a number between 0 to 15 we can use a register of length 4 bits. When two 4 bit numbers are added and the result is greater than 4 bits then we get an overflow condition.
Overflow can occur in either of the two following scenarios:-
Adding two positive numbers.
Or, Adding two negative numbers in signed arithmetic.
Overflow can never
occur when adding a positive number to a negative number.