将十六进制转换为 IEEE-754 单精度浮点二进制科学记数法
Convert hexadecimal to IEEE-754 single precision floating point binary scientific notation
我正在尝试将这些数字转换为二进制科学记数法,但我无法弄清楚这个过程。有人可以解决这个问题吗?
For IEEE 754 single precision floating point, what is the number, as written in binary scientific notation, whose hexadecimal representation is the following?
0061 0000
我可以将其从十六进制转换为无符号二进制:
0000 0000 0110 0001 0000 0000 0000 0000
但我不知道如何使用二进制科学计数法正确表示它。提前致谢!
binary32 分为 3 个部分:符号、指数(有偏)和尾数(或小数)。
0000 0000 0110 0001 0000 0000 0000 0000
|| || |
|| |\-- significand -----------/
| \ expo /
\ sign
所以在这种情况下,
sign (negative) = 0, so number is positive
exponent (biased) = 0000 0000
significand = .1100001 0000 0000 0000 0000
如果指数(2 的幂)处于最高值 (1111 1111),则表明该数字是特殊的:无穷大或非数字。
如果指数为 0,则偏差为 -126,否则偏差为 -127,应在分数中添加隐含的 1
。
sign = 0 (positive) or +1
exponent = 0 - 126
significand = 0.1100001 = (binary) 1100001/10000000 = 97/128
+1 * pow(2, -126) * 97/128 = 8.9080431273251475213255815711373...e-39
备注:
提供在线转换器。 example
Endian:解释字节的顺序可以变化。 0061 0000
可能是 00 00 61 00
。这个例子在这里做了一个假设。
我正在尝试将这些数字转换为二进制科学记数法,但我无法弄清楚这个过程。有人可以解决这个问题吗?
For IEEE 754 single precision floating point, what is the number, as written in binary scientific notation, whose hexadecimal representation is the following?
0061 0000
我可以将其从十六进制转换为无符号二进制:
0000 0000 0110 0001 0000 0000 0000 0000
但我不知道如何使用二进制科学计数法正确表示它。提前致谢!
binary32 分为 3 个部分:符号、指数(有偏)和尾数(或小数)。
0000 0000 0110 0001 0000 0000 0000 0000
|| || |
|| |\-- significand -----------/
| \ expo /
\ sign
所以在这种情况下,
sign (negative) = 0, so number is positive
exponent (biased) = 0000 0000
significand = .1100001 0000 0000 0000 0000
如果指数(2 的幂)处于最高值 (1111 1111),则表明该数字是特殊的:无穷大或非数字。
如果指数为 0,则偏差为 -126,否则偏差为 -127,应在分数中添加隐含的 1
。
sign = 0 (positive) or +1
exponent = 0 - 126
significand = 0.1100001 = (binary) 1100001/10000000 = 97/128
+1 * pow(2, -126) * 97/128 = 8.9080431273251475213255815711373...e-39
备注:
提供在线转换器。 example
Endian:解释字节的顺序可以变化。 0061 0000
可能是 00 00 61 00
。这个例子在这里做了一个假设。