dzmitry-paulenka / nand2tetris-implementation

Implementing http://www.nand2tetris.org/ course.
MIT License
2 stars 1 forks source link

Mux8Way16.hdl can be more simplified! #4

Open tiholic opened 7 years ago

tiholic commented 7 years ago
CHIP Mux8Way16 {
    IN a[16], b[16], c[16], d[16],
       e[16], f[16], g[16], h[16],
       sel[3];
    OUT out[16];

    PARTS:
        Mux4Way16(a=a, b=b, c=c, d=d, sel=sel[0..1], out=aMux4W16d);
        Mux4Way16(a=e, b=f, c=g, d=h, sel=sel[0..1], out=eMux4W16h);
        Mux16(a=aMux4W16d, b=eMux4W16h, sel=sel[2], out=out);
}
tiholic commented 7 years ago

And similar simplification can be done for DMux8Way16