The GATE Grind

GATE 2017 CS – Question 19

Digital Logic · Number Representation and Arithmetic · 1 mark · Multiple choice

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

  1. the carry bit $C_7$ is 1
  2. all the carry bits $(C_7, \cdots, C_0)$ are 1
  3. $(A_7 \cdot B_7 \cdot \overline{S_7} + \overline{A_7} \cdot \overline{B_7} \cdot S_7)$ is 1
  4. $(A_0 \cdot B_0 \cdot \overline{S_0} + \overline{A_0} \cdot \overline{B_0} \cdot S_0)$ is 1

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.