The GATE Grind

GATE 2017 CS – Question 17

Digital Logic · Number Representation and Arithmetic · 1 mark · Multiple choice

The $n$-bit fixed-point representation of an unsigned real number $X$ uses $f$ bits for the fraction part. Let $i = n - f$. The range of decimal values for $X$ in this representation is

  1. $2^{-f}$ to $2^i$
  2. $2^{-f}$ to $\left(2^i - 2^{-f}\right)$
  3. 0 to $2^i$
  4. 0 to $\left(2^i - 2^{-f}\right)$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) 0 to $\left(2^i - 2^{-f}\right)$

Explanation

The smallest value is all zero bits, which is 0. The largest has all $i$ integer bits and $f$ fraction bits set, which is $(2^i - 1) + (1 - 2^{-f}) = 2^i - 2^{-f}$.