Question

When two 8-bit numbers A7…A0A_7 \dots A_0 and B7…B0B_7 \dots B_0 in 2's complement representation (with A0A_0 and B0B_0 as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are S7…S0S_7 \dots S_0 and the carry bits are C7…C0C_7 \dots C_0. An overflow is said to have occurred if

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2017 answer key

Solution

Formulate the arithmetic overflow condition for 2's complement addition based on operand signs and the result sign.

In 2's complement representation, the most significant bit (MSB) is the sign bit: 0 indicates a non-negative number and 1 indicates a negative number. Here, the MSBs are A7,B7A_7, B_7 for the operands and S7S_7 for the sum.

Overflow can only occur when adding two numbers of the same sign:

  1. Adding two negative numbers (A7=1,B7=1A_7 = 1, B_7 = 1) yields a positive result (S7=0S_7 = 0). This condition is represented by the Boolean product term A7B7S7‾A_7 B_7 \overline{S_7}.
  2. Adding two non-negative numbers (A7=0,B7=0A_7 = 0, B_7 = 0) yields a negative result (S7=1S_7 = 1). This condition is represented by the Boolean product term A7‾ B7‾S7\overline{A_7} \, \overline{B_7} S_7.

Therefore, overflow occurs if and only if:

V=A7B7S7‾+A7‾ B7‾S7=1V = A_7 B_7 \overline{S_7} + \overline{A_7} \, \overline{B_7} S_7 = 1

This matches Option C.

Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2017 Computer Science and Information Technology (CS) Session 1
Question
9 of 65, printed as CS Q.9
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.