edited by
21,682 views
44 votes
44 votes

Given the following binary number in $32$-bit (single precision) $\text{IEEE-754}$ format :

                                    $\large 00111110011011010000000000000000$

The decimal value closest to this floating-point number is :

  1. $1.45*10^1$
  2. $1.45*10^{-1}$
  3. $2.27*10^{-1}$
  4. $2.27*10^1$
edited by

4 Answers

Best answer
49 votes
49 votes

In $32$ bit (single precision) $\textsf{IEEE-754}$ format, binary number is represented as 

$\text{S(1 bit) E(8 bit) M(23 bits)}$ with implicit normalization and exponent is represented with $\textsf{Excess-127}$ code.

Here, Sign $\text{bit} = 0 \Rightarrow$ Number is positive.

Exponent bits $= 01111100 = 124 \Rightarrow E = 124 - 127 = -3 \;\textsf{(Excess-127)}$

Mantissa bits $= 11011010000000000000000 \Rightarrow$ Number $= 1.1101101$  (Implicit normalization).

$\therefore$ Number $= 1.1101101 \ast 2 ^{-3} = 0.0011101101 = 0.227 = 2.27 \times 10^{-1}$

The answer should be C.

edited by
33 votes
33 votes

Important: The mistake to avoid here is to avoid the premature conversion of binary numbers to decimal digits.


Use: $-1^{S}*1.M*2^{e-127}$

You'll get $1.1101101 * 2^{-3}$

Now, don't convert 1.1101101 to decimal just yet. Get the whole value, then do the base conversion.

=> $0.0011101101$

=> $\frac{1}{8} + \frac{1}{16} + \frac{1}{32} + \frac{1}{128} + \frac{1}{256} + \frac{1}{1024}$

I'll now ignore the last two terms, since they're really small.

=>$0.125+0.0625+0.03125+0.0078125$

=> $0.2265625$

=> $2.26 * 10^{-1}$

Option C 

12 votes
12 votes
in this qestion they are asking about IEEE 754

so total 32 bit representation in which 1 bit is for sign, 8 bit for biased exponent, 23 bit for mantissa.

biased exponent part:01111100 =124 in decimal

mantissa part:11011010000000000000000=$\frac{1}{2}+\frac{1}{4}+\frac{1}{16}+\frac{1}{32}+\frac{1}{128}$

bias=$2^{n-1}-1$   where n=8 so biase=127

value=1.M*$2^{124-127}$

put all values you get closest ans C
9 votes
9 votes

$1.1101101*2^{^{-3}}$ we convert it to 0.0011101101 (How?)

Remember that for Binary multiplication we increase number of bit by shifting decimal point to right and for Binary division we decrease number of bits by shifting decimal point to left.

To get the fractional value assume we are given number as 11101101 ignoring 0's coming before first 1 but after decimal point.

now calculate decimal value of 11101101 which is 237. now divide it by $2^{^{N}}$ where N is number of bit after decimal point
(of course we will count number of bits till only right most 1). Here  N is 10. so $\frac{237}{2^{^{10}}}= 0.231445$ or 2.31*$10^{^{-1}}$. but since it is not given and also we are asked to give closest value which is 2.27*$10^{^{-1}}$.

you might have wondering how this is producing same result. well there is no some trick. In fact you will get same $\frac{237}{1024}$ if you just add the p/q forms.

$\frac{1}{8}+\frac{1}{16}+\frac{1}{32}+\frac{1}{128}+\frac{1}{256}+\frac{1}{1024}=\frac{237}{1024}$

i just found first method much easier rather than calculating fractional value separately of each term and then adding them all. Let me know if it helps.

edited by
Answer:

Related questions

29 votes
29 votes
1 answer
2
0 votes
0 votes
1 answer
3
4 votes
4 votes
2 answers
4