In: Computer Science
2. Show the trace of the RTL code for Booth's algorithm for X = 0111 and Y = 1011.
Solution:
Booth's Multiplication for X= 0111 , Y =1011 is shown below:
Booths algorithm check the values of Q0Q-1 ?
If Q0Q-1 =00 or 11 Do Just Arithmetic Right Shift(ARS) of A,Q Q0
If Q0Q-1 =10 Do A <- A - M then Just Arithmetic Right Shift(ARS) of A,Q Q0
If Q0Q-1 =01 Do A <- A + M then Just Arithmetic Right Shift(ARS) of A,Q Q0
Here A is Accumulator, Q is Multiplier , M is Multiplicand, Q0 is LSB of Q and Q-1 is next digit to Q0
Here x =0111 ( Multiplicand)
Y=1011 ( Multiplier)
Step Count 'n' |
A | Q | Q-1 | M | Description |
4 | 0000 | 1011 | 0 | 0111 | Intialised |
4 3 |
1001 1100 |
1011 1101 |
0 1 |
0111 0111 |
Step-1, Compare Q0Q-1 =10 So A = A-M then ASR A Q Q0 then decrement 'n' |
2 |
1110 |
0110 |
1 |
0111 |
Step-2, Compare Q0Q-1 =11 So Only ASR A Q Q0 then decrement 'n' |
2 1 |
1110 0101 0010 |
0110 0110 1011 |
1 1 0 |
0111 0111 0111 |
Step :3 As Q0Q-1 =01, Then A <- A + M and ASR A Q Q-1, decrement count 'n |
1 0 |
1011 1101 |
1011 1101 |
0 1 |
0111 0111 |
Step 4: Check Q0Q-1= 10 so A = A - M then ASR A,Q Q-1 then less the count by one |