Skip to content

Commit e16bb71

Browse files
committed
01/DMux8Way.hdl
1 parent d2b8175 commit e16bb71

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

01/DMux8Way.hdl

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,47 @@ CHIP DMux8Way {
1818
OUT a, b, c, d, e, f, g, h;
1919

2020
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);
2264
}

01/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
- [x] mux4way16
1313
- [x] mux8way16
1414
- [x] dmux4way
15-
- [ ] dmux8way
15+
- [x] dmux8way

0 commit comments

Comments
 (0)