我正在尝试使用二进制形式的二进制补码来解决以下问题。
7.5 - 6.75
7.5 - 6.75 可以重写为 (7.5)+(-6.75)
取十进制数的二进制
7.5 = 111.1
6.75 = 110.11
-6.75= 001.00
现在我应该在“。”(句点)的左侧还是右侧添加 1?
我正在尝试使用二进制形式的二进制补码来解决以下问题。
7.5 - 6.75
7.5 - 6.75 可以重写为 (7.5)+(-6.75)
取十进制数的二进制
7.5 = 111.1
6.75 = 110.11
-6.75= 001.00
现在我应该在“。”(句点)的左侧还是右侧添加 1?
要使用 2 的补码执行有符号数 (M – N) 的减法,请执行以下操作:
产生 2 的赞美:
The 2’s complement of the subtrahend 10001 = 01111
1 1 1 1 carry bits
1 0 0 1 1
+ 0 1 1 1 1
1 0 0 0 1 0
Since the summation produces an end carry the result is positive.
Discard the end carry; the result is a positive number.