-1

If a number in the format of the single precision is shown as hex 7F41F000, determine its numeric value.

So I converted it to binary: 0111 1111 0100 0001 1111 0000 0000 0000

By looking at binary representation of given number I find following:

s (sign) = 0

exp = 1111 1110 = 254(decimal)

mantissa = 1000 0011 1110 0000 0000 0000

So doing some calculations i get that

e = 254 - 127 = 127

m (decimal part) = 0.51513671875

and formula for final result is -1^s x (1 + m) x 2^e which is 1.51513671875 x 2^127

Since I listened lecture about this 2 days ago I am not entirely sure if I did it right.

What I am asking is confirmation of correctness or saying what I did wrong and where exactly, I would appreciate if anyone gives me points on this topic, as far i know, this is IEEE 754 standard for floating point computation.

Oh and I included better written format of this problem. Check it here

  • There's an online IEEE754 converter: https://www.h-schmidt.net/FloatConverter/IEEE754.html. You can enter bit patterns in hex or binary, and it decodes it. Or you can enter decimal values and it rounds to the nearest single-precision bit-pattern. – Peter Cordes Oct 23 '17 at 20:31

1 Answers1

0

It should be (-1)^sign bit*(1+fraction)* 2^( exponent - bias)

And you did exactly the same so this is correct.

I write up this formula because it reminds you of the bias correction always.

user2736738
  • 30,591
  • 5
  • 42
  • 56