1,285 views
Using binary full adders and other logic gates (if necessary), design an adder for adding $4$-bit number (including sign) in $2’s$ complement notation.

### Subscribe to GO Classes for GATE CSE 2022

Overflow condition in $2's$ complement number system:-

1. $c_{3} = 1,c_{4} = 1\implies$ No overflow
2. $c_{3} = 0,c_{4} = 0\implies$ No overflow
3. $c_{3} = 1,c_{4} = 0\implies$ Overflow $(a_{3} = b_{3} = 0)$
4. $c_{3} = 0,c_{4} = 1\implies$ Overflow $(a_{3} = b_{3} = 1)$

We can conclude that the overflow condition for $2's$ complement number system is: $$c_{3}\oplus c_{4} = 1\\ \text{(OR)} \\ \bar{a_{3}}\cdot \bar{b_{3}}\cdot s_{3} + a_{3}\cdot b_{3}\cdot\bar{s_{3}} = 1$$

Here, we used $4-bit$ binary full adder and Ex-OR gate.

The Ex-OR gate is used to check the overflow condition.

The OR part of overflow condition is wrong. please correct it.
What's wrong with that?
edited by

$\bar{a_3}⋅\bar{a_3}⋅s_3+a_3⋅b_3⋅\bar{s_3}=1$

this will be a'b's+abs' =1

okay I will corrected

@Lakshman Patel RJIT

What do you mean by "design an adder for adding 4-bit number (including sign) in 2’s complement notation." (Highlighted one)?

It means take 2 numbers then convert them to 2's complement form and then add them using adder

@Satbir

What happen if we do same thing in 1's complement form or sign magnitude form?

you can try to design circuit for that cases with simiilar approach as given in answer.
@satbir how have you derived this condition for the overflow?

@PratikDey0316

I think, for the second part of the overflow condition it basically says that, since a3 and b3 bits are sign bit so if two positive number are being added(sign bit is 0) then their result cannot be negative(s3 cannot be 1), Similarly, when two negative numbers are being added(sign bit is 1) then their result cannot be positive(s3 cannot be 0). If I am wrong here then please correct me.

As for the first part of the overflow condition you can refer this link: http://sandbox.mc.edu/~bennet/cs110/tc/orules.html

The Ex-OR gate is used to differentiate b/w normal binary addition vs 2’s complement addition.