Archived
1
0

update and debug testbench

This commit is contained in:
Erick
2022-03-04 01:38:36 +01:00
parent 9c4b6b7ce4
commit d65b968e96
11 changed files with 208 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
'include "predefined/mux.v"
module mux_tb();
reg a,b, sel;
output y;
mux dut(a, b, sel, y);
initial begin
a = 0; b = 0; sel = 0;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 1; b = 0; sel = 0;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 0; b = 1; sel = 0;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 1; b = 1; sel = 0;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 0; b = 0; sel = 1;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 1; b = 0; sel = 1;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 0; b = 1; sel = 1;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
#5;
a = 1; b = 1; sel = 1;
$monitor("IN: %b, %b ",a, b, "SEL: ",sel, " OUT: ",y);
end
endmodule