[問題] 數字系統
The following binary have a sign in the leftmost bit and negative, are in 2's
complement form. Which one in the following computation has overflow occured?
(A) 100111+111001
(B) 001011+100110
(C) 110001-010010
(D) 101110+001011
我算的答案是A會產生溢位
但是答案是(C)
我看了一下(C)的解是這樣的:
110001+101110 = [1]011111 →做捨棄→做2的補數→十進位轉換 = -33
(-15) (-18)
我是買坊間的書
不知道有沒有錯
還是我自己搞錯?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.224.160.4
→
01/31 22:12, , 1F
01/31 22:12, 1F
→
01/31 22:13, , 2F
01/31 22:13, 2F
討論串 (同標題文章)