I saw that post about memory cells yesterday, which is great. It inspired me to think about some more logic elements with smart inserters/chests. Since we have the base elements, named signal, negation and something which reacts to it, it is possible to create basic logical gates.
First thing i came up is a NOR gate. If you put at least one of two items (A OR B), in the chest to the right, the output (Q) will change from 1 to 0. The other way around, if none of A and B is in the chest, the output is 1. Of course one single bit item (fish is usually good) has to be put into the gate's chest to keep it working.
The AND gate is derrived from the NOR gate by the following boolean formula: !( A or B ) = !A and !B
So i inverted the four inserters of the gate and negated the output. It turns 1 for the chest to the right holding both items, A AND B.
Of curse the gates are stackable and we can create things like: Only insert coal into the furnace, if there are no gears OR ammo AND more than 100 iron ore are avaiable. The two express belts could be replaced with fast inserters, which would make the gate a little faster. But it uses less energy this way and a nother electric pole would be needed.
Logic Gates 1 (Without Combinators!)
Logic Gates 1 (Without Combinators!)
Last edited by ssilk on Mon Sep 19, 2016 10:42 pm, edited 1 time in total.
Reason: changed topic to fit subject better
Reason: changed topic to fit subject better
Re: Logic Gates
Great work, fantastic!
Re: Logic Gates
I created another element: An edge detector.
If an item A is placed in the green box, the circuit in the center creates a single tick Q. If A is removed again, the detector resets, without generating a signal. A bit item has to be placed in the upper right wooden box. Note that the output has it's own "cable space".
The problem here was the inserter, which takes the bit item from the output box. The item is removed during the same tick as it is placed, without moving in to the container and no signal is generated. I made it reacting to the output signal, which ensured the item staying in the box for one tick.
I used a modified version of this device to create an item counter. The belt to the upper right transports iron ore, which is moved through a green box via two smart inserters. Both are configurated to store at maximum one item in the box for at least one tick. The signal is than transfered to the edge detector, which only reacts to the put-in-event. It triggers the smart inserter to the lower left, which moves as many items from the wooden to the yellow box, as were moving on the belt.
A second bit item has to be stored in the upper wooden box, to ensure every inserted iron ore is recognized.
If an item A is placed in the green box, the circuit in the center creates a single tick Q. If A is removed again, the detector resets, without generating a signal. A bit item has to be placed in the upper right wooden box. Note that the output has it's own "cable space".
The problem here was the inserter, which takes the bit item from the output box. The item is removed during the same tick as it is placed, without moving in to the container and no signal is generated. I made it reacting to the output signal, which ensured the item staying in the box for one tick.
I used a modified version of this device to create an item counter. The belt to the upper right transports iron ore, which is moved through a green box via two smart inserters. Both are configurated to store at maximum one item in the box for at least one tick. The signal is than transfered to the edge detector, which only reacts to the put-in-event. It triggers the smart inserter to the lower left, which moves as many items from the wooden to the yellow box, as were moving on the belt.
A second bit item has to be stored in the upper wooden box, to ensure every inserted iron ore is recognized.
Re: Logic Gates
Great designs! I like where this is going
YT Channel (Minecraft + Factorio): http://www.youtube.com/user/NiceMarkMC
Factorio Tutorial Playlist: http://www.youtube.com/playlist?list=PL ... XTtCXiJjdn
Factorio Tutorial Playlist: http://www.youtube.com/playlist?list=PL ... XTtCXiJjdn
Re: Logic Gates
Couldn't agree more! Soon we'll be playing factorio inside factorio!Mark wrote:Great designs! I like where this is going