【问题标题】:Why are the bits inverted in one's complement? [closed]为什么补码中的位反转? [关闭]
【发布时间】:2011-06-09 01:51:49
【问题描述】:

在将 1 与二进制补码相加之前存储带补码的负数时,为什么除了符号之外的所有位都反转了?我想如果唯一不同的是标志,那就更简单了。我能想到的唯一原因是它以某种方式使计算机更容易。

【问题讨论】:

  • 拥有 +0 和 -0 充其量是很麻烦的

标签: twos-complement ones-complement


【解决方案1】:

因为一个人的补语被定义为做什么。见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
  • 感谢约翰的实际有用的回答。
【解决方案2】:

例如,请参阅http://en.wikipedia.org/wiki/One%27s_complement,或快速 google 可以为您提供的其他来源。 基本上,是的,与符号幅度数相比,它使加法和减法更容易实现(尽管 2 的补码使数学更容易)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-07-20
    • 2010-12-12
    • 2016-04-23
    • 1970-01-01
    • 2013-05-19
    • 1970-01-01
    • 2011-01-04
    • 2010-10-28
    相关资源
    最近更新 更多