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:
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}} \]