Circuit Combinator Memory Cell (0.13)

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.
Post Reply
phi1010
Inserter
Inserter
Posts: 46
Joined: Sat Aug 20, 2016 3:31 pm
Contact:

Circuit Combinator Memory Cell (0.13)

Post by phi1010 »

Since the wiki does not provide a lot of information on memory, here two working examples only requiring the input data for one tick:

Single value cell: Saves a single value.

The left combinators provide input values from a belt generating testing data:
One data value D/Q of type Y, and an enabler bit E of type X (working like a D-Flipflop)

The central combinators are the memory cell:
  • ">": if input E X > 0, pass the Y input D to the output Q (set)
  • "=": if input E X = 0, pass the Y input Q to the output Q (hold)
  • D: Connects the red input and the input of the ">" combinator
  • Q: Connects the red ouput, the output of all combinators, and the input of the "=" combinaor
  • E: Connects the green input and the inputs of all combinators
2016-08-22 03_03_07-Factorio 0.13.17.png
2016-08-22 03_03_07-Factorio 0.13.17.png (280.94 KiB) Viewed 13139 times
Blueprint
Multi value cell: Saves any number of values, except the activation value.

This one is build almost identical, using the virtual type Everything instead of the Y type for all data values on the red wire, allowing you to save any value of any type except X.

Since the "Everything" virtual value will also pass on the "E" value, we need to add one more combinator:
  • ">": if input E X > 0, pass the Everything input D to the output Q (set)
  • "=": if input E X = 0, pass the Everything input Q to the output Q (hold)
  • "*": pass the input E X * -1 as output Q X (Eliminating the X value on Q as long as there is no X value on the D input; the red lamp in the image reacting X to stays off.)
  • D: Connects the red input and the input of the ">" combinator
  • Q: Connects the red ouput, the output of all combinators, and the input of the "=" combinaor
  • E: Connects the green input and the inputs of all combinators
2016-08-22 03_03_18-Factorio 0.13.17.png
2016-08-22 03_03_18-Factorio 0.13.17.png (376.82 KiB) Viewed 13139 times
Blueprint

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Circuit Combinator Memory Cell (0.13)

Post by XKnight »

Just want to add, that multi value cell you can also make with 2 combinators: viewtopic.php?p=94729#p94729
Probably it is possible to make single value cell with 1 combinator, but in this case such build will have bad timing (2 ticks I suppose).

phi1010
Inserter
Inserter
Posts: 46
Joined: Sat Aug 20, 2016 3:31 pm
Contact:

Re: Circuit Combinator Memory Cell (0.13)

Post by phi1010 »

XKnight wrote:Just want to add, that multi value cell you can also make with 2 combinators: viewtopic.php?p=94729#p94729
Looks interesting. I wasn't able to actually trick yours into storing the wrong value, even when providing data at 1-tick intervals. I hope i didn't do a mistake when copying it, if not:

One minor problem does your implementation still have, when looking at it in the strict sense: The output isn't exactly the input. ;) If i want to sum the output up at some point (Input Each*1, Output X) or use it in some other circuit module using the same trigger signal, I have to get a third and maybe fourth combinator to remove that trigger signal, so it isn't that much more efficient for everything that's not exclusively used as output to trigger some simple conditions without virtual signals. It's still cool for some cases where we don't have enough space.

When chaining two of your cells in a row (as a shift register), and fixing the second cell to "hold" any value inside it (sending trigger signal = 1 with a constant combinator), the output will jump between the actual value and twice as much. :P

EDIT: I actually had a mistake in my implementation, using 0/1 instead of 1/2 as you described in your inconsistent update. Fixed that, now it doesn't remember anything anymore.
Last edited by phi1010 on Mon Aug 22, 2016 10:04 pm, edited 1 time in total.

phi1010
Inserter
Inserter
Posts: 46
Joined: Sat Aug 20, 2016 3:31 pm
Contact:

Re: Circuit Combinator Memory Cell (0.13)

Post by phi1010 »

XKnight wrote:Probably it is possible to make single value cell with 1 combinator,


We could declare my ">" combinator or your "=" combinator as absurd input requirement instead as part of the memory cell, since it doesn't take part in the recursion itself, one could remove it after the memory has been set. It would cause most people to add -- at least -- one "helper" combinator to fulfil that requirement though. =D
XKnight wrote:but in this case such build will have bad timing (2 ticks I suppose).
I don't see how this could be possible. A memory cell will need some kind of recursion, to prevent the current value from vanishing. A recursion with only one wire section (you can only create one distinct wire network when connecting a combinator with itself; as long as factorio always adds green and red values) always takes its last output value as next input value; preventing any kind of oscillation or other behaviour that requires more than 1 tick to manifest.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: Circuit Combinator Memory Cell (0.13)

Post by siggboy »

Completely unrelated to this memory cell discussion, I welcome the fact that we have a possible new player in the game with phi1010, who cares enough about this arcane circlejerk of combinator design to spark a few interesting discussions.

Lately the majority of people seem to have become rather jaded.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

cid0rz
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Sun Jul 31, 2016 5:52 pm
Contact:

Re: Circuit Combinator Memory Cell (0.13)

Post by cid0rz »

I think with a single memory cell where you can store multiple data + proper filtering, you can achieve great things. So the numbers are saved as quantities of signals. I've developed one version of memory cell that I've shared here:
viewtopic.php?f=8&t=14584&p=203206#p203230

I'd appreciate feedback also from the people commenting here. So many interesting things still to discover in this game!

Post Reply

Return to “Combinator Creations”