※ 引述《walks (蹦蹦跳跳)》之銘言:
: 2.
: In computers,we know that negative integers are represented in 2's complement.
: For example,in an 8-bit system,-5 is stored as 11111011 in binary,which is
: calculate by inverting all bits in the 8-bit representation of 5 and finally
: adding.Explain why negative intergers are not simply represented in the
: 1's complement(which simply negates all bits)
: -5=11111011
: 1=負~~~~~~~是怎樣加成-5呀
: 這題是說要算八進位數中 1+到5?
1's complement
缺點一: 零有兩個
缺點二: 運算完後還要再做減一才會是這正確結果
ex: (-1) + (-1) => 11111110 + 11111110 = 11111100 <= -3
這還要在減一=> 11111101 <= -2
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.66.50