Question:medium

Consider the 8-bit signed integers 𝑋, π‘Œ and 𝑍 represented using the sign-magnitude
form. The binary representations of 𝑋 and π‘Œ are as follows:
𝑋: 10110100 π‘Œ: 01001100
Which of the following operations to compute 𝑍 result(s) in an arithmetic
overflow?

Show Hint

Decode X = -52 and Y = 76 from sign-magnitude form, then check whether each result's magnitude exceeds the maximum representable value of 127 for 7 magnitude bits.
Updated On: Aug 3, 2026
  • 𝑍= 𝑋+ π‘Œ
  • 𝑍= π‘‹βˆ’π‘Œ
  • 𝑍= βˆ’π‘‹+ π‘Œ
  • 𝑍= βˆ’π‘‹βˆ’π‘Œ
Show Solution

The Correct Option is B, C

Solution and Explanation

An alternative way to spot overflow in sign-magnitude addition is to recognize that overflow can only happen when we effectively add two magnitudes of the same sign, and the resulting magnitude needs more than 7 bits to store.

Step 1: Identify sign and magnitude.

X = 10110100 has sign bit 1 (negative) and magnitude \(0110100_2 = 52\), so \(X = -52\). Y = 01001100 has sign bit 0 (positive) and magnitude \(1001100_2 = 76\), so \(Y = 76\).

Step 2: Classify each operation as magnitude-adding or magnitude-subtracting.

For \(Z = X+Y = -52+76\): signs differ, so magnitudes subtract: \(76-52=24\), which can never exceed the larger operand (76), so no overflow is possible.

For \(Z = X-Y = -52-76\): this is the same as adding \(-52\) and \(-76\), both negative, so magnitudes ADD: \(52+76=128\), the overflow-prone case.

For \(Z = -X+Y = 52+76\): both positive, so magnitudes ADD again: \(52+76=128\), another overflow-prone case.

For \(Z = -X-Y = 52-76\): signs differ, so magnitudes subtract: \(76-52=24\), safely within range.

Step 3: Apply the 7-bit magnitude limit.

Only the two same-direction addition cases, \(X-Y\) and \(-X+Y\), produce a magnitude of 128, which needs 8 bits and cannot fit in the 7 magnitude bits available (max value 127). Both overflow.

So the operations causing overflow are \(Z=X-Y\) (option B) and \(Z=-X+Y\) (option C), matching the direct decimal computation.

Was this answer helpful?
0

Top Questions on Computer Organization and Architecture


Questions Asked in GATE CS exam