ajamil wrote
I am getting this error 'can't connect the gate's output to chip part'
What you are missing is that you can have multiple "out=" connections on a part.
Somewhere in your ALU you have
Somepart(..., out=out);
That generates the main 'out' value that you want to further process. You want to add more connections to that part's 'out':
Somepart(..., out=out, out[15]=ng, out[...]=..., out[...]=...);
where the last 2 'out' connections are used by circuitry that generates 'zr'.
--Mark