-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmux2.sv
59 lines (51 loc) · 775 Bytes
/
mux2.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
// 2->1 multiplexer template
module mux2 (
input logic d0, // Data input 0
input logic d1, // Data input 1
input logic sel, // Select input
output logic z // Output
);
logic t1, t2, t3, t4, t5;
NAND2 #(
.Tpdhl(10), .Tpdlh(10)
) nand_g1 (
.A(d0),
.B(t4),
.Z(t1)
);
NAND2 #(
.Tpdhl(10), .Tpdlh(10)
) nand_g2 (
.A(t1),
.B(t1),
.Z(t2)
);
NAND2 #(
.Tpdhl(10), .Tpdlh(10)
) nand_g3 (
.A(d1),
.B(sel),
.Z(t3)
);
NAND2 #(
.Tpdhl(10), .Tpdlh(10)
) nand_g4 (
.A(sel),
.B(sel),
.Z(t4)
);
NAND2 #(
.Tpdhl(10), .Tpdlh(10)
) nand_g5 (
.A(t3),
.B(t3),
.Z(t5)
);
OR2 #(
.Tpdhl(2), .Tpdlh(2)
) or_g6 (
.A(t2),
.B(t5),
.Z(z)
);
endmodule