edited by
187 views
1 votes
1 votes

In which of the following cases has overflow Not occurred (addition of two-complement numbers)?

  1. The MSB of first number is $0$ and of second number is $0$ and MSB of the result is $1.$
  2. The MSB of first number is $1$ and of second number is $0$ and MSB of the result is $1.$
  3. The MSB of first number is $1$ and of second number is $1$ and MSB of the result is $0.$
  4. Carry into the MSB is $1$ and carry out of the MSB bit is $0.$
edited by

2 Answers

1 votes
1 votes
A; C; D are standard conditions for overflow in $2$-complement addition.
0 votes
0 votes

Let us consider 2 n bit binary numbers, A and B in their 2’s complement form. Where A = An-1….A1A0 and B = Bn-1….B1B0.

Let their sum, S = SnSn-1….S1S0

Then overflow occurs whenever:

  1. An-1.Bn-1.(Sn-1)’ + (An-1)’. (Bn-1)’. Sn-1 = 1
  2. Cn XOR Cn-1 = 1 , where Cn and Cn-1 are the carry bits for nth and (n-1)th bit  respectively.

Hence, option b is the only answer.

Answer:

Related questions

1 votes
1 votes
1 answer
1