Skip to content

Commit c79d7a8

Browse files
authored
Create testbench.sv
1 parent d1f6825 commit c79d7a8

File tree

1 file changed

+55
-0
lines changed
  • LAB VII: CONSTRUCT, TEST AND INVESTIGATE THE OPERATION OF VARIOUS FLIP-FLOP CIRCUITS USING HDL/Q3

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
module testbench_JKFF;
2+
reg t_s, t_r, t_q;
3+
wire t_t;
4+
circuit3 dut(t_s, t_r, t_q, t_t);
5+
6+
initial
7+
begin
8+
$dumpfile("dump.vcd");
9+
$dumpvars(0, dut);
10+
11+
#1
12+
t_s <= 0;
13+
t_r <= 0;
14+
t_q <= 0;
15+
16+
#1
17+
t_s <= 0;
18+
t_r <= 0;
19+
t_q <= 1;
20+
21+
#1
22+
t_s <= 0;
23+
t_r <= 1;
24+
t_q <= 0;
25+
26+
#1
27+
t_s <= 0;
28+
t_r <= 1;
29+
t_q <= 1;
30+
31+
#1
32+
t_s <= 1;
33+
t_r <= 0;
34+
t_q <= 0;
35+
36+
#1
37+
t_s <= 1;
38+
t_r <= 0;
39+
t_q <= 1;
40+
41+
#1
42+
t_s <= 1;
43+
t_r <= 1;
44+
t_q <= 0;
45+
46+
#1
47+
t_s <= 1;
48+
t_r <= 1;
49+
t_q <= 1;
50+
51+
#1
52+
53+
$finish();
54+
end
55+
endmodule

0 commit comments

Comments
 (0)