weijia wrote
//get notx
Not16(in=x,out=nx);
'nx' is a 1-bit INPUT to the ALU. You want ..., out=notx);
The next problems that you are likely to run into are
"A pin name is expected" in
Not16(in[0..15]=false,out=-1);
-1 is not a legal pin name. You don't need to do anything special to get -1. "true" is all 1 bits, and like "false" it matches any bus width.
"Can't connect gate's output pin to part" in
Or(a=out[0],b=out[1],out=t0);
Connecting to a pin mentioned in the OUTPUT section is not allowed.
Fortunately, you can "solder" more than one wire to a part's output:
Mux16(a=outf,b=noutf,sel=no,out=out, out[0:7]=outlow, out[]=..., out[]=...,);
and use all those extra outputs for zr and ng processing.
Think about how to use Or8Way do save a lot of typing.
--Mark