GATE 2017 CS – Question 17
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
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}$.