Sign-Magnitude Representation
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION
There are several alternative conventions used to represent negative as well as posi-
tive integers, all of which involve treating the most significant (leftmost) bit in the
word as a sign bit. If the sign bit is 0, the number is positive; if the sign bit is 1, the
number is negative.
There are several drawbacks to sign-magnitude representation. One is that addi-
tion and subtraction require a consideration of both the signs of the numbers and their
relative magnitudes to carry out the required operation. This should become clear in the
discussion in Section 10.3. Another drawback is that there are two representations of 0:
This is inconvenient because it is slightly more difficult to test for 0 (an operation
performed frequently on computers) than if there were a single representation.
Because of these drawbacks, sign-magnitude representation is rarely used in
implementing the integer portion of the ALU. Instead, the most common scheme is
twos complement representation.
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步