我们假设4位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.书中给出了减去两个no的规则。
规则:减除两个no和Y,即X,形式为2's的no补码.Y并将其添加到X中。
假设我们必须减去两个不。(-7)和(-5),然后根据规则,我们需要找到no (-5)的2的补充,然后将它添加到(-7)中。
图书解决方案:

我需要知道,2的-5的补码是0101。
发布于 2013-05-10 20:32:26
要找到一个数字的2的补码,你:
示例(2s补码为5):
0101 (二进制)10101011 <- 2s补体5是1011示例(-5的2s补充):
1011 (二进制)01000101 <- 2s补体-5是0101https://stackoverflow.com/questions/16490335
复制相似问题