Block Diagram of Binary Multiplier
Block Diagram of Binary Multiplier
Multiplicand-register B
Multiplier-reg Q
Counter-P
Carry storage-f/f C
Partial product-reg A
3 states- S _idle,S_add,S_shift
Data path width is 5 bits
When Start=0 ,then there is no actionie in S_idle state
When start =1multiplication process stars then S_idle move to S_add
--c=0 &A=0
--B&Q loaded with multiplicand and multiplier
--counter P set to n-ie no of bits in multiplier
Q[0] is checked-if 0 A and C hve no change
When Q[1]=1 then B+A and carry to C
-then P=P-1
//port declarations
module binary_multiplier(product,ready,multiplicant,multiplier,start,clk,reset_b);
//datapath
input [dp_width-1:0] multiplicant,multiplier;
input start,clk,reset_b;
output [2*dp_width-1:0] product;
output ready;
Parameter dp_width =5;
Parameter BC_size;
Parameter s_idle=3b001;
Parameter s_add=3b010;
Parameter s_shift=3b100;
//reg declaration
reg[2;0] state,next_state;
reg [dp_width-1:0] A,B,Q;
Reg C;
Reg BC_size[1:0] p;
Reg load_reg,decr_p,add_regs,shift_regs;
//combinational logic
Assign product={A,Q};
Wire Zero=(p==0);//counter zero
Wire ready=(state==S_idle);//contrl status
//control unit
always @ (posedge clk,negedge reset_b)
if(~reset_b)state<=s_idle;
Else state<=next_state;
always @ (state,start,Q[0],zero)
Begin
Next_state=S_idle;
Reg C;
Reg BC_size[1:0] p;
Reg load_reg=0;
decr_p=0;
add_regs=0;
shift_regs=0;
Case (state)
//datapath