作者bernachom (Terry)
看板Grad-ProbAsk
标题[理工] 计组-2补数和1补数名称的由来..
时间Tue Jun 23 21:26:46 2009
请教一下,这是书上看到的,可是不太了解..
书上说
two's complement gets its name from the rule that the unsigned sum of an
n-bit number and its negative is 2^n; hence , the complement or negation of
a two's complement number x is 2^n-x.
另一个是说
the negative of a one's complement is found by inverting each bit, from 0 to
1 and from 1 to 0, which helps explain its name since the complement of
x is 2^n-x-1.
请教一下,这分别是2补数和1补数的说明
可是为什麽可以被分别表示成这样子呢?
谢谢帮忙
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.224.205.164
1F:推 himanbobo:我记得好像是因为 1的补数有矛盾点 06/24 22:48
2F:→ himanbobo:像比方+0可以用0000表示 但-0却是1111 06/24 22:49
3F:→ himanbobo:问题是+0跟-0都是0 所以矛盾 因而产生了2的补数 06/24 22:50
4F:→ himanbobo:不管+0还是-0都是0000 06/24 22:50
5F:→ bernachom:我再想一下,谢谢您^^ 06/25 01:59