Notices
Results 1 to 5 of 5

Thread: Floating point representation

  1. #1 Floating point representation 
    Forum Freshman
    Join Date
    Mar 2011
    Location
    Melbourne, Australia
    Posts
    5
    Hi Guys,

    Just wondering if there are any resident experts on floating point representation around these parts? I've got a few queries regarding it (it's taking a while to absorb into my brain) so hoping there are some folks around here who could assist.

    Cheers in advance.


    Reply With Quote  
     

  2.  
     

  3. #2  
    Veracity Vigilante inow's Avatar
    Join Date
    Oct 2009
    Location
    Austin, TX
    Posts
    3,500
    Ask your question. If someone reads it and knows the answer, they'll respond. Generally much easier to do that than to ask if anyone is an expert, as most will ignore such questions.


    Reply With Quote  
     

  4. #3  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    It's very likely that I can help you, since I answer that kind of question in the Help Lab here fairly often. (I assume you've read the homework policy though.)
    Reply With Quote  
     

  5. #4  
    Forum Freshman
    Join Date
    Mar 2011
    Location
    Melbourne, Australia
    Posts
    5
    Quote Originally Posted by MagiMaster
    It's very likely that I can help you, since I answer that kind of question in the Help Lab here fairly often. (I assume you've read the homework policy though.)
    I have, thanks for pointing it out. I won't be asking for an answer, just verification that my understanding of the method is correct.

    OK, if we're using standard 32-bit IEEE Standard 754 representation, we've got 1 bit for the sign, 8 bits exponent, 23 bits mantissa.

    My query is the exponent is always added to 127 correct? So if we have 1.011 x 2^14, then the exponent is 14 + 127 = 141 = binary form of 141 in the 8 bits of the exponent. And the sign bit is always 1. Just want to be sure I understand this, the textbook is a little cryptic.

    Thanks for your assistance.
    Reply With Quote  
     

  6. #5  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Yeah, you've got the exponent right, but the sign bit isn't always 1. It always takes up 1 bit, but its value depends on whether the represented number is positive or negative.

    So, -1/3 which equals -0.01010101... in base-2, would first be normalized to -1.010101... * 2^-2, then stored as:

    1 : 0111 1101 : 010 1010 1010 1010 1010 1010
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •