in Digital Logic retagged by
4,468 views
17 votes
17 votes
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 ___________.
in Digital Logic retagged by
4.5k views

3 Comments

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"?

0
0
Ans will be same.
0
0
Overflow : If carry on sign bit and no carry out of msb then overflow .

Or

No carry on sign bit and carry on msb then overflow .
0
0

2 Answers

24 votes
24 votes
Best answer

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

4 Comments

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

 @prashant sir please explain this line.i am not able to understand it

0
0

@talha hashim I am assuming you know the range of unsigned, signed magnitude, 1's and 2's complement.

If number is unsigned it can represent all values till 2^n-1. But in 2s complement it is split into half. Moreover take a number line, when can overflow happen? if our addition crosses least -ve value OR greatest positive value. These cases are possible when two negative numbers are added or two positive number are added.Now in case the value crosses this mark, there is no way we can represent that number in those specified number of bits. 

In case of unsigned numbers carry is sufficient to detect the overflow.

1
1
3
3
3 votes
3 votes

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

Related questions