Question:

Floating point representation question?

by Guest66687  |  earlier

0 LIKES UnLike

given the real number x = -463.7578125 show that the floating point representation is

11001001111001111110000100000000

I'm stumped at how to work this out? when i work it out my binary doesn't match this 32 bit binary.

Can someone show me the working out step by step?

Thanks much appreciated

 Tags:

   Report

2 ANSWERS


  1. I tried to do a lil' research and help you out, I found this article on Wikipedia http://en.wikipedia.org/wiki/Floating_po...

    I'm not sure if what you're doing is the same thing as binary, it looked pretty foreign to me, so I'll just submit a possible link that may help you out.  


  2. The 32-bit binary representation has 3 parts:

    1. 1 bit (the first digit) representing the sign

    In this case it will be 1 since the number is negative

    2. 8 digits representing the exponent

    463 in decimal would be represented by 111001111

    3. 23 bits (the last 23 bits) representing the decimal

    0.7578125

    = 1/2 + 1/4 + 1/128

    This would be represented as 0.1100001

    463.7578125 would be written as 111001111.1100001

    We now need to normalize this number so that there is only one non-zero decimal place in this number (the number is of the form of 1.____). You can do this by moving the decimal place 8 spaces to the left. The number 8 has now become important. We know for certain the the number to the left of the decimal point is 1 (following the rules used to format the number) so we can ignore it. We are left with 110011111100001 and we pad the right hand side of this number with 0s to make up the 23 digits. We are left with 11001111110000100000000

    We take our 8 (number of spaces the point had to be moved), add 127  (the maximum number you can express with 8 bits (2^8-1 or the numbers 0 to 127)) which gives us 135. 135 represented as 8-digit binary would be 10000111. This is our exponent.

    The 32-bit representation of the number would be

    1 10000111 11001111110000100000000

    which does not seem to match the answer provided.

    I found an online floating-point converter (http://babbage.cs.qc.edu/IEEE-754/Decima... The result from that matches my answer. Maybe there is a misprint in your source.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions