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