Nand_Latch_1
module test_Nand_Latch_1;
reg preset,clear;
wire q,qbar;
Nand_Latch_1 M1(q,qbar,preset,clear);
initial
begin
$monitor($time,"preset=%b clear=%b q=%b qbar=%b",preset,clear,q,qbar);
end
initial
begin
#10 preset=0; clear=1;
#10 preset=1;
#10 clear=0;
#10 clear=1;
#10 preset=0;
end
initial
#60 $finish;
endmodule
module Nand_Latch_1(q,qbar,preset,clear);
input preset,clear;
output q,qbar;
nand g1(q,preset,qbar),
g2(qbar,clear,q);
endmodule
0 Comments:
Post a Comment
<< Home