How to find the value of all possible combinations of 8x8 multiplier(approximate compressors) in Verilog?
8x8 multiplier-verilog code:
module multiplier(multiplicand, multiplier,product);
input [7:0] multiplicand;
input [7:0] multiplier;
output [15:0] product;
...
reg [15:0] product;
initial begin
...
product = f1+f2;
end
endmodule
Verilog Test Bench:
module test_bench;
reg [7:0] a;
reg [7:0] b;
wire [15:0] c;
multiplier one(a,b,c);
initial begin
a=1;b=13;
#21 $display(c); //#21 is for the delay produced from the muliplier block
a=2;b=10;
#21 $display(c); //why not 20?Instead I get 13 again even if I use $monitor(c)
end
endmodule
Output:
13
13
Here why I am I getting 13 in the second $display? How to get 2x10 = 20 instead? I am trying to dynamically vary the inputs to the one multiplier object and find the result? How can I do this?
Full code-click here
My aim is to find the ratio of correct outputs : total combinations for a multiplier using approximate compressors
Image - I need to compute the final column of this image, i.e the total number of correct inputs for all the combinations possible (65025 for 8 bit multiplication). Is there any other way to do this? Thanks!
Comments
Post a Comment