Ok I have to calculate -89.95445 (float) to its representation in binary.
I was under the impresssion that to convert to binary that I have to:
1. Convert 89 to binary = 1011001
2. Convert decimal .95445 to binary = .111 1010 0010 1011 0110 1010
3. Normalize to get 1.011001 111 1010 0010 1011 0110 1010 . 2^6
4. So m = 1.011001 111 1010 0010 1011 0110 1010
and e = 2^6 = 64
5. So the sign = 1 because negative, the exponent = 0100 0000
and the bit pattern = 011001 111 1010 0010 1011 0110 1010
I don't think I am getting the right answer, can someone point me in the right direction?
How to calculate normalized float
Started by paintstripper, Sep 01 2008 06:38 AM
3 replies to this topic
#1
Posted 01 September 2008 - 06:38 AM
|
|
|
#2
Posted 01 September 2008 - 01:24 PM
I think you will have to perhaps maybe take a look at this: IEEE 754-1985 - Wikipedia, the free encyclopedia
There are some standards out there for doing this, but "normal" binary won't "allow" decimal, as you know, so.... So what binary (to put it like that) will you use? Some standard, or....?
There are some standards out there for doing this, but "normal" binary won't "allow" decimal, as you know, so.... So what binary (to put it like that) will you use? Some standard, or....?
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
#3
Posted 02 September 2008 - 12:44 AM
The float is stored as a normal binary value after it has been normalized. I think I just need some examples to get me going.
#4
Posted 03 September 2008 - 08:07 AM
Hmmm. I've never worked that much with binary.... Someone else?
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Sign In
Create Account

Back to top









