作者horace50612 (哈!哈!哈!)
看板TransCSI
标题Re: [问题] 求解几题计概题目>"<
时间Fri Jun 21 15:12:04 2013
※ 引述《abbyrfu (abrfu)》之铭言:
: 想请教
: 5.Assume that a computer use 2's complement
: to represent a negative integer.
: Let X and Y are two 8-bit signed integers in computer,
: where X=1111 0010 Y=0001 1011 then X-Y=?
: a 1101 0111 b 1110 1011 c 1011 0111 d 0000 1101 e None of the above.
: (这题我算是 1111 0011,可是解答好像是a?)
: 6.X and Y are two real numbers in IEEE sigle-precision floating-point format:
: X=0 00000010 01000000000000000000000
: Y=0 00000011 00011100000000000000000
: calculate and show the result of X+Y.
: a 0 00000100 11011110000000000000000
: b 0 00000100 10111100000000000000000
: c 0 00000011 10111100000000000000000
: d 0 00000101 01011100000000000000000
: e None of the above
: (这题不知道怎麽算.....QQ)
: 29.Which of the following is valid?
: a {X v Y, X}├Y.
: b {X ^ Y, →Z}├Z
: c {X→Y,Y}├X
: d {X→Y,Y→Z}├Z→X
: e {X v Y,Y ^ Z}├X
: (不懂..........)
: 恳请
: 帮忙解惑O_Q
5.看到这种以2补数做减法运算的题目,一定是先对Y取2补数,又因为减正数等於加负数,所以Y取2补数00011011→11100101,接着再把它与X相加就行了。
X---11110010
Y---11100101
+____
11010111 加到MSB(Most Significant Bit)时会发现又进位并超出8bit,直接忽略并得到答案。
6. S E M
X=0 00000010 01000000000000000000000
Y=0 00000011 00011100000000000000000
首先做反正规化动作,将E(Exponent)+1及M(Mantissa)的MSB左边多放一个1(M变成了24bit)
会变成 ↓多增加的
X=0 00000011 101000000000000000000000
Y=0 00000100 100011100000000000000000
然後X与Y的E需一致,00000011与00000100相差1,因此将X的M往右移1bit,并做符号大小法之加法
S E M
X=0 00000100 010100000000000000000000
Y=0 00000100 100011100000000000000000
+___________________
0 00000100 110111100000000000000000
尾数无Overflow,再做正规化,把M的最左边的1去掉,E减1,答案就是0 00000011 10111100000000000000000。
29.这题在考propositional logic,我只知道答案给B,也不晓得为什麽。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.117.22.32
1F:推 abbyrfu:不好意思....请问反正规化都是+1吗?谢谢你的帮忙! 06/23 09:46
2F:→ horace50612:对呀!在M的前面都是多加一个1 06/24 08:04
3F:推 abbyrfu:请问第六题尾数若overflow要怎麽继续运算呢?谢谢! 06/27 01:00