The Gateway to Computer Science Excellence
+2 votes
283 views
In IEEE $754$ single floating point format, how many numbers can be represented in the interval [10, 16)?

      A. $2^{21}$

      B. $3 * 2^{21}$

      C. $5 * 2^{21}$

      D. $2^{22}$
in CO and Architecture by
edited by | 283 views
0
10 is written as

0 10000010 01<21 0's>

These rightmost 21 0's are actually redundant, and we can set them to anything.

 

16 is written as

0 10000011 <23 0's>

If we keep the exponent to 3 (to make add the manipulatable bits shift to one end)

0 10000010 1<22 0's>

These rightmost 22 0's are manipulatable.

 

So, $2^{21}+2^{22}=2^{21}(1+2)=3*2^{21}$

1 Answer

+4 votes
In the IEEE 754 notation , the number is represented in 32 bits . The first bit is for the sign of the number , next 23 bits is normalise mantissa and next 8 bits is biased exponent.

$10$ is represented as = $1.01*2^{3} = 1.01*2^{130-127}$ , which in 32 bit format would be represented as ,

$001(19 \ 0's)10000010$.

And 16 is represented as $1.0*2^4 = 1.0*2^{131-127}=0(23 \ 0's)10000011$.

Thus we need to find the number of possible patterns of $0's$ and $1's$ in the following format.

Keeping the exponent same , the number of patterns of mantissa of the form $01(21 \ x's)$ and $1(22 \ x's)$.Where $x's$ are the positions to fill with 0's and 1's .

Thus total number of possible patterns = $2^{21}(of \ the \ 1^{st} \ kind)+2^{22}(of \ the \ 2^{nd} \ kind)$ = $3*2^{21}(Ans)$.
by
edited by
0
Why you are taking 1(22 x's) ? It should not be 2^23 as we have complete 23 zeros to select from?
0
1.00000...000 x 2^3 is  how much?

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,345 questions
60,522 answers
201,951 comments
95,372 users