|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
305ns以后的
对一个主从D触发器仿真,仿真时非门NT1设置了1个单位的时延,最后的结果如下图:
完整波形
代码是:
`timescale 1ns/100ps;
module msdff(d,c,q,qbar);
input d,c;
output q,qbar;
not #1 nt1(notd,d);
not nt2(notc,c);
not nt3(noty,y);
nand nd1(d1,d,c),
nd2(d2,notd,c),
nd3(y,d1,ybar),
nd4(ybar,y,d2),
nd5(y1,y,notc),
nd6(y2,noty,notc),
nd7(q,qbar,y1),
nd8(qbar,y2,q);
endmodule
module test_msdff;
reg td1,td2,tc;
wire tq1,tqbar1,tq2,tqbar2;
msdff m1(td1,tc,tq1,tqbar1);
msdff m2(td2,tc,tq2,tqbar2);
always
#5 tc = ~tc;
initial
tc = 0;
initial
begin
td1 = 0;
#40 td1 = 1;
#40 td1 = 0;
#40 td1 = 1;
#40 td1 = 0;
#40 td1 = 1;
#40 td1 = 0;
#40 td1 = 1;
#35 td1 = 0;
#1 td1 = 1;
#1 td1 = 0;
#38 $stop;
end
initial
begin
td2 = 0;
#40 td2 = 1;
#40 td2 = 0;
#40 td2 = 1;
#40 td2 = 0;
#40 td2 = 1;
#40 td2 = 0;
#40 td2 = 1;
#35 td2 = 0;
#40;
end
//initial
//$monitor("Time = %t::",$time,"d=%b,c=%b,q=%b,qbar=%b",td,tc,tq,tqbar);
endmodule
为什么d1和d2都是一的时候,y和noty分别为1和0呢? |
|