GATE / CS ARCHIVE

GATE CSE 1994 / QUESTION 2.7

Two’s-complement range

Computer Organization & Architecture · Data Representation & Arithmetic · Full GATE CSE 1994 paper

GATE 1994, Q2.7 Other
Report issue

Data Representation & Arithmetic

Question 2.7, GATE 1994: Give the representable integer range of an n-bit two’s-complement word, including the sign bit.
Tap to enlarge
Answer & solution

Answer: −2^(n−1) ≤ N ≤ 2^(n−1)−1 (no official key was published)

The most significant bit has weight −2n−1; the remaining bits have positive weights 1,2,…,2n−2. The smallest value sets only the sign bit, giving −2n−1. The largest clears it and sets all remaining bits, whose sum is 2n−1−1. Thus the range has one more negative value than positive value. Zero uses one of the 2n codes, and there is no separate negative-zero representation.

Original paper, page 3