//Modelsim 1x2 DeMUX testbench
//參考用 未經深入研究
//=============================
`timescale 1us/1us;
module dmuxtest(y,din,s);
input din,s;
output [1:0]y;
wire s0 ;
not(s0,s);
and(y[0],din,s0);
and(y[1],din,s);
endmodule
//=============================
`timescale 1us/1us;
module dmuxtestbench ;
reg din,s;
wire [1:0]y;
dmuxtest UUT(y,din,s);
initial
begin
din=1'b0;
s=1'b0;
# 10 din=1'b0;
s=1'b1;
# 10 din=1'b1;
s=1'b0;
# 10 din=1'b1;
s=1'b1;
#50 $finish ;
end
initial
$monitor($time,"input x1 x2 output y[0] y[1] %d %d %d %d",din,s,y[0],y[1]);
endmodule
沒有留言:
張貼留言