Skip to main content

GATE CSE 2005Digital Logic › Number Systems & RepresentationVerified

GATE CSE 2005 PYQ: The range of integers that can be represented by an n n n bit 2 ’ s 2’s 2’ s complement number system is:

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

  1. A

    −2n−1 to (2n−1−1)-2^{n-1} \text{ to } (2^{n-1} -1)

    Correct answer
  2. B

    −(2n−1−1) to (2n−1−1)-(2^{n-1} -1) \text{ to } (2^{n-1} -1)

  3. C

    −2n−1 to 2n−1-2^{n-1} \text{ to } 2^{n-1}

  4. D

    −(2n−1+1) to (2n−1−1)-(2^{n-1} +1) \text{ to } (2^{n-1} -1)

Answer

(A) − 2 n − 1 to ( 2 n − 1 − 1 ) -2^{n-1} \text{ to } (2^{n-1} -1) − 2 n − 1 to ( 2 n − 1 − 1 )

Approach

Use the structure of n-bit two’s complement: one sign bit and n−1 magnitude/weight bits. The most negative value is 100...0 and the most positive value is 011...1.

For n-bit two’s complement, the bit pattern 100...0 represents $−2^{n−1}$ and 011...1 represents $2^{n−1}−1$, so the range is $−2^{n−1}$ to $2^{n−1}−1$. Hence option A is correct.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.