binary and floating point representation

404 Views Asked by At

suppose that we have following binary digits

$00011001.110 $,we can do following thing

$00011001.110=1\cdot2^4+1\cdot2^3+1\cdot2^0+1\cdot2^{-1}+1\cdot2^{-2}=25.75$

then what does means?

We then “float” the binary point:

$00011001.110 \Rightarrow 1.1001110 \cdot 2^4 $

mantissa = 1.1001110, exponent = 4

i did not understand this part,generally for sign we have $1$ bit,for exponent we have $8$ bit and for mantissa we need $23$ bit,so i can't understand last part,from floating to binary point,please help me

2

There are 2 best solutions below

7
On

I'm not sure I really get your question, but are you confused about what "mantissa" really means - it should be a 2-complement integer, but in normalized representation it has a leading "1."? In the standard, the leading "1." is implied: the mantissa bits represent, in your case, only 100111. If this isn't your point of confusion, kindly elaborate more.

0
On

You start with the binary number $11001.110_2$ We want to express it as something between $1$ and $2_{10}=10_2$ times the appropriate power of two. So $11001.110_2=1.1001110 \cdot 2^4$ Note that this is the same as your expression except that you used $x$ for times and lost the exponent sign. The mantissa is the value between $1$ and $10_2$, so is $1.100111$. The exponent is the exponent of $2$ in the expression, so $4$. We have not yet packed it into the $32$ bit representation. Now if we want to go to IEEE single precision floating point, the sign bit is $0$ (positive), the exponent is $4+127=131=10000011_2$ and the significand is $11001110000000000000000$, so the whole number is $1\ 10000011\ 11001110000000000000000$ where I put the spaces in to show where the pieces go.