Question:medium

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?

Show Hint

The 4-bit two's complement range is -8 to 7; find the true decimal sum or difference of each pair and check whether it falls outside this range.
Updated On: Jul 22, 2026
  • \(N1 + N2\)
  • \(N2 + N3\)
  • \(N3 - N4\)
  • \(N1 + N4\)
Show Solution

The Correct Option is B, D

Solution and Explanation

Step 1: Convert every number to plain decimal first.
For 4-bit two's complement, the leftmost bit is worth $-8$ and the rest add normally. So
$N1 = 1011 = -8+2+1 = -5$
$N2 = 1101 = -8+4+1 = -3$
$N3 = 1010 = -8+2 = -6$
$N4 = 1001 = -8+1 = -7$

Step 2: Know the safe zone.
A 4-bit two's complement register can only hold values from $-8$ up to $7$. If the true arithmetic answer steps outside this window, the hardware cannot show it correctly, and that mismatch is exactly what we call overflow. So the fast check is: work out the real sum or difference, and see if it fits between $-8$ and $7$.

Step 3: Test $N1+N2$.
$-5 + (-3) = -8$. This sits right at the edge of the window, so it still fits. No overflow.

Step 4: Test $N2+N3$.
$-3 + (-6) = -9$. This is one step past $-8$, outside the window. Overflow happens here.

Step 5: Test $N3-N4$.
$-6 - (-7) = -6+7 = 1$. Comfortably inside the window. No overflow.

Step 6: Test $N1+N4$.
$-5 + (-7) = -12$. This is well past $-8$, outside the window. Overflow happens here too.

Step 7: Double check with the sign rule.
As a cross check, overflow in addition happens when we add two negative numbers and the 4-bit result comes out looking positive. In both flagged cases, $N2+N3$ and $N1+N4$, we add two negative numbers whose true sum needs more than 4 bits to store correctly as negative, so the stored pattern flips sign by mistake. That matches the decimal check.

Step 8: Conclude.
\[ \boxed{N2+N3 \text{ and } N1+N4} \]
Was this answer helpful?
0

Top Questions on Number Representation - Sign-Magnitude Arithmetic and Overflow


Questions Asked in GATE CS exam