Re-do Mux.hdl, DMux.hdl, and Mux16.hdl
x1phosura x1phosura@x1phosura.zone
Sun, 28 Nov 2021 19:31:36 -0800
4 files changed,
27 insertions(+),
7 deletions(-)
M
projects/01/DMux.hdl
→
projects/01/DMux.hdl
@@ -14,5 +14,7 @@ IN in, sel;
OUT a, b; PARTS: - // Put your code here: + Not(in=sel, out=not-sel); + And(a=in, b=not-sel, out=a); + And(a=in, b=sel, out=b); }
M
projects/01/Mux.hdl
→
projects/01/Mux.hdl
@@ -14,5 +14,8 @@ IN a, b, sel;
OUT out; PARTS: - // Put your code here: -}+ Not(in=sel, out=not-sel); + And(a=a, b=not-sel, out=and1); + And(a=b, b=sel, out=and2); + Or(a=and1, b=and2, out=out); +}
M
projects/01/Mux16.hdl
→
projects/01/Mux16.hdl
@@ -14,5 +14,20 @@ IN a[16], b[16], sel;
OUT out[16]; PARTS: - // Put your code here: + Mux(a=a[0], b=b[0], sel=sel, out=out[0]); + Mux(a=a[1], b=b[1], sel=sel, out=out[1]); + Mux(a=a[2], b=b[2], sel=sel, out=out[2]); + Mux(a=a[3], b=b[3], sel=sel, out=out[3]); + Mux(a=a[4], b=b[4], sel=sel, out=out[4]); + Mux(a=a[5], b=b[5], sel=sel, out=out[5]); + Mux(a=a[6], b=b[6], sel=sel, out=out[6]); + Mux(a=a[7], b=b[7], sel=sel, out=out[7]); + Mux(a=a[8], b=b[8], sel=sel, out=out[8]); + Mux(a=a[9], b=b[9], sel=sel, out=out[9]); + Mux(a=a[10], b=b[10], sel=sel, out=out[10]); + Mux(a=a[11], b=b[11], sel=sel, out=out[11]); + Mux(a=a[12], b=b[12], sel=sel, out=out[12]); + Mux(a=a[13], b=b[13], sel=sel, out=out[13]); + Mux(a=a[14], b=b[14], sel=sel, out=out[14]); + Mux(a=a[15], b=b[15], sel=sel, out=out[15]); }
M
projects/01/PROGRESS.md
→
projects/01/PROGRESS.md
@@ -5,17 +5,17 @@ ## TODO
And16 DMux4Way DMux8Way -DMux -Mux16 Mux4Way16 Mux8Way16 -Mux Not16 Or16 Or8Way ## DONE And +DMux +Mux16 +Mux Not Or Xor