Pes U: Niversity, B
Pes U: Niversity, B
Project Report
on
“16-Bit Booth’s Multiplier”
Submitted by
1.______________________
_____________________
2.______________________ _____________________
3.______________________ _____________________
4.______________________ _____________________
Where these two bits are equal, the product accumulator P is left unchanged.
Where yi = 0 and yi−1 = 1, the multiplicand times 2i is added to P; and where yi = 1
and yi−1 = 0, the multiplicand times 2i is subtracted from P. The final value of P is
the signed product.
Implementation
Booth's algorithm can be implemented by repeatedly adding (with ordinary
unsigned binary addition) one of two predetermined values A and S to a product P,
then performing a rightward arithmetic shift on P. Let m and r be the multiplicand
and multiplier, respectively; and let x and y represent the number of bits in m and
r.
1. Determine the values of A and S, and the initial value of P. All of these
numbers should have a length equal to (x + y + 1).
a. A: Fill the most significant (leftmost) bits with the value of m. Fill the
remaining (y + 1) bits with zeros.
b. S: Fill the most significant bits with the value of (−m) in two's
complement notation. Fill the remaining (y + 1) bits with zeros.
c. P: Fill the most significant x bits with zeros. To the right of this,
append the value of r. Fill the least significant (rightmost) bit with a
zero.
PES1201701808 – Aekansh Dixit
Flowchart Diagram
PES1201701808 – Aekansh Dixit
Example
Let A: 3 and B: 17
Multiplicand -
Decimal: 3
Binary: 00000011
Multiplier -
Decimal: 17
Binary: 00010001
Steps -
Subtract: 1110111100000011
Shift: 1111011110000001
Shift: 1111101111000000
Add: 0000110011000000
Shift: 0000011001100000
Shift: 0000001100110000
PES1201701808 – Aekansh Dixit
Shift: 0000000110011000
Shift: 0000000011001100
Shift: 0000000001100110
Shift: 0000000000110011
This module takes in two 8-bit signed inputs, which are our multiplicand and multiplier. It has
one 16-bit signed output. Inside the module, we have eight 8-bit signed wires hold the value of
the changed bits after shifting so that we can manipulate them later.
2. booth_substep(): This sub-module does the main operation of either adding/subtracting or just
shifting the bits according to the last two positions.
This module takes in an 8-bit signed accumulator, 8-bit signed multiplier, the last bit of the
accumulator, 8-bit signed multiplicand, and the output consists of two 8-bit signed registers
PES1201701808 – Aekansh Dixit
containing first 8 and last 8 bits of the product, and cq0 is the changed q0 after the shift
operation.
3. Adder(): This sub-module adds two 8-bit register values, and gives out their sum. This uses a
library module of fa which is nothing but a simple full adder.
4. Subtractor(): This sub-module subtracts two 8-bit register values, and gives out their difference.
This uses a library module of invert to invert each bit separately, and then uses fa which is
nothing but a simple full adder as described above.
5. Lib.v:
a. invert(output ib,input b);
b. and2 (input wire i0, i1, output wire o);
c. or2 (input wire i0, i1, output wire o);
d. xor2 (input wire i0, i1, output wire o);
e. nand2 (input wire i0, i1, output wire o);
f. nor2 (input wire i0, i1, output wire o);
g. xnor2 (input wire i0, i1, output wire o);
h. and3 (input wire i0, i1, i2, output wire o);
i. or3 (input wire i0, i1, i2, output wire o);
j. nor3 (input wire i0, i1, i2, output wire o);
k. nand3 (input wire i0, i1, i2, output wire o);
l. xor3 (input wire i0, i1, i2, output wire o);
m. xnor3 (input wire i0, i1, i2, output wire o);
n. fa (input wire i0, i1, cin, output wire sum, cout);
Apart from using the above modules, we use a testbench to supply the initial values.
a = 8'b11110000;
b = 8'b11110000;
#10
a = 8'b10010101;
b = 8'b100000;
10 -107 X 32 = -3424
20 7 X 0 = 0
30 1 X 1 = 1
40 60 X 5 = 300
50 -86 X 35 = -3010
60 17 X 28 = 476
70 8 X -65 = -520