Back to the 2025 paper

Module 1: Functional Block of computer and Data representaion

20257m

Explain signed number representation using sign-magnitude, 1's complement, and 2's complement. Include advantages and disadvantages of each.

Worked SolutionAI Assisted

Signed Number Representation – Sign-Magnitude, 1's and 2's Complement (7 Marks)

For nn bits, MSB is sign bit: 00=+ve, 11=-ve.

1. Sign-Magnitude:
MSB = sign, remaining (n−1)(n-1) bits = magnitude.
Example n=4n=4: +3=0 011+3=0\,011, −3=1 011-3=1\,011
Range: −(2n−1−1)-(2^{n-1}-1) to +(2n−1−1)+(2^{n-1}-1). Zero has two forms: 0 0000\,000 (+0) and 1 0001\,000 (-0).

  • Advantages: Simple for humans, easy to find magnitude.
  • Disadvantages: Two zeros, addition/subtraction needs separate logic checking signs and magnitudes (complex ALU), not used internally.

2. 1's Complement:
+ve numbers as in sign-magnitude; -ve numbers obtained by complementing all bits of +ve.
Example n=8n=8: +25=00011001+25=00011001, −25=11100110-25=11100110
Range: −(2n−1−1)-(2^{n-1}-1) to +(2n−1−1)+(2^{n-1}-1), two zeros: 0000000000000000 and 1111111111111111.
Addition: binary add, then end-around carry (carry out added back to LSB).

  • Advantages: Subtraction via addition, better than sign-magnitude.
  • Disadvantages: Two zeros, end-around carry makes arithmetic slower, extra circuitry.

3. 2's Complement:
+ve as usual; -ve = 1's complement +1.
Example n=8n=8: +25=00011001+25=00011001, −25=11100110+1=11100111-25=11100110+1=11100111
Range: −2n−1-2^{n-1} to +(2n−1−1)+(2^{n-1}-1) (one extra negative value, e.g., 8-bit −128-128 to +127+127). Single zero 0000000000000000.
Addition/Subtraction: simple binary addition, ignore carry out beyond nn bits. Subtraction A−B=A+(−B)2′sA-B = A + (-B)_{2's}.
Example 5−3=0101+1101=00105-3 = 0101 + 1101 = 0010 (2) correct (carry discarded).

  • Advantages: One zero, simplest arithmetic (single adder for add/sub), no end-around carry, widely used in modern ALUs (x86, ARM).
  • Disadvantages: Asymmetric range, human interpretation slightly less intuitive, negation needs add.

Comparison Table:

Feature Sign-Mag 1's Comp 2's Comp
Zeros 2 2 1
Range (8-bit) -127 to +127 -127 to +127 -128 to +127
Arithmetic complex end-around carry simple add

Conclusion: 2's complement dominates due to uniform add/sub hardware.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.