Question:

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: Jul 7, 2026
  • 𝑍= 𝑋+ π‘Œ
  • 𝑍= π‘‹βˆ’π‘Œ
  • 𝑍= βˆ’π‘‹+ π‘Œ
  • 𝑍= βˆ’π‘‹βˆ’π‘Œ
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B, C

Solution and Explanation

We are given two 8-bit numbers in sign-magnitude form: X = 10110100 and Y = 01001100. We must determine which operations to compute Z cause an arithmetic overflow.

Step 1: Decode X and Y.

X = 10110100: the leftmost bit is 1, so X is negative. The magnitude bits are 0110100, which equal \(32+16+4 = 52\). So \(X = -52\).

Y = 01001100: the leftmost bit is 0, so Y is positive. The magnitude bits are 1001100, which equal \(64+8+4 = 76\). So \(Y = 76\).

Step 2: Recall the overflow rule for 8-bit sign-magnitude numbers.

With 8 bits, 1 bit is used for sign and 7 bits for magnitude, so the maximum representable magnitude is \(2^7 - 1 = 127\). An arithmetic overflow occurs whenever the true magnitude of the result exceeds 127.

Step 3: Evaluate option (A) \(Z = X + Y\).

\(Z = -52 + 76 = 24\). Magnitude 24 is well within 127, so no overflow.

Step 4: Evaluate option (B) \(Z = X - Y\).

\(Z = -52 - 76 = -128\). The magnitude required is 128, which exceeds the maximum representable magnitude of 127. This causes an overflow.

Step 5: Evaluate option (C) \(Z = -X + Y\).

\(Z = 52 + 76 = 128\). Again the magnitude 128 exceeds 127, causing an overflow.

Step 6: Evaluate option (D) \(Z = -X - Y\).

\(Z = 52 - 76 = -24\). Magnitude 24 is within range, so no overflow.

Therefore, arithmetic overflow occurs for options B and C.

\[ \boxed{\text{Options B and C}} \]
Was this answer helpful?
0
0

Top GATE CS Computer Science and IT Engineering Questions

View More Questions

Top GATE CS Computer Organization and Architecture Questions

View More Questions