如何在Verilog Pro中编写基本的触发器? [英] how to code basic flip flop in Verilog Pro?
本文介绍了如何在Verilog Pro中编写基本的触发器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
// 设计模块
模块rstt(s,r,q,qbar);
输入r,s;
输出q,qbar;
nand n1(q,r,qbar);
nand n2(qbar,s,q);
终端模块
// 刺激模块
模块测试;
reg r,s;
线q,qbar;
最初开始
r = 1 ' b1;
s = 1' b0;
#25 r = 1 ' b0;
s = 1' b1;
#25 r = 1 ' b1;
s = 1' b1;
#100 $完成;
结尾
endmodule
解决方案
完成; 结尾 结束模块
i tried to code a basic flip flop using NAND gates in Verilog pro but the wave form i m getting is not correct. plzz see whats wrong in it
//design module
module rstt(s,r,q,qbar);
input r,s;
output q,qbar;
nand n1(q,r,qbar);
nand n2(qbar,s,q);
endmodule
//stimulus module
module test;
reg r,s;
wire q,qbar;
initial begin
r=1'b1;
s=1'b0;
#25 r=1'b0;
s=1'b1;
#25 r=1'b1;
s=1'b1;
#100 $finish;
end
endmodule
解决方案
finish; end endmodule
这篇关于如何在Verilog Pro中编写基本的触发器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文