程序
module dff(data,clk,q);
input data,clk;
output q;
reg q;
always@(posedge clk)
q <= data;//<=//=
endmodule
测试程序
`timescale 1ns/1ns
module dff_tb();
reg data,clk;
wire q;
dff ff(data,clk,q);
initial
fork
clk = 0;
#20
forever
#10 clk = ~clk;
#10
data = 1;
#30
data = 0;
#50
data = 1;
#70
data = 0;
#90
data = 1;
join
endmodule
文章评论(0条评论)
登录后参与讨论