【发布时间】:2011-06-09 01:51:49
【问题描述】:
在将 1 与二进制补码相加之前存储带补码的负数时,为什么除了符号之外的所有位都反转了?我想如果唯一不同的是标志,那就更简单了。我能想到的唯一原因是它以某种方式使计算机更容易。
【问题讨论】:
-
拥有 +0 和 -0 充其量是很麻烦的
标签: twos-complement ones-complement
在将 1 与二进制补码相加之前存储带补码的负数时,为什么除了符号之外的所有位都反转了?我想如果唯一不同的是标志,那就更简单了。我能想到的唯一原因是它以某种方式使计算机更容易。
【问题讨论】:
标签: twos-complement ones-complement
因为一个人的补语被定义为做什么。见http://en.wikipedia.org/wiki/Signed_number_representations
【讨论】:
One of the great debates was the format of negative numbers, with some of the era's most intelligent people having very strong and different opinions. --bit.ly/iO68tw
例如,请参阅http://en.wikipedia.org/wiki/One%27s_complement,或快速 google 可以为您提供的其他来源。 基本上,是的,与符号幅度数相比,它使加法和减法更容易实现(尽管 2 的补码使数学更容易)。
【讨论】: