作者avogau ( 假 装)
看板TransCSI
标题Re: [问题] 计算机概相一些观念厘清
时间Tue Jul 7 23:53:35 2009
※ 引述《zptdaniel ()》之铭言:
: ※ 引述《larryfeng (ㄚ峰)》之铭言:
: : 6. Consider an 8-bit binary number with the following bit pattern:
: : 10101110
: : (a)What is the decimal number if the bit pattern represents a floating number of
: : the following formal :SEEEMMMM ( S:sing E:exponent M:mantissa ).
: "The sign is 0 for 6."
: ^^^^^^^^^^^^^^^^^^^^^^ ??? 你题目可能打太长了,我猜有内容被截掉.
: : (b)What are the maximal and the minimal positive numbers that can be
: : represented by this format?
: : (理念没有学过,不知道该如何下手?)
: : (如同上次的 IEEE754 一样,希望可以教教我)
: (a)
: 1 010 1110 = (-1)^1 * 2^(-2) * 0.1110 = -0.00111(2)
: S EEE MMMM S E M ^代表二进位
这边有点错误
E的部分应该是 -1 而非 -2
M的部分应该是 1.1110 而非 0.1110
所以是 -0.1111(2)
: 请自行转成十进位
: (b)
: maximal positive numbers = 2^3*0.1111 = 111.1 = 7.5
: minimal ....=2^(-4)*0.1111 = 0.00001111 =(请自行转换)
这边也是同样的错误
maximal positive numbers = 2^3 * 1.1111 = 1111.1 = 15.5
minimal positive numbers (正规) = 2^(-2) * 1.0000 = -0.01 = 0.25
(非正规) = 2^(-2) * 0.0001 = -0.000001(2进位)
: 有错请指教~感恩!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.168.100.128
1F:→ zptdaniel:囧 我每次浮点数都会弄错 07/07 23:56
2F:推 zptdaniel:E:010 这是Ex-4吧? 010(2) = -110(2) = -2(10) 07/08 00:00
3F:→ zptdaniel:这样不对吗@@? 07/08 00:00
4F:→ zptdaniel:然後..1.M不是只有IEEE754 才这样吗? 普通的不是用0.M? 07/08 00:01
5F:→ zptdaniel:翻了书 min的部份是写 2^(-4)*0.1(2) @@ 07/08 00:03
6F:→ avogau:IEEE754的风格的话 会是Ex-3 07/08 00:38