This is a simple problem but having problem with syntax...
In ALU, if out is equal to 0, then ng is also zero else it is 1 right?
So, To get ng output, I made And Gate like this
And (a=out, b=out, out=ng);
But, I am getting some error telling "Can't connect gates output to pin to part...... " (cant read the full error msg)
Why am i getting this error and how to fix this?
HDL does not allow you to connect pins named in OUTPUT statements to part inputs, only to outputs. What you need to do is connect the output of one of the parts in your ALU to ng
Somewhere in your HDL you connect a part's out
to the ALU's out
SomePart (..., out=out);
On this part you can connect several things to the part's out
SomePart (..., out=out, out=ng, ...);
You will also want to add some other connections to this part's out
so that you can compute zr