Question:medium

In a system, numbers are represented using 4-bit two’s complement form. Consider
four numbers 𝑁1 =1011, 𝑁2 =1101, 𝑁3 =1010 and 𝑁4 =1001 in the system.
Which of the following operations will result in arithmetic overflow?

Show Hint

Decode each 4-bit two's complement number to decimal, then check whether the true sum or difference lies inside the representable range $[-8, 7]$; if it falls outside, overflow has occurred.
Updated On: Aug 3, 2026
  • 𝑁1 + 𝑁2
  • 𝑁2 + 𝑁3
  • 𝑁3 βˆ’π‘4
  • 𝑁1 + 𝑁4
Show Solution

The Correct Option is B, D

Solution and Explanation

A faster way to spot overflow without tracking carry bits at every position is to compute the true (mathematical) sum of the decoded decimal values and check whether it fits inside the representable range of a 4-bit two's complement system, which is \([-8, 7]\).

Step 1: Decode all four numbers to decimal: \(N_1 = 1011_2 = -5\), \(N_2 = 1101_2 = -3\), \(N_3 = 1010_2 = -6\), \(N_4 = 1001_2 = -7\).

Step 2: Compute the exact arithmetic result for each operation and compare it against \([-8,7]\).

(a) \(N_1 + N_2 = -5 + (-3) = -8\). Since \(-8\) is the smallest value the format can hold, this fits - no overflow.

(b) \(N_2 + N_3 = -3 + (-6) = -9\). Since \(-9 < -8\), this cannot be represented in 4 bits - overflow occurs.

(c) \(N_3 - N_4 = -6 - (-7) = -6+7 = 1\). Since \(1\) sits comfortably inside \([-8,7]\) - no overflow.

(d) \(N_1 + N_4 = -5 + (-7) = -12\). Since \(-12 < -8\), this is out of range - overflow occurs.

Step 3: Why this shortcut works: overflow, by definition, means the true mathematical result cannot be represented in the fixed number of bits available. So whenever the true sum or difference falls outside \([-8, 7]\) for a 4-bit two's complement system, the hardware result must be wrong - which is exactly what overflow means, without needing to trace carries bit by bit.

Conclusion: Overflow happens for \(N_2+N_3\) and \(N_1+N_4\), matching options B and D.

Was this answer helpful?
0

Top Questions on Computer Organization and Architecture


Questions Asked in GATE CS exam