Simple 3-combinator memory cell - handles bursts+negatives

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.
SafwatHalaby
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu May 10, 2018 8:42 am
Contact:

Simple 3-combinator memory cell - handles bursts+negatives

Post by SafwatHalaby »

I wanted a simple memory cell which is capable of storing an arbitrary number.

The one I found at the Wiki has two problems: 1. it does not support negative values. 2. it fails when the input is a 1-tick long burst and starts to flicker wildly.

The following is an improvement which solves both problems.

Description:
  • The output M (memory) is the last non-zero input I (Input).
  • A non zero R (reset) signal sets the output to zero.
  • 1-tick bursts of R or I are handled properly.
  • Negatives are handled properly.
Blueprint:
blueprint
Image:
A 3-combinator memory cell capable of handling negatives and 1-tick bursts.
A 3-combinator memory cell capable of handling negatives and 1-tick bursts.
Memory_cell_with_negatives.png (451.98 KiB) Viewed 28965 times
Explanation:

During an input, combinator 1 resets combinator 3's memory. combinator 2 temporarily takes charge and handles the output as long as the input is held. Once the input is zeroed, the reset signal is zeroed as well and combinator 3 becomes again in charge of the output and combinator 2 deactivates. Here's a tick-by-tick explanation:

Tick 1:
Combinator 1 receives a non-zero input I.

Tick 2:
combinator 2 sends a reset signal.

Tick 3:
Combinator 3 resets and is now sending nothing.
Simultaneously, to prevent an output flicker, combinator 2 takes charge of the output and sends M.

Tick 10: (assuming input was held for 7 ticks)
Input I is now zero.

Tick 11:
Combinator 1 is now sending nothing, there is no longer a reset signal.

Tick 12:
Combinator 2 is now sending nothing.
Simultaneously, combinator 3 has now become active and is sending M from memory.

Reset explanation:

An R signal is sent to combinator 3, making it lose its memory.
Nitroxleecher
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu May 11, 2017 1:00 pm
Contact:

Re: Simple 3-combinator memory cell - handles bursts+negatives

Post by Nitroxleecher »

Thank you for sharing!
Just what I needed!
AlexAegis
Inserter
Inserter
Posts: 41
Joined: Sat Jun 04, 2016 10:25 pm
Contact:

Re: Simple 3-combinator memory cell - handles bursts+negatives

Post by AlexAegis »

Hi! I made an alternative version, same footprint, stores multiple things, but instead of a dedicated 'reset' signal it has a dedicated 'set' signal. (can set to nothing to reset). I credited your design everywhere where I posted it.

viewtopic.php?f=8&t=64649
Gecko
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Nov 29, 2014 8:52 pm
Contact:

Re: Simple 3-combinator memory cell - handles bursts+negatives

Post by Gecko »

The case I was using this for is the cell only accepting values that are bigger than the already saved value and forwarding the value. But never accepting values lower than the stored one. I tried some different approaches but never got a satisfying result. I think a (this) cell would be my best shot though I can't get it to work properly.

Any tips of hints would be greatly appreciated!

cheers, Gecko
Thomas Swole
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Mar 30, 2023 7:22 am
Contact:

Re: Simple 3-combinator memory cell - handles bursts+negatives

Post by Thomas Swole »

I don't understand

I imported the blue print Turned on both combinators for I and R and my memory output is R -1 M = -5
turning off the R combinator gives M=-5

As far as i can see this configation makes R And M eqaul to I.
And i dont see why any non zero R would make M reset.

Which it has not proven to do so with testing with timers or combinators.
Thier is a piece missing from the blue print or instuctions required to make this device reset.
Nidan
Filter Inserter
Filter Inserter
Posts: 274
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: Simple 3-combinator memory cell - handles bursts+negatives

Post by Nidan »

Providing a non-zero R resets the memory (combinator 3) to zero.
But you're providing I and R at the same time. Since setting and resetting are obviously conflicting commands, you now have to figure out which one takes priority. From reading the description you can see that setting internally also generates a reset signal, therefore setting has priority. In fact, providing non-zero R, makes it pass through whatever is currently provided on I.
Post Reply

Return to “Combinator Creations”