Question:medium

Consider $Z = X - Y$, where $X$, $Y$ and $Z$ are all in sign-magnitude form. $X$ and $Y$ are each represented in $n$ bits. To avoid overflow, the representation of $Z$ would require a minimum of:

Show Hint

In sign-magnitude arithmetic, subtraction can double the maximum magnitude. So, always expect {one extra bit} beyond the original word length to avoid overflow.
Updated On: Feb 16, 2026
  • $n$ bits
  • $n-1$ bits
  • $n+1$ bits
  • $n+2$ bits
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Recall how sign–magnitude numbers are stored. 
In sign–magnitude format, one bit is reserved to represent the sign of the number, while the remaining $(n-1)$ bits store its absolute value.
Because of this structure, an $n$-bit sign–magnitude number can represent values in the range:

\[ -(2^{n-1}-1) \;\text{to}\; +(2^{n-1}-1) \]

Step 2: Rewrite the subtraction operation.
The subtraction $Z = X - Y$ can be expressed as an addition:

\[ Z = X + (-Y) \]

The largest possible value of $Z$ will occur when:

  • $X$ has the maximum positive value.
  • $Y$ has the maximum negative value.

 

That is:

\[ X = +(2^{n-1}-1), \quad Y = -(2^{n-1}-1) \]

Step 3: Find the maximum magnitude of the result.
Substituting these extreme values into the expression for $Z$:

\[ Z_{\max} = (2^{n-1}-1) - (-(2^{n-1}-1)) = 2(2^{n-1}-1) \]

This simplifies to:

\[ Z_{\max} = 2^n - 2 \]

Step 4: Determine how many bits are needed.
A value close to $2^n$ requires $n$ bits to store its magnitude.
Since sign–magnitude representation also needs one extra bit for the sign, the total number of bits required becomes:

\[ n + 1 \]

Step 5: Final conclusion.
To represent the result of the subtraction without overflow using sign–magnitude notation, the value of $Z$ must be stored using:

\[ \boxed{n+1 \text{ bits}} \]

Was this answer helpful?
0

Top Questions on Computer Organization and Architecture