📜  有符号幅度和2的补码之间的差异

📅  最后修改于: 2021-06-28 16:32:22             🧑  作者: Mango

1.签名幅度法:
在带符号的幅度方法中,数字分为两部分:符号位和幅度。负数的符号位为1,正数的符号位为0。数字的大小用数字的二进制形式表示。
示例:让我们接受8位寄存器。

2. 2的补码方法:
在2的补码方法中,正数的表示方法与正负号方法中的表示方法相同。但是,如果数字为负数,则首先用正号表示数字,然后对该数字取2的补码。
示例:让我们接受8位寄存器。

符号幅度和2的补码方法之间的区别:

SIGNED MAGNITUDE METHOD 2’s COMPLEMENT METHOD
It is a method to denote fixed point signed numbers. It is also used to denote fixed point signed numbers.
Number is divided into two parts. Number is considered as a whole.
Sign bit is considered explicitly. Sign bit is not considered explicitly.
Additional hardware is required for resultant sign of arithmetic. No additional hardware is required in 2’s complement method.
Addition and subtraction are performed on separate hardware. Addition and subtraction are performed by using adder only.
It has two different representation for 0. One is +0 and second is -0. (+0 : 0000 0000) & (-0 : 1000 0000) 0 has only one representation for -0 and +0 (+0 or -0 : 0000 0000).
It is non-weighted system. It assigns negative weight to the sign bit.