GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 16

Twos-complement integer range

Digital Logic · Number Systems & Computer Arithmetic · Full GATE CSE 2005 paper

GATE 2005, Q16 1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 16, GATE 2005: Representable n-bit two’s-complement range? A −2^(n−1) through 2^(n−1)−1; B −(2^(n−1)−1) through 2^(n−1)−1; C −2^(n−1) through 2^(n−1); D −(2^(n−1)+1) through 2^(n−1)−1.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

The most significant bit has weight−2n−1 and the remaining bits sum from 0 to 2n−1−1. Thus the represented range is−2n−1 through 2n−1−1, A.

The most significant bit has weight−2n−1, while lower bits contribute from 0 through 2n−1−1. Setting only the sign bit gives the minimum; setting all lower bits and clearing the sign bit gives the maximum. There are exactly 2n values in the asymmetric interval, including zero once, so A.

Original paper, page 2