A hardware engineer wants to add two 8-bit sign-magnitude numbers, +35 (00100011) and -35 (10100011). What must the hardware do before it can complete this addition?
AXOR the sign bits and add the magnitude bits directly in a standard binary adder
BCompare the sign bits; since they differ, subtract the smaller magnitude from the larger and assign the sign of the larger
CInvert all bits of the negative number and add 1, then add the result to the positive number
DConvert both numbers to positive, add them, then set the sign bit of the result based on which input had the larger absolute value
Sign-magnitude arithmetic cannot simply feed numbers into a standard binary adder. When signs differ, the hardware must compare them, determine which magnitude is larger, subtract the smaller from the larger, and assign the sign of the larger-magnitude operand — a multi-step conditional operation. Option C describes two's complement negation (not sign-magnitude). Option D is close but incomplete — when adding +35 and -35, magnitudes are equal and the result is zero regardless. Option B correctly captures the comparison-and-branch logic that makes sign-magnitude hardware-unfriendly.
Question 2 Multiple Choice
In an 8-bit sign-magnitude system, how many distinct values can be represented?
A256, because 8 bits give 2^8 possible bit patterns
B255, because one bit pattern (+0) duplicates another (-0) and both represent the same value
C254, because both +0 and -0 must be excluded from the useful range
D128, because the sign bit halves the available magnitude
An 8-bit system has 2^8 = 256 bit patterns, but sign-magnitude wastes one on a duplicate representation of zero: 00000000 (+0) and 10000000 (-0) represent the same value. This leaves 255 distinct values (-127 through -1, zero, +1 through +127). By contrast, two's complement also has 256 patterns but represents 256 distinct values — it has only one zero and uses the 'extra' pattern for -128. The dual-zero problem is one of the key reasons sign-magnitude is impractical.
Question 3 True / False
In sign-magnitude representation, the most significant bit encodes the sign of the number, and the remaining bits encode the absolute value in standard binary.
TTrue
FFalse
Answer: True
This is the defining property of sign-magnitude: the MSB is 0 for positive and 1 for negative, while the remaining bits represent the magnitude exactly as they would in unsigned binary. So +5 is 00000101 and -5 is 10000101 — the magnitude bits are identical; only the sign bit differs. This intuitive structure is what makes sign-magnitude easy to understand but difficult for arithmetic hardware.
Question 4 True / False
Because sign-magnitude uses a dedicated sign bit, negating a sign-magnitude number requires a multi-step arithmetic operation similar to two's complement negation.
TTrue
FFalse
Answer: False
Negation in sign-magnitude is trivially simple: just flip the MSB. Changing 00000101 (+5) to 10000101 (-5) requires only a single bit inversion. This is actually easier than two's complement negation, which requires inverting all bits and adding 1. The difficulty with sign-magnitude lies not in negation but in addition and subtraction, which require sign comparison before the operation can proceed.
Question 5 Short Answer
Why was sign-magnitude largely abandoned for representing signed integers in modern processors, despite being the most intuitive encoding scheme?
Think about your answer, then reveal below.
Model answer: Two problems make sign-magnitude impractical: (1) it has two representations of zero (+0 and -0), complicating equality comparisons in hardware; (2) addition and subtraction require comparing signs first, then either adding or subtracting based on the result — a conditional operation requiring significantly more circuitry than a simple binary adder. Two's complement eliminates both problems: it has one zero, and unsigned binary adder hardware works correctly for signed arithmetic without modification.
The elegance of two's complement is that it folds sign handling into the binary arithmetic system itself rather than making it a separate operation. A single adder works for both signed and unsigned two's complement arithmetic. This hardware simplicity — not any advantage in range or conceptual clarity — is the decisive reason two's complement became universal.