-
Notifications
You must be signed in to change notification settings - Fork 0
/
Counter_lab6_74ls93.sv
60 lines (46 loc) · 1016 Bytes
/
Counter_lab6_74ls93.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module Counter_lab6_74ls93(input logic InvCp0,
//input logic InvCp1,
output logic Q0,
output logic Q1,
output logic Q2,
output logic Q3);
assign J = 1; //no need for logic or input or output if not input and ouput and just internal same for variables
assign K = 1;
//to reset AT 10 like the labconnect MR1 AND MR2 TO Q1 AD Q2 respectively
assign MR1 = Q1;
assign MR2 = Q3;
assign InvCd = ~(MR1 & MR2);
assign Cd= ~InvCd;
JK_flipflop mod2_counter
(
.CLK (~InvCp0),
.CLR (Cd),
.J (J),
.K (K),
.Q(Q0) //for stuff like this arrays mess up dont know why
);
JK_flipflop mod8_counter1
(
.CLK (~Q0),
.CLR (Cd),
.J (J),
.K (K),
.Q(Q1)
);
JK_flipflop mod8_counter2
(
.CLK (~Q1),
.CLR (Cd),
.J (J),
.K (K),
.Q(Q2)
);
JK_flipflop mod8_counter3
(
.CLK (~Q2),
.CLR (Cd),
.J (J),
.K (K),
.Q(Q3)
);
endmodule