Logic Gates 1 (Without Combinators!)
Posted: Fri Mar 01, 2013 12:25 pm
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.
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.