Skip to content

GATE CS 2005 Q16 — Number Representations (Fixed and Floating Point)

Explain with AI

The range of integers that can be represented by an nn bit 2’s2’s complement number system is:

Choose one option
View worked solution

Answer: A

In an nn-bit 2's complement representation, the most significant bit (MSB) is the sign bit, which has a negative weight of −2n−1-2^{n-1}. The remaining n−1n-1 bits have positive weights.

To find the range of representable integers:

  • Minimum Value: This occurs when the MSB is 11 and all other n−1n-1 bits are 00.
    Minimum=−1⋅2n−1+0⋅2n−2+⋯+0⋅20=−2n−1\text{Minimum} = -1 \cdot 2^{n-1} + 0 \cdot 2^{n-2} + \dots + 0 \cdot 2^0 = -2^{n-1}
  • Maximum Value: This occurs when the MSB is 00 and all other n−1n-1 bits are 11.
    Maximum=0⋅2n−1+1⋅2n−2+⋯+1⋅20=2n−1−1\text{Maximum} = 0 \cdot 2^{n-1} + 1 \cdot 2^{n-2} + \dots + 1 \cdot 2^0 = 2^{n-1} - 1

Therefore, the range of integers is from −2n−1-2^{n-1} to (2n−1−1)(2^{n-1} - 1).

Example (for n=4n = 4):

  • Minimum value: −24−1=−8-2^{4-1} = -8 (represented as 100021000_2)
  • Maximum value: 24−1−1=72^{4-1} - 1 = 7 (represented as 011120111_2)
  • Range: −8-8 to +7+7

Hence, the correct option is A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions