第1题:
x =9/16 =1001b/16d =0.1001b , (将1001b右移4位)
y =11/16 =1011b/16 =0.1011b, (将1011b右移4位)
设字长8位:
[x]补 =0000.1001b
[y]补 =0000.1011b (+
-----------------------------------
[x+y]补 =0001.0100b
x+y = 10100b/16 = 20/16,(将 1.0100b左移4位)
第2题:
A = -97d = -110 0001b, [A]补 =1001 1111b
-B = -41d = -10 1001b, [-B]补 =1101 0111b (+
-----------------------------
[A-B]补 =1 0111 0110b
Cs♁Cp = 1♁0 = 1 ,负溢出
(Cs是符号位的进位,Cp是最高数值位的进位,♁表示异或)
[A-B]反 = -0111 0101b
[A-B]原 = -1000 1010B
A-B = -1000 1010B = -138d