加减算法

【求补码的加减算法】 补码加减法:X=+1000100,Y=+1110,求X+Y,X-Y的值若是16位二进制数.则:(X)原码=0000000001000100(Y)原码=0000000000001110(Y)反码=1111111111110001(Y)补码=1111111111110010...

求补码的加减算法

补码加减法:X=+1000100,Y=+1110,求X+Y,X-Y的值
若是16位二进制数.
则:(X)原码=0000000001000100
(Y)原码=0000000000001110
(Y)反码=1111111111110001
(Y)补码=1111111111110010
X+Y=(X)原码+(Y)原码
=0000000001000100+0000000000001110
=0000000001010010
X-Y=(X)原码+(Y)补码
=0000000001000100+1111111111110010
=0000000000110110
继续阅读:求补码的加减算法