|
发表于 2010-8-13 17:06:43
|
显示全部楼层
举一个二与门的例子。
二与门模块名为:module and_g2(a,b,f);
其testbench程序如下。
`timescale 1ns/1ns
module and_g2_test;
reg a,b;//输入信号
wire f;//输出信号
and_g2 u0(a,b,f);
initial begin
a=0;b=0;
#100 a=1;
#100 a=0;b=1;
#100 a=1;
#200 $finish;
end
endmodule
其中,initial...begin...end部分为给输入信号赋值。 |
|