作者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
推 himanbobo:我記得好像是因為 1的補數有矛盾點 06/24 22:48
→ himanbobo:像比方+0可以用0000表示 但-0卻是1111 06/24 22:49
→ himanbobo:問題是+0跟-0都是0 所以矛盾 因而產生了2的補數 06/24 22:50
→ himanbobo:不管+0還是-0都是0000 06/24 22:50
→ bernachom:我再想一下,謝謝您^^ 06/25 01:59