Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to understand how to convert from decimal to IEEE-754 Single Precision binary representation.

I make up a random number which happen to be 601.00

I tried my best to figure it out and this is what I got:

Step 01: I divided 601 by 9 (since 2^9 is the largest power of 2 divisible by my number) so I got 66.7778

Step 02: I have for the exponent 9 + 127 = 136 which is 10001000 in binary. Step 03: The sign is 0

Right now the representation is: (missing the mantissa) 0 10001000

But what is the mantissa representation for 66.7778 in binary?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

In step 1, you determined that $2^9$ is the largest power of $2$ less than your number. It doesn't, and doesn't need to, divide your number. Your calculation of the exponent is fine. Then you need to divide your number by $2^9$, not $9$, giving $1.173828125$. This is the number you need to express in binary for the mantissa. You can also get there converting $601$ to binary and shifting $9$ places right. Since $601_{10}=1001011001_2$, you chop off the leading $1$ (it is assumed that the number is normalized) and your mantissa is $001011001$ and $14$ more zeros to fill $23$ bits.

share|improve this answer
add comment

Rick Regan may have the answer to your question:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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