作者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