Absolutely nothing fancy here: the upper right stack memory unit holds on to the last four input values in order, and when a new value is read in, the first two are added to it to produce OUT.3
, the last two are added to produce OUT.5
, and then the most recent three stack values are replaced with the new one on top of them.
This appears to be the first puzzle that I used signal flags as an explicit synchronization mechanism for:
After initializing the stack with a bunch of zeroes, the upper left unit reads in an input value, sends it down, and then waits for a signal (MOV DOWN, NIL #SIG
) before it continues execution. That signal will be sent to it after the bottom right unit has finished resetting the stack with the oldest value removed, so it will then add the latest value to the top of the stack, setting everything up for the next input. There’s another signal sent from the bottom left unit to the bottom right unit to let it know when it’s safe to start reading from the stack.
This signaling technique is something I use a bunch in puzzles from this point on.