Verilog code:
module array_mul(
input [1:0] A,
input [1:0] B,
output reg [3:0] P
);
always @(*)
begin
P = A * B; // Behavioural multiplication
end
endmodule
Test bench code:
module tb_array_mul();
reg [1:0] A;
reg [1:0] B;
wire [3:0] P;
array_mul uut (A, B, P);
initial begin
A = 2'b00; B = 2'b00; #10;
A = 2'b01; B = 2'b01; #10;
A = 2'b10; B = 2'b01; #10;
A = 2'b11; B = 2'b01; #10;
A = 2'b10; B = 2'b10; #10;
A = 2'b11; B = 2'b11; #10;
$finish;
end
endmodule
OUTPUT GRAPH:
RTL SCHEMATIC:
POWER:
TIMIMG REPORT: