With 4-bit 2's complement arithmetic, which of the following addition will result in overflow?

184 views
in Computer
closed
With 4-bit 2's complement arithmetic, which of the following addition will result in overflow?
1. 1111+1101
2. 0110+0110
3. 1101+0101
4. 0101+1011

by (24.2k points)
selected

Correct Answer - Option 1 : 1111+1101

• If the result of an arithmetic operation is too large (positive or negative) to fit into the resultant bit-group, then arithmetic overflow occurs.
•  Overflow occurs if
1. (+A) + (+B) = −C
2. (−A) + (−B) = +C
• In the first option, we have 1111 + 1101 which results 1 1100 (As per 2's Complement addition rule). Here, 1 at the LSB of Result is overflow bit.

• The rules for detecting overflow in a two's complement sum are simple:
1. If the sum of two positive numbers yields a negative result, the sum has overflowed.
2. If the sum of two negative numbers yields a positive result, the sum has overflowed.
3. Otherwise, the sum has not overflowed.
• It is important to note the overflow and carry out ,both of them  can occur without the each other. In unsigned numbers, carry out is equivalent to overflow. In two's complement, carry out tells you nothing about overflow.
• The reason for the rules is that overflow in two's complement occurs, not when a bit is carried out out of the left column, but when one is carried into it. That is when there is a carry into the sign. The rules detect this error by examining the sign of the result. A negative and positive added together cannot overflow, because the sum is between the addends. Since both of the addends fit within the allowable range of numbers, and their sum is between them, it must fit as well.