简体   繁体   中英

Floating point number to decimal number

I have the following floating point number: 1|011|1001. The possible answers in the multiple choice are:
a)-729
b)729
c)72
d)-72.
The answer is d) -72. But how is it possible? I have no clue how they calculated this. I think my school uses another method than what is known in the internet, because when I try it like in all those tutorials i have seen, it doesn't work. I even tried it backwards like -72 to floating point but the exponent already would be different. Can someone explain ist for me?

In “1|011|1001”, 1 is the sign field, 011 is the exponent field, and 1001 is the significand field.

The sign bit is 0 for +, 1 for −, so this is −.

011 2 is 3, apparently meaning scaling by 2 3

1001 2 is 9, meaning a significand of 9.

So the number is − 2 3 • 9 = −72.

However, this is not at all a standard format. Usually the exponent is biased (offset) by some value. This is commonly 2 n −1 −1 for an n -bit field, so the bias would be 3 for a 3-bit field, and 001 would represent an exponent of −2, 010 would represent −1, 011 would represent 0, and so on.

Additionally, the significand field is usually scaled, so that 1001 would represent .1001 2 (9/16) rather than 1001 2 (9). Also, the significand is usually formed with a leading bit that is 0 or 1 depending on the value of the exponent field.

So this format is very different from common formats. No test or exercise should expect a student to know it without having documented it previously.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM