2
補充我們假設4位2的補體系統是用來表示正負數發現2的負沒有
Suppose we have to find 2's complement of no. 3
We can subtract this no. with 2^4
that is ,
= 2^4 - 3
= 13
=1101 (which represent -3 , in 2's complement system)
//* there is another way of finding 2's complement , taking 1's complemen of the
number and add 1 to it.
在這本書中的規則是考慮到減去兩個沒有。
規則:減去兩個沒有X和Y,即X - Y,形式2的補碼號。 Y並將其添加到X.
假設我們必須減去兩個no。 (-7)和(-5),那麼根據規則,我們需要找到no(-5)的2的補碼,然後將它加到(-7)。
電子書解決方案:
我需要知道,2的-5補怎麼0101
但無不是5,這是-5,以2的補體系統,爲-5位表示是1011 。 – siddstuff 2013-05-10 20:39:47
如果對負數執行相同的二進制補碼操作,您將得到正數。 – CraigTeegarden 2013-05-10 20:40:25
,我們如何通過從2^4中減去它來找到相同的值? – siddstuff 2013-05-10 20:42:17