Login  Register

DMUX4WAY

Posted by jayjay on Apr 12, 2020; 4:53am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/DMUX4WAY-tp4034403.html

Wondering if someone can explain to me what the number IN square brackets represents?
For example below is the parts list I came up with for DMUX4WAY.
I could not get it to work when I had originally used sel=sel[0]  , sel=sel[1] sel=sel[1] in place of what is below for the selectors.
When I get DMUX8WAY to work the architecture seems different again for the DMUX4WAY used to build it. sel[0]=sel[0] etc....
Thanks

DMUX4WAY
PARTS:
    // Put your code here:
    DMux(in=in, sel=sel[1], a=c1, b=c2);
    DMux(in=c1, sel=sel[0], a=a, b=b);
    DMux(in=c2, sel=sel[0], a=c, b=d);

DMUX8WAY
PARTS:
    // Put your code here:
DMux(in=in, sel=sel[2], a=c1, b=c2);
DMux4Way(in=c1, sel[0]=sel[0], sel[1]=sel[1], a=a, b=b, c=c, d=d);
DMux4Way(in=c2, sel[0]=sel[0], sel[1]=sel[1], a=e, b=f, c=g, d=h);