[理工] [計組]-台大94-資工
Perform the following 8-bit 2's complement number operation and check
whether arithmetic overflow occurs. Check your answer by converting to
decimal sign-and-magnitude representation.
1 1 0 1 0 0 1 1
- 1 1 1 0 1 1 0 0
題目是這樣@@
我的問題是
"Check your answer by converting to decimal sign-and-magnitude representation."
這一句話 是否代表要將1 1 0 1 0 0 1 1與1 1 1 0 1 1 0 0
用sign-and-magnitude方式,化成10進位數,在相減變成答案呢?
也就是 1 1 0 1 0 0 1 1= -(64+16+2+1) = -83
1 1 1 0 1 1 0 0= -(64+32+8+4) = -108
然後-83-(-108)=25 (這是錯的 因為答案是-25)
--
張凡的答案是直接把那兩式用2's complement的方式化成10進位 -45-(-20)=-25
還是我誤解題意了... 請高手幫我回答 感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.227.98.199
→
09/26 01:10, , 1F
09/26 01:10, 1F
→
09/26 01:12, , 2F
09/26 01:12, 2F
推
09/26 01:34, , 3F
09/26 01:34, 3F
→
09/26 04:32, , 4F
09/26 04:32, 4F
→
09/26 08:04, , 5F
09/26 08:04, 5F
→
09/26 08:04, , 6F
09/26 08:04, 6F