Open In App

GATE | GATE-CS-2017 (Set 1) | Question 32

Like Article
Like
Save
Share
Report

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

(A) 2-f
(B) 2-f to ( 2i – 2 -f)
(C) 0 to 2-i
(D) 0 to 2i – 2 -f)


Answer: (D)

Explanation: Since given number is in unsigned bit representation, its decimal value starts with 0.
We have i bit in integral part so maximum value will be 2i
Thus integral value will be from 0 to 2i – 1
We know fraction part of binary representation are calculated as (1/0)*2-f
Thus with f bit maximum number possible = sum of GP series with a = 1/2 and r = 1/2

Thus fmax = {1/2(1 – (1/2)f}/(1 – 1/2)
                = 1 – 2-f
Thus maximum fractional value possible = 2i – 1 + (1 – 2-f )
                                       = 2i - 2-f

This solution is contributed by Abhishek Kumar.

Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads