Example of addition of two unsigned binary numbers
Signed numbers in two's complement notation may be added by following these rules:
1. If the numbers have different signs, they may be added as unsigned numbers, and no overflow will occur.
2. If the numbers have the same sign, they are added and the sign of the resulting number is the same with the sign of both numbers, no overflow occurred.
3. If the numbers have the same sign, they are added and the sign of the resulting number is different than the sign of both numbers, overflow occurred.
Let's add the following unsigned binary numbers: 110010 and 101000.
Both numbers are negative, and at the last step of the addition, we notice that the sign of 011010 is positive, so we need to take the overflow bit into consideration.