module tb7new; // testbench for the 6-bit by 4-bit multiplier // random inputs, decimal values including a check reg [5:0] x; // 6-bit inputs (to be chosen randomly) reg [3:0] y; // 4-bit inputs (to be chosen randomly) wire [9:0] p; // 10-bit output of the multiplier circuit reg [9:0] check; // 10-bit product value used to check correctess // instantiate the 6-bit by 4-bit multiplier mult6by4 mult_instance(x, y, p); // simulation of 20 random multiplication operations initial repeat (20) begin // get new operand values and compute a check value x = $random; y = $random; check = x * y; // compute and display the product every 10 time units #10 $display($time, " %d * %d = %d (%d)", x, y, p, check); end endmodule