-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.txt
64 lines (57 loc) · 1.39 KB
/
test.txt
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
61
62
63
64
component Buf (d) -> q { d=q; }
component Buf123 (d, a, b) -> (q, x, y) {
q=d;
a=a1;
b1=b;
Nand(a1) -> x;
Nand(b1) -> y;
}
component Not (a) -> q { Nand(a) -> q; }
component And3(a, b, c) -> x {
Nand(a, b, c) -> n_x;
Not(n_x) -> x;
}
component Mux_4_1(s1, s0, a, b, c, d) -> y {
Buf (s1) -> d_s1;
Buf (s0) -> d_s0;
Not (s1) -> n_s1;
Not (s0) -> n_s0;
Buf(a) -> d_a; Buf(b) -> d_b; Buf(c) -> d_c; Buf(d) -> d_d;
Nand (n_s0, n_s1, d_a) -> sel00;
Nand (d_s0, n_s1, d_b) -> sel01;
Nand (n_s0, d_s1, d_c) -> sel10;
Nand (d_s0, d_s1, d_d) -> sel11;
Nand (sel00, sel01, sel10, sel11) -> y;
}
component Xor2(a, b) -> x {
ConstantBit() -> (_0, _1, X);
Mux_4_1(a, b, _0, _1, _1, _0) -> x;
}
component Demux_1_4(s1, s0, i) -> (f0, f1, f2, f3) {
Buf(i) -> d_i;
Buf(s1) -> d_s1; Buf(s0) -> d_s0;
Not(s1) -> n_s1; Not(s0) -> n_s0;
And3(n_s1, n_s0, d_i) -> f0;
And3(n_s1, d_s0, d_i) -> f1;
And3(d_s1, n_s0, d_i) -> f2;
And3(d_s1, d_s0, d_i) -> f3;
}
component AssignTest(a) -> (a0, a1, a2, a3) {
a0 = a1;
a2 = a3;
b0 = b1;
a0 = b0;
a3 = b1;
a = b2;
b2 = b1;
}
component DLatch(enable, d) -> q {
Not(enable) -> n_enable;
Nand(enable, d) -> ed;
Nand(n_enable, n_d) -> ned;
Nand(n_enable, n_q) -> q;
Not(q) -> n_q;
}
component ArrayTest1D(a[3:0]) -> b[3:0] {
a[3:0] = b[3:0];
}