In a system, numbers are represented using 4-bit two’s complement form.…
2026
In a system, numbers are represented using 4-bit two’s complement form.
N1=1011, N2=1101, N3=1010, N4=1001
Which of the following operations will result in arithmetic overflow?
- A.
N1+N2
- B.
N2+N3
- C.
N3−N4
- D.
N1+N4
Attempted by 13 students.
Show answer & explanation
Correct answer: B, D
Step-by-Step Analysis
First, convert the 4-bit two's complement numbers to decimal to determine their values. The range for 4-bit two's complement is -8 to +7.
N1 = 1011: Invert bits (0100) + 1 = 0101 (5). Since MSB is 1, value is -5.
N2 = 1101: Invert bits (0010) + 1 = 0011 (3). Since MSB is 1, value is -3.
N3 = 1010: Invert bits (0101) + 1 = 0110 (6). Since MSB is 1, value is -6.
N4 = 1001: Invert bits (0110) + 1 = 0111 (7). Since MSB is 1, value is -7.
Evaluate Each Operation
Option A (N1 + N2): -5 + (-3) = -8. This is within the range [-8, +7]. No overflow.
Option B (N2 + N3): -3 + (-6) = -9. This is less than -8. Arithmetic overflow occurs.
Option C (N3 - N4): -6 - (-7) = -6 + 7 = 1. This is within the range. No overflow.
Option D (N1 + N4): -5 + (-7) = -12. This is less than -8. Arithmetic overflow occurs.
Both Option B and Option D result in arithmetic overflow.
A video solution is available for this question — log in and enroll to watch it.