Page 1 of 1

Simple 3-combinator memory cell - handles bursts+negatives

Posted: Sun May 13, 2018 11:21 am
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 23103 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.

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

Posted: Mon May 14, 2018 1:13 pm
by Nitroxleecher
Thank you for sharing!
Just what I needed!

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

Posted: Tue Jan 29, 2019 9:38 am
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

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

Posted: Fri Jan 24, 2020 5:29 pm
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

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

Posted: Thu Mar 30, 2023 7:37 am
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.

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

Posted: Thu Mar 30, 2023 2:25 pm
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.