Login  Register

Re: Mux4Way16

Posted by WBahn on May 09, 2024; 5:46am
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Mux4Way16-tp4037818p4037825.html

There is no sel[2] signal. The sel signal is two bits. The signal name sel refers to the complete two-bit bus, while sel[0] refers to one signal in it and sel[1] refers to the other. The signal sel[2] only exists if the bus has at least three bits in it.

Where you see sel[2] used is in this line:

IN a[16], b[16], c[16], d[16], sel[2];

In the IN and OUT lines, the number in square brackets is just telling the simulator how many bits are in the signal.

Be that as it may, how does the line I asked you about do anything?

  And(a=sel[0], b=sel[0], out= outand1);

Again, look at what is actually there, not what you want to be there.

What signal is connected to the 'a' input of that And gate?

What signal is connected to the 'b' input of that And gate?

How does Anding those two signals help accomplish what you want?