Combinator Incrementer/Decrementer

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Post Reply
BreadProduct
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 26, 2014 9:47 am
Contact:

Combinator Incrementer/Decrementer

Post by BreadProduct »

Image

Image

Right so short summary of what's going on is in this example:
The smart chest receives 1 iron. This triggers D to send a quick short pulse to F which increments itself by 1.
The smart chest loses 1 iron. This triggers C to send a quick short pulse that is negated by E in order to decrement F.

You can use this to do things such as keep track of how many items are being put on conveyor belts. There are other uses I am sure but this is the reason I bothered to figure this out. Hope it helps.


Anyways more complicated explanation of what's going on. Right so the arithmetic combinator only updates itself whenever a external value changes. Thus whenever it receives a new input which is fed into itself which only gets read once and thus doesn't cause a infinite loop. Allowing it to store a value inside of itself even if all inputs are removed. Input B doesn't get used at all.

So B and D are examining the value of G. Whenever G gets one additional iron, for a split second the comparison suddenly is true sending a value of 1 which gets mathed by F.

Hopes this helps.

mooklepticon
Fast Inserter
Fast Inserter
Posts: 237
Joined: Wed Mar 02, 2016 10:09 pm
Contact:

Re: Combinator Incrementer/Decrementer

Post by mooklepticon »

This could be used in a frequency counter. IE, iron belts per minute on a belt.

piriform
Fast Inserter
Fast Inserter
Posts: 117
Joined: Mon Jan 25, 2016 10:02 pm
Contact:

Re: Combinator Incrementer/Decrementer

Post by piriform »

Nice! Now see if you can do it with 3 combinators.

BreadProduct
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 26, 2014 9:47 am
Contact:

Re: Combinator Incrementer/Decrementer

Post by BreadProduct »

I concede how do I do it with 3 combinators?

piriform
Fast Inserter
Fast Inserter
Posts: 117
Joined: Mon Jan 25, 2016 10:02 pm
Contact:

Re: Combinator Incrementer/Decrementer

Post by piriform »

This is one solution.
incdec.jpg
incdec.jpg (13.04 KiB) Viewed 5445 times
How it works:
The two arithmetic combinators make a pulse generator or a one shot (as explained in Combinators 101). Incoming data gets passed by the combinator on the top and then 1 tick later gets negated by the one on the bottom. The effect is a single pulse having the value of difference between the old and new data.
The decider on the right is wired in a register (or latch) configuration that stores the data.
By itself this circuit is not that useful (as you could get the same answer by monitoring the chest directly :lol: ). However, if you wanted to accumulate the data (e.g. all additions or subtractions) you could insert a decider before the register to filter out the positive or negative pulses.
(i.e. each >0; each = count or each<0;each=count).

I was impressed by the originality of your solution, and hope this gives you some more ideas.

BreadProduct
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 26, 2014 9:47 am
Contact:

Re: Combinator Incrementer/Decrementer

Post by BreadProduct »

If it's just that I can do it with two. Receive a input and store it. I figured that out while I was wracking my head about what I thought your challenge was.

Image

piriform
Fast Inserter
Fast Inserter
Posts: 117
Joined: Mon Jan 25, 2016 10:02 pm
Contact:

Re: Combinator Incrementer/Decrementer

Post by piriform »

:lol:

BreadProduct
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Nov 26, 2014 9:47 am
Contact:

Re: Combinator Incrementer/Decrementer

Post by BreadProduct »

I sort of found a way to store data using just one combinator.

The catch is that the value provided is offset such that 4 becomes -5, 8 becomes -9 and so on.

Image

However it's actually being stored.

Anyways if you look closely both the green and red output is feeding back into it's own input. That and setting the addition constant to anything other than 0 ensures that it stores a value.

Post Reply

Return to “Show your Creations”