@@ -18,5 +18,47 @@ CHIP DMux8Way {
18
18
OUT a, b, c, d, e, f, g, h;
19
19
20
20
PARTS:
21
- //// Replace this comment with your code.
21
+ Not(in=sel[0], out=notSel0);
22
+ Not(in=sel[1], out=notSel1);
23
+ Not(in=sel[2], out=notSel2);
24
+
25
+ /* a */
26
+ And(a=notSel0, b=notSel1 ,out=aSelUpTo1);
27
+ And(a=aSelUpTo1, b=notSel2 ,out=aSel);
28
+ And(a=in, b=aSel, out=a);
29
+
30
+ /* b */
31
+ And(a=sel[0], b=notSel1 ,out=bSelUpTo1);
32
+ And(a=bSelUpTo1, b=notSel2 ,out=bSel);
33
+ And(a=in, b=bSel, out=b);
34
+
35
+ /* c */
36
+ And(a=notSel0, b=sel[1] ,out=cSelUpTo1);
37
+ And(a=cSelUpTo1, b=notSel2 ,out=cSel);
38
+ And(a=in, b=cSel, out=c);
39
+
40
+ /* d */
41
+ And(a=sel[0], b=sel[1] ,out=dSelUpTo1);
42
+ And(a=dSelUpTo1, b=notSel2 ,out=dSel);
43
+ And(a=in, b=dSel, out=d);
44
+
45
+ /* e */
46
+ And(a=notSel0, b=notSel1 ,out=eSelUpTo1);
47
+ And(a=eSelUpTo1, b=sel[2] ,out=eSel);
48
+ And(a=in, b=eSel, out=e);
49
+
50
+ /* f */
51
+ And(a=sel[0], b=notSel1 ,out=fSelUpTo1);
52
+ And(a=fSelUpTo1, b=sel[2] ,out=fSel);
53
+ And(a=in, b=fSel, out=f);
54
+
55
+ /* g */
56
+ And(a=notSel0, b=sel[1] ,out=gSelUpTo1);
57
+ And(a=gSelUpTo1, b=sel[2] ,out=gSel);
58
+ And(a=in, b=gSel, out=g);
59
+
60
+ /* h */
61
+ And(a=sel[0], b=sel[1] ,out=hSelUpTo1);
62
+ And(a=hSelUpTo1, b=sel[2] ,out=hSel);
63
+ And(a=in, b=hSel, out=h);
22
64
}
0 commit comments