作者avogau ( 假 装)
看板TransCSI
标题Re: [问题] 数位逻辑
时间Tue Apr 7 00:15:04 2009
※ 引述《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