681 views
The condition for overflow in the addition of two $2's$ complement numbers in terms of the carry generated by the two most significant bits is ___________.
edited ago | 681 views
0

What would have been the condition for overflow, if instead of "in terms of the carry generated", the question had asked for "in terms of the carry propagated"?

The condition for overflow in the addition of two 2's complement numbers in terms of the carry generated by the two most significant bits is when carry on MSB but not From MSB, or Carry from MSB but not on MSB. i.e.,

$$C_{out} \oplus C_{n-1} = 1.$$

i.e. For overflow to happen during addition of two numbers in 2's complement form

They must have same sign and result is of opposite sign

Overflow occurs if

1. (+A) + (+B) = −C

2.(−A) + (−B) = +C

PS: Overflow is useful for signed numbers and useless for unsigned numbers

selected by
0
explain with example na iam not getting what u have said plzzzzzzzzzzzzzzzz
0

Vishal, Overflow is the condition when result produced by addition cannot be stored in space allocated. Say You Want to add $2$, 4-bit numbers, then if result produced after addition is 5-bit, then we cannot fit the result in 4-bit, And we say Overflow has happened.

In 2's complement representation $0111 = (7)_{10}$ And performing addition : $0111 + 0111$. Result obtained is $1110 = (-2)_10$, in 2's complement representation not $14$ which should be answer. But there is not way we could represent $14$ in 2's complement representation in 4-bits. So Overflow.

condition for overflow in terms of carry generated $C_{out}$ =  $C_{out} \bigoplus C_{n-1}$