We consider the addition of two complement numbers and . A binary adder for adding unsigned binary numbers is used to add the two numbers. The sum is denoted by and the carry-out by . Which one of the following options correctly identifies the overflow condition?
View worked solution
Answer: B
In 's complement representation, the most significant bit (MSB) acts as the sign bit ( for positive numbers and for negative numbers). Here, the sign bits of the two numbers are and , and the sign bit of the resulting sum is .
An overflow in 's complement addition occurs if and only if adding two numbers of the same sign yields a result with the opposite sign. Adding two numbers of opposite signs can never result in an overflow.
This gives us two mutually exclusive scenarios for overflow:
- Adding two negative numbers yields a positive sum:
- Both inputs are negative: and
- The sum is positive:
- Boolean term:
- Adding two positive numbers yields a negative sum:
- Both inputs are positive: and
- The sum is negative:
- Boolean term:
Combining these two conditions using the logical OR operator, we get the complete overflow condition:
This matches Option B.
Free practice · Your answers on this page are not saved.
