I have the same problem with this code also
//This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/1/Mux16.hdl
/**
* 16-bit multiplexor:
* for i = 0, ..., 15:
* if (sel = 0) out[i] = a[i], else out[i] = b[i]
**/
CHIP Mux16 {
IN a[16], b[16], sel;
OUT out[16];
PARTS:
//// Replace this comment with your code.
//// a and b are 16 bits data buses. out=a 16 bits bus
Not(in=sel, out=notSel);
And(a[0]=b[0], b[0]=sel, out=outand0);
And(a[0]=a[0], b[0]=notSel, out=outand1);
Or(a[0]=outand0, b[0]=outand1, out=out[0]);
And(a[1]=b[1], b[1]=sel, out=out2);
And(a[1]=a[1], b[1]=notSel, out=out3);
Or(a[1]=out2, b[1]=out3, out=out[1]);
And(a[2]=b[2], b[2]=sel, out=outand4);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[2]=a[2], b[2]=notSel, out=outand5);
//Either b=sel or a=sel i.e b=notSel
Or(a[2]=outand4, b[2]=outand5, out=out[2]);
And(a[3]=b[3], b[3]=sel, out=outand6);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[3]=a[3], b[3]=notSel, out=outand7);
//Either b=sel or a=sel i.e b=notSel
Or(a[3]=outand6, b[3]=outand7, out=out[3]);
And(a[4]=b[4], b[4]=sel, out=outand8);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[4]=a[4], b[4]=notSel, out=outand9);
//Either b=sel or a=sel i.e b=notSel
Or(a[4]=outand8, b[4]=outand9, out=out[4]);
And(a[5]=b[5], b[5]=sel, out=outand10);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[5]=a[0], b[5]=notSel, out=outand11);
//Either b=sel or a=sel i.e b=notSel
Or(a[5]=outand10, b[5]=outand11, out=out[5]);
And(a[6]=b[6], b[6]=sel, out=outand12);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[6]=a[6], b[6]=notSel, out=outand13);
//Either b=sel or a=sel i.e b=notSel
Or(a[6]=outand12, b[6]=outand13, out=out[6]);
And(a[7]=b[7], b[7]=sel, out=outand14);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[7]=a[7], b[7]=notSel, out=outand15);
//Either b=sel or a=sel i.e b=notSel
Or(a[7]=outand14, b[7]=outand15, out=out[7]);
And(a[8]=b[8], b[8]=sel, out=outand16);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[8]=a[8], b[8]=notSel, out=outand17);
//Either b=sel or a=sel i.e b=notSel
Or(a[8]=outand16, b[8]=outand17, out=out[8]);
And(a[9]=b[9], b[9]=sel, out=outand18);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[9]=a[9], b[9]=notSel, out=outand19);
//Either b=sel or a=sel i.e b=notSel
Or(a[9]=outand18, b[9]=outand19, out=out[9]);
And(a[10]=b[10], b[10]=sel, out=outand20);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[10]=a[10], b[10]=notSel, out=outand21);
//Either b=sel or a=sel i.e b=notSel
Or(a[10]=outand20, b[0]=outand21, out=out[10]);
And(a[11]=b[11], b[11]=sel, out=outand22);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[11]=a[11], b[11]=notSel, out=outand23);
//Either b=sel or a=sel i.e b=notSel
Or(a[11]=outand22, b[11]=outand23, out=out[11]);
And(a[12]=b[12], b[12]=sel, out=outand24);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[12]=a[12], b[12]=notSel, out=outand25);
//Either b=sel or a=sel i.e b=notSel
Or(a[12]=outand24, b[12]=outand25, out=out[12]);
And(a[13]=b[13], b[13]=sel, out=outand26);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[13]=a[13], b[13]=notSel, out=outand27);
//Either b=sel or a=sel i.e b=notSel
Or(a[13]=outand26, b[13]=outand27, out=out[13]);
And(a[14]=b[14], b[14]=sel, out=outand28);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[14]=a[14], b[14]=notSel, out=outand29);
//Either b=sel or a=sel i.e b=notSel
Or(a[14]=outand28, b[14]=outand29, out=out[14]);
And(a[15]=b[15], b[15]=sel, out=outand30);
//case INPUT a[i]=/=b[i], b[i]=/=sel, out=a[i]
And(a[15]=a[15], b[15]=notSel, out=outand31);
//Either b=sel or a=sel i.e b=notSel
Or(a[15]=outand30, b[15]=outand31, out=out[15]);
}
John