GATE 2017 CS – Question 19
When two 8-bit numbers $A_7 \cdots A_0$ and $B_7 \cdots B_0$ in 2's complement representation (with $A_0$ and $B_0$ as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are $S_7 \cdots S_0$ and the carry bits are $C_7 \cdots C_0$. An overflow is said to have occurred if
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $(A_7 \cdot B_7 \cdot \overline{S_7} + \overline{A_7} \cdot \overline{B_7} \cdot S_7)$ is 1
Explanation
In 2's complement addition, overflow happens when two numbers with the same sign give a result of the opposite sign. That is, both sign bits $A_7$ and $B_7$ are 1 and the sum bit $S_7$ is 0, or both are 0 and $S_7$ is 1. This is exactly the expression in option C.