0

Any help will be greatly appreciated! I have been working with IEEE754 floating point numbers(32-bit single precision), and i am trying to convert it to decimal normalised format. I have found two equations to do it, but i'm not sure which one is correct.

N= (-1)^s * 1.F *2^(e-127) 
    OR 
    N= (-1)^s * 1+F * 2^(e-127) 

s= sign bit
F= fraction/mantissa
e=exponent

which of the above equation is correct ? in other words is it 1*F or 1+F ?

  • Note that the dot there is a period, denoting a “binary point,” the binary equivalent of a decimal point. It is not a multiplication symbol. If F is the significand as a fraction in [0, 1), then (1+F) is correct. If F is the significand as a string of bits, then 1.F is correct, meaning to interpret “1.” followed by the bits of F as a binary numeral. Except if e is zero, in which case it should be (0+F) or 0.F – Eric Postpischil Nov 22 '20 at 18:50

1 Answers1

0

Been a while since I've done floating point conversion, but that is a plus, not multiply (So 1+F, NOT 1*F).

The wikipedia article on the subject is pretty good and also says it's a plus: https://en.wikipedia.org/wiki/Single-precision_floating-point_format

From Iowa state with more concise description: http://class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html

Another interesting way to solve it: How to convert an IEEE 754 single-precision binary floating-point to decimal?