Jump to content

How to calculate normalized float

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
paintstripper

paintstripper

    Newbie

  • Members
  • Pip
  • 2 posts
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?

#2
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
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....?
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#3
paintstripper

paintstripper

    Newbie

  • Members
  • Pip
  • 2 posts
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
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Hmmm. I've never worked that much with binary.... Someone else?
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa