You are on page 1of 1

module multipication(

input[31:0] multiplier,
input[31:0] multiplicand,
output reg [63:0] product
);
reg [64:0] prod;
reg [31:0] mulcand;
reg [31:0] sum;
integer i = 0;
always @* begin
prod = {32'b0,multiplier};
mulcand = multiplicand;
for(i=0;i<32;i=i+1) begin
//test 0 bit of product
case(prod[0])
1'b0:begin
//if prod[0] == 0, arithmetic shift right
prod = prod>>>1;
end
1'b1:begin

//if prod[0] == 1, add multiplicand to upper 32


//bits and arithmetic shift right
prod = {(prod[63:32]+mcand[31:0]),prod[31:0]};
prod = prod>>>1;

end
endcase
end
product = prod[63:0];
end
endmodule

You might also like