9-bit floating point representations using IEEE floating point format A and B

后端 未结 1 1042
难免孤独
难免孤独 2021-01-24 09:52

I\'m having some trouble with a problem I\'ve run into dealing with floating points. I\'m having a hard time moving from floating point representation to decimal values and also

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-24 10:28

    010110011 in the 1-5-3 format is sign 0, biased exponent 101102, and encoded significand 011. The sign is +, the unbiased exponent is 22–15 = 7, and the significand is 1.0112 = 1.375. (We prefixed the encoded significand with “1.”) So the number represented is +27•1.375 = 176.

    To encode 176 in the 1-4-4 format, take advantage of the fact that you already know it is +27•1.375. Thus, the sign is +, the unbiased exponent is 7, and the significand is 1.0112. This significand fits in four bits (so no rounding is needed); the encoded significand (removing the leading “1.”) is 0110. The unbiased exponent is 7, the bias is 7, so the biased exponent is 14 = 11102. So the bit fields are sign 0, exponent 1110, significand 0110, and all nine bits are 011100110.

    0 讨论(0)
提交回复
热议问题