📜  门| Gate IT 2005 |问题8

📅  最后修改于: 2021-06-29 01:50:18             🧑  作者: Mango

使用Booth的乘法算法,乘法器-57将被重新编码为
(A) 0 -1 0 0 1 0 0 -1
(B) 1 1 0 0 0 1 1 1
(C) 0 -1 0 0 1 0 0 0
(D) 0 1 0 0 -1 0 0 1答案: (A)
说明: Booth的算法:如果number为负,则首先取给定数字的2的补码,然后将0附加到LSB。

Then, for each pair from LSB to MSB (add 1 bit at a time):
00 = 0, 01 = +1, 10 = -1, 11 = 0

因此,给定编号的带符号表示形式(2的补码)为-57

= 2's complement of (00111001) = 11000110+1 = 11000111
= append 0 into LSB of (11000111) = 110001110
Now Booth's code (add 1 bit at a time, from LSB to MSB):
= 11, 10, 00, 00, 01, 11, 11, 10 = 0 -1 0 0 1 0 0 -1

替代方式–
您可以在给定的选项中计算十进制值:
(A)0 -1 0 0 1 0 0 -1 = 0 *(2 ^ 6)-1 *(2 ^ 6)+ 0 *(2 ^ 5)+ 0 *(2 ^ 4)+ 1 *(2 ^ 3)+ 0 *(2 ^ 2)+ 0 *(2 ^ 1)-1 *(2 ^ 0)= -2 ^ 6 + 2 ^ 3 – 2 ^ 0 = -64 +8 -1 = -57
(B)1 1 0 0 0 1 1 1 = 2 ^ 7 + 2 ^ 6 + 2 ^ 2 2 ^ 1 + 2 ^ 0 = 199
(C)0 -1 0 0 1 0 0 0 = -2 ^ 6 + 2 ^ 3 = -56
(D)0 1 0 0 -1 0 0 1 = 2 ^ 6 – 2 ^ 3 + 2 ^ 0 = 57

因此,选项(A)是正确的。
这个问题的测验