1.在字长为8位的计算机中,+18,-18,+31,-31,+127,-127的原码、反码和补码各为多少?
(+18)原=00010010
(+18)反=01101101
(+18)补=00010010
(-18)原=10010010
(-18)反=11101101
(-18)补=11101110
(+31)原=00011111
(+31)反=01100000
(+31)补=00011111
(-31)原=10011111
(-31)反=11100000
(-31)补=11100001
(+127)原=01111111
(+127)反=00000000
(+127)补=01111111
(-127)原=11111111
(-127)反=10000000
(-127)补=10000001
2.(1)设有两个定点小数X=-.010111,y=+0.10001,用补码的加法求真值X+Y;
(2)设X=-11001,y=-10011,采用双符号位补码计算真值X-Y.