Made a memorizer... accidentally

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Ikor
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Aug 01, 2026 5:02 pm
Contact:

Made a memorizer... accidentally

Post by Ikor »

I built a thing around memory cell I called memorizer. Maybe there was something similar before me, but couldn't find. The idea is when a certain signal disappears (became 0) it value persists in a memory cell. When it appears again it resets.



Turn on and off sending "X" signal and you will see it in action. Value is stored in top right combinator in "Y" signal.

The funniest part is that's actually what I wanted, but I couldn't understand how and why this works. Just some idea came up to me and when I finished I forgotten that idea. And now I'm looking at this thing and couldn't understand what kind of magic it is. There also was more dirty setup with additional wires and combinators which I then realized was useless, but if "Y" value passes additional decider before going to memory cell it doubles (so if "X" was 10 then "Y" will be 20). And I still couldn't understand it. Looks like it tied to an order in which game engine computes circuit network values.

So I will appreciate if someone could explain to me what I've made. :mrgreen:
Nidan
Filter Inserter
Filter Inserter
Posts: 380
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Made a memorizer... accidentally

Post by Nidan »

Ikor wrote: Sat Aug 01, 2026 5:29 pm Looks like it tied to an order in which game engine computes circuit network values.
The key part is hidden in there: The game works in "updates" or '"ticks" during which everything gets updated once. For circuits this means all combinators update simultaneously and other combinators will only see the resulting changes in the next tick.
The arithmetic renaming X to Y (X * 1, output Y) introduces a one tick delay on that path, so that the following arithmetic can see the last value of X at the same time as Z=1 indicating that X is now 0. Since we now know that we only need that once tick delay, we can condense this down to 2 combinators:

The bp contains 2 equivalent versions, the only function of the changed combinator is to introduce the delay and output nothing when there's no input for X.
Ikor
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Aug 01, 2026 5:02 pm
Contact:

Re: Made a memorizer... accidentally

Post by Ikor »

Thanks, it took some time but now I understand how it works.

I also made another version of memorizer which saves latest first value after 0, e.g. if "n" is a value at certain tick, then when condition "n != 0 and n-1 = 0" is met then "n" is saved.



It consists of delay combinator, a "value saver" and a memory cell. So value saver outputs "n" exactly when "n != 0 and n-1 = 0", while memory cell saves it only when opposite condition is met. It works because saver introduces 1 tick delay by itself, so memory cell clears previous value at the same time, but receives a new value 1 tick later.
Post Reply

Return to “Combinator Creations”