I'm stuck wondering what the simplest way to copy a bit value is. I want to copy the 15th bit of the output to an different bit. In real life I would just wire it on, but in the simulator that doesn't seem possible. My current thought is to use a Mux to select between false and true, but when I load the script the simulator throws an error:
Mux(a=false, b=true, sel=out, out=ng);
Fails with 'In HDL file..., Line xx, Can't connect gate's output pin to part'.
So two questions I suppose... why is the above Mux line failing ? And is this the best way to 'forward' a bus bit to an output bit ?
"sel=out" is failing because "out" is a pin in the OUT declaration, which is not allowed to be used as an input, or it is an internal bus which is not allowed to be sub-bused.
Just like you can solder more than one wire to an output, HDL allows you to connect more than one wire/bus to an output. You can create multiple narrower sub-buses from an output just like additional single wire connections.