module multiplication (multiplier, multiplicand, product, clk);
input [3:0] multiplier;
input [4:0] multiplicand;
input clk;
output [7:0] product;
reg [7:0] product;
initial
begin
product [7:4] = 4'b0000;
product [3:0] = 4'b1100;
end
always @ (posedge clk)
begin
if (product[0] == 1)
begin
product <= product >> 1;
product[7:3] <= product[7:3] + multiplicand[4:0];
end
else
begin
product <= product >> 1;
end
end
endmodule
This verilog code is to implement the circuit mentioned in this question: How to perform right shifting binary multiplication?, the waveform is correct until the last step. The correct answer should be 00111100