[問題] 數字系統

看板TransCSI作者 (DreamMe)時間16年前 (2010/01/31 21:52), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/2 (看更多)
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
A作完答案是-32 2's complement中 可表示到-(2^n-1)
01/31 22:12, 1F

01/31 22:13, , 2F
A沒溢位
01/31 22:13, 2F
文章代碼(AID): #1BPOib1U (TransCSI)
討論串 (同標題文章)
文章代碼(AID): #1BPOib1U (TransCSI)