I created a few internal chips
OpZ16: Takes as input a 16 bit bus and a single bit. It will output 0 is the single bit is 1, otherwise the output is the same as the input.
OpN16: This chip accepts as input a 16 bit bus x[16], Xor a single bit in. The output of this chip is also on a 16 bit bus. If in == 1, then the input is negated to produce the output, otherwise the output is same as the input.
DetectZero16: This chip takes a 16 bit input, and outputs 1 if the input is zero, and outputs 0 if the input is not zero.
DetectNeg16: This chip takes a 16 bit input, and outputs 1 if the input is negative, and outputs 0 if the input is not negative. I am detecting if it is negative, purely by the value of the MSB.
The last two chips had to be created because an internal bus cannot be subscripted.
Finally, here is my ALU:
As part of the peer learning method, I commented on the following peer posts: