cassiusclay
cassiusclay

Reputation: 386

How many Mantissa bits to precisely represent a fraciton

This is part of a review for a future exam and I am stuck on this problem. Any help would be much appreciated. I don't really know how to approach this problem. Thanks.

The moon moves away from the earth approximately 4 /1024 km per year. How many mantissa bits would be needed to add together the ISS orbital distance plus the distance the moon moves away from the earth in one year. In otherwords, how many bits are needed in the fractional part to precisely represent 330 + 4 /1024?

Upvotes: 0

Views: 149

Answers (1)

Rudy Velthuis
Rudy Velthuis

Reputation: 28826

That is (330*1024 + 4) / 1024 or (330*256 + 1) / 256. You can ignore the divider, because that is a power of two and that only influences the exponent.

330 * 256 + 1 = 84481 = 0x14A01

That number contains 17 bits. They will be shifted left, but that does not change their number.

The top bit is not fractional, so 16 bits for the fractional part.

Upvotes: 1

Related Questions