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.

