/** * Multiplexor: * out = a if sel == 0 * b otherwise */ CHIP Mux { IN a, b, sel; OUT out; PARTS: Not(in=sel,out=w1); Nand(a=a,b=w1,out=w2); Nand(a=sel,b=b,out=w3); Nand(a=w2,b=w3,out=out); }