2
$\begingroup$

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

$\endgroup$
  • $\begingroup$ Are you referring to IEEE format for floating point numbers? $\endgroup$ – apnorton Jul 3 '14 at 18:20
  • 1
    $\begingroup$ IEEE-754 format i meant $\endgroup$ – dato datuashvili Jul 3 '14 at 18:21
  • $\begingroup$ Does this answer help? math.stackexchange.com/a/305901/23353 (I don't know a lot about IEEE-754, but that answer looked pretty nice.) $\endgroup$ – apnorton Jul 3 '14 at 18:21
  • $\begingroup$ a bit explanation please,in my case how it would be $\endgroup$ – dato datuashvili Jul 3 '14 at 18:40
  • $\begingroup$ Please: Using an asterisk for ordinary multiplication in MathJax is vulgar. I edited it. $\endgroup$ – Michael Hardy Jul 3 '14 at 19:16
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ yes it is related to mantissa and exponent,in my example how it is calculated last part? $\endgroup$ – dato datuashvili Jul 3 '14 at 18:47
  • $\begingroup$ You have a typo in your translation which I thought was just that: do you see that 11001.11 = 1.100111 times $2^{4}$? (You have 24) then you just forget the 1., and 100111 is your m, and $2^{4}$ is your exponent. $\endgroup$ – gnometorule Jul 3 '14 at 18:53
  • $\begingroup$ You can think of $2^n$ as rotating n times to the left. $\endgroup$ – gnometorule Jul 3 '14 at 18:56
  • $\begingroup$ sorry i am lost now $\endgroup$ – dato datuashvili Jul 3 '14 at 19:03
  • $\begingroup$ @datodatuashvili: Me too probably. :) If you have 11.01 = 5.25, then it is the same as 1.101 * 2 = $2.625_d$ * $2_d$. Or think of it as the position left to any position is twice the value of that position; so $6_d$ = 110 = 11 * 2 = $3_d$ * $2_d$; $12_d$ = 1100 = 11 * $2^2$ = $3_d$ times $4_d$. I'm not quite sure where you're stuck. $\endgroup$ – gnometorule Jul 3 '14 at 19:10
1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.