When I wire the register like in the picture it does not work. Are you sure that this is the working circuit?siggboy wrote:Here's a special purpose register that will accept any signal (or set of signal during the same tick), and then block any further writes until the "erase" signal is applied.
The erase signal is "Red" in the diagram, but could of course be changed if you actually need to store "Red" signals in your application.
The only other caveat is that you cannot store the value "-2^31", it's possible to change this if necessary; left as an exercise for the reader.
This register can handle 1-tick inputs, but it will also accept "hold" signals. It does not matter since all writes are blocked after the first tick of input. Just throw a signal at it and it will store it (forever/until reset).
I'm using this setup in my train scheduler, where I poll the outposts and need to accept one value (the first one that appears on the wire) and then process it -- so I want to block further writes to the register until the processing is finished. Other applications are surely possible.
You can put a 2-combinator circuit in front of it that generates an "erase" signal, and then you have a normal general purpose register that will accept any input, much like what piriform posted on the previous page on this thread, but without the caveats...
There must be a difference, as we can't setup a decier combinator to "each" when the input is not "each" like in your picture.