zx = 1, nx = 1, zy = 1, ny = 1 is supposed to make Mux16 forward the second input. This is demonstrated as y1 gets its value 0 from yz. However, it is inconsistent with the observations that x2 apparently gets its value 0 from x1 and y2 gets its value 0 from y1.

Re: Impossible bug

Administrator

Joel Sjögren wrote

I solved the problem somehow... suddenly the bits were different.

If you were seeing wrong values in the HardwareSimulator, that's a known problem that can occur when animation is turned off. There are also problems with the eval button if you have not connected signals to all the chip outputs.

May I instead ask how my complicated solution might be simplified?

You have missed some features of HDL.

There are built in constants true and false so you do not need to make your own 0 using AND(x, ~x).

Mux16(a=x, b=false, ...

You can have multiple connections to part outputs and you can connect to sub-buses of outputs, so you do not need extra chips to copy signals or select bits.