Ask for M3m2m1m0xq3q2q1q0:0110x0101 (signed number is in complement, the highest bit is positive or negative)
1. Add auxiliary bit: a=0000 q-1=0
2. Control logic judgment:
①Q0Q-1=01: A=a+m then A, Q, Q-1 arithmetic right shift (two steps)
②q0q-1=10: A=a-m then A, Q, Q-1 arithmetic right shift (two steps)
Complement plus minus: (A-M) complement =a complement + (-m) complement
③q0q-1=00 or 11 o'clock: A, Q, Q-1 arithmetic right shift (one step)
Complement right shift: empty 1
3, q A few do several right-shift operations. (eg: 01000x011, do 3 right Shift end)
4, the result is AQ (0001 1110, that is, 6x5=30).
operation process and results
|
A |
Q |
Q-1 |
M |
Initial |
0000 |
0101 |
0 |
0110 |
①a-m |
1010 |
0101 |
0 |
0110 |
A,q,q-1 Right Shift |
1101 |
0010 |
1 |
0110 |
②a+m |
0011 |
0010 |
1 |
0110 |
A,q,q-1 Right Shift |
0001 |
1001 |
0 |
0110 |
③a-m |
1011 |
1001 |
0 |
0110 |
A,q,q-1 Right Shift |
1101 |
1100 |
1 |
0110 |
④a+m |
0011 |
1100 |
1 |
0110 |
A,q,q-1 Right Shift |
0001 |
1110 |
0 |
0110 |
Booth algorithm (multiplication of signed numbers)