1

I am trying to convert 30.125 into 10 bit floating number. 1 sign bit, 5 exponent bit with bias of 15 and 4 Mantisa bit. I came up with the below solution in IEEE-754 format which is correct.

S E Mantissa 0 10011 1110 

Then part of the question asks what decimal value is represented by the above floating number and the correct answer was 30. can How did they get 30?

1 Answer 1

1

There's an implict 1, so if the exponent is zero (15 because of the bias), the mantissa is 1.xxxx, so here 1.111 - remember the point is a binary point. However the exponent is 19. Take away the bias of 15, and it is 4.

So the binary number is 11110 - shift the binary pointy right 4 places. 2 + 4 + 8 + 16 = 30.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the explanation, can you explain how many bits in the exponent and mantissa we would need if we wanted to store the the additional 0.125?
@blor Decimal 30.125 is binary 11110.001, 8 significant bits. You need to store 7 of them, so you would need a 7 bit significand. The exponent is unchanged.
@PatriciaShanahan Thanks but the correct answer was given as 8 bits not 7.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.