IAE Academy

GATE 2026 CS2 Q.28: solution and answer

GATE 2026 · CS2Q.28 · 1 mark · MSQ

In a system, numbers are represented using 4-bit two's complement form. Consider four numbers N1 = 1011, N2 = 1101, N3 = 1010 and N4 = 1001 in the system. Which of the following operations will result in arithmetic overflow?

  1. (A)

    N1 + N2

  2. (B)

    N2 + N3

  3. (C)

    N3 - N4

  4. (D)

    N1 + N4

See the question in the paper

Answer and solution

ANSWER

Overflow occurs in N2 + N3 and in N1 + N4, so the answer is B and D.

Official answer: B, DSource: Official answer key, GATE 2026 CS2 (IIT Guwahati)

  1. A 4-bit two's complement number lies in . Overflow occurs exactly when the true result falls outside this range.

  2. Decode each number, the sign bit having weight : , , , .

  3. (A) . This is inside , so there is no overflow. Check: , and dropping the carry-out gives , which is correct.

  4. (B) . Overflow. Check: , which gives . Two negatives gave a positive, so the sign is wrong.

  5. (C) . This is inside the range, so there is no overflow. Check: , which gives , which is correct. Subtracting numbers of the same sign can never overflow, because the result has a smaller magnitude than the larger operand.

  6. (D) . Overflow. Check: , which gives . Two negatives gave a positive, so the sign is wrong.

  7. Overflow happens in (B) and (D).

KEY IDEA

Overflow in two's complement happens when the true sum lies outside for 4 bits. Adding two numbers of the same sign can overflow. Adding numbers of opposite sign, or subtracting numbers of the same sign, never can.

WATCH OUT FOR

Treating the carry-out of the sign bit as the overflow signal. In (A) a carry-out occurs but the result is valid. The real test is whether the true value fits in the range, or equivalently whether two operands of the same sign give a result of the opposite sign. A second slip is treating the subtraction in (C) like an addition of two negatives.

From the GATE 2026 CS2 paper. Every question of this paper · Download the full paper · All 18 Number systems questions, with notes

More Number systems questions