Implement multi-way gates: Or8Way, Mux4Way16, Mux8Way16, DMux4Way, DMux8Way

This commit is contained in:
2025-08-28 13:19:40 +02:00
parent 93f730d0ce
commit 88b4cc4ad9
5 changed files with 29 additions and 10 deletions

View File

@@ -20,5 +20,8 @@ CHIP Mux8Way16 {
OUT out[16];
PARTS:
//// Replace this comment with your code.
// Use two Mux4Way16 gates and one Mux16 to select from 8 inputs
Mux4Way16(a=a, b=b, c=c, d=d, sel=sel[0..1], out=mux4wayABCD);
Mux4Way16(a=e, b=f, c=g, d=h, sel=sel[0..1], out=mux4wayEFGH);
Mux16(a=mux4wayABCD, b=mux4wayEFGH, sel=sel[2], out=out);
}