edited by
10,365 views
26 votes
26 votes

Using a $4-bit$ $2's$ complement arithmetic, which of the following additions will result in an overflow?

  1. $1100 + 1100$
  2. $0011 + 0111$
  3. $1111 + 0111$
  1. i only
  2. ii only
  3. iii only
  4. i and iii only
edited by

4 Answers

Best answer
45 votes
45 votes

Only (ii) is the answer. 

In $2's$ complement arithmetic, overflow happens only when 

  1. Sign bit of two input numbers is $0$, and the result has sign bit $1$
  2. Sign bit of two input numbers is $1$, and the result has sign bit $0$.

Overflow is important only for signed arithmetic while carry is important only for unsigned arithmetic.

A carry happens when there is a carry to (or borrow from) the most significant bit. Here, (i) and (iii) cause a carry but only (ii) causes overflow. 

http://teaching.idallen.com/dat2343/10f/notes/040_overflow.txt

edited by
6 votes
6 votes

$($ Carry of $n-1^{th}$ $\oplus$ Carry of $n^{th}) = 1$ Then overflow in 2's complement

$\text{Format of a number here}:\color{green} {C_4}\color{red}{C_3}C_2C_1C_0$ 

In above format $C_4$ is $n^{th}$ carry

$(i) \space 1100 +1100 = 1000 $  Here $C_{n-1} = 1 , C_n = 1$  so $C_{n-1}\oplus C_n = 1 \oplus 1 = 0$

$(ii) \space 0011 +0111 = 1010 $  Here $C_{n-1} = 1 , C_n = 0$  so $C_{n-1}\oplus C_n = 1 \oplus 0 = 1$

$(iii) \space 1111 +0111 = 0110 $  Here $C_{n-1} = 1 , C_n = 1$  so $C_{n-1}\oplus C_n = 1 \oplus 1 = 0$

So option $B$ is only right choice

0 votes
0 votes
we can also use overflow logic----->
OV(x,y,z) =x'y'z + xyz'
where x is msb bit of operand 1.y is msb bit of operand 2.And z is msb bit of result excluding carry.
–2 votes
–2 votes
D) (i) and  (iii) only.

Please comment if anyone finds it wrong !
Answer:

Related questions

25 votes
25 votes
2 answers
1
Ishrat Jahan asked Nov 2, 2014
4,335 views
The number $(123456)_8$ is equivalent to$\text{(A72E)}_{16}$ and $(22130232)_4$$\text{(A72E)}_{16}$ and $(22131122)_4$$\text{(A73E)}_{16}$ and $(22130232)_4$$\text{(A62E)...
20 votes
20 votes
2 answers
2
Ishrat Jahan asked Nov 1, 2014
6,479 views
What is the minimum size of ROM required to store the complete truth table of an $8-bit \times 8-bit$ multiplier?$32 K \times 16$ bits$64 K \times 16$ bits$16 K \times 32...
29 votes
29 votes
5 answers
3
Ishrat Jahan asked Nov 1, 2014
11,285 views
What is the minimum number of $\text{NAND}$ gates required to implement a $2\text{-input EXCLUSIVE-OR}$ function without using any other logic gate?$2$$4$$5$$6$
31 votes
31 votes
2 answers
4
Ishrat Jahan asked Oct 29, 2014
6,931 views
$(C012.25)_H - (10111001110.101)_B =$$(135103.412)_o$$(564411.412)_o$$(564411.205)_o$$(135103.205)_o$