28 votes

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

$\large 00111110011011010000000000000000$

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

- $1.45*10^1$
- $1.45*10^{-1}$
- $2.27*10^{-1}$
- $2.27*10^1$

34 votes

Best answer

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

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

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

Exponent bits $= 01111100 = 124$ $\Rightarrow$ $E = 124 - 127 = -3$ (Excess-127)

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

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

$\therefore$ Answer should be **C.**

1

How come Mantissa bits = 110110**110**10000000000000000 ??

**Bold part** is not in question. It is 110 110 1

14

i am getting 0.231 when converted to decimal ryt?

even in the converter link mentioned there also

Have u chosen the nearest answer?

0

The exponent is being calculated using **normal biasing** not **excess biasing**.

Because in **normal bias** we subtract the Biased bits with **$2^{n-1}-1$ ,** where n = no. of bits for biased exponent

& in **excess bias** we subtract the Biased bits with **$2^{n}/2$ ** , where n = no. of bits for biased exponent

So here we are doing Actual Exponent =Biased Exponent - [ $2^{8-1}-1$ ] = 124 - 127 = -3

8 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

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

7 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**

3 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.