<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Moon69</id>
	<title>Official Factorio Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Moon69"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Moon69"/>
	<updated>2026-04-22T23:46:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Combinator_tutorial&amp;diff=142787</id>
		<title>Tutorial:Combinator tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Combinator_tutorial&amp;diff=142787"/>
		<updated>2017-07-24T10:05:28Z</updated>

		<summary type="html">&lt;p&gt;Moon69: /* Set/Reset Latching Switch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Combinator logic is achieved by cross-connecting outputs to inputs in such a way to achieve the desired logic. While advanced logic requires a multitude of combinators, some very useful basic logic can be achieved using only a handful of combinators. &#039;&#039;&#039;Combinator logic works because Factorio only updates at 60 times per second, such that combinators analyze their logic in a step, and then sum and/or decide the resulting output values on the next step.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When logic values are computed by combinators, the outputs are not recognized by the circuit network until the following step. So when a decider combinator is used to detect a certain input condition, it&#039;s output value will not take effect on the circuit network until the next step. &#039;&#039;&#039;This behavior is important to remember and can result in sequencing errors and significant delays when multiple combinators are connected in series.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Circuit wires act like a wire bus in electronics, it carries information in the connected wires, meaning that &#039;&#039;&#039;if there are similar signals on a wire, it will add them automatically, unless if it is a different signal, that means it will be carried in that wire as well, but as a different signal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When cross-connecting combinators &#039;&#039;&#039;it&#039;s good practice to use the unused color to cross-connect, this will split the input and output networks and prevent unwanted inputs from accidentally connecting to a larger circuit network.&#039;&#039;&#039; Combinators will sum the red &amp;amp;/or green inputs prior to calculation, so either color can be used when wiring the output back to the input, but in most cases, it is more useful to use the opposing colour of the wire so that it will not interfere with the resulting output and input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;There is also an example heavy [[Circuit-network_Cookbook|circuit network cookbook]] that you may find helpful to learn and refer to about circuit networks.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Virtual Signals ==&lt;br /&gt;
&lt;br /&gt;
===Everything Wildcard:===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This Red Wildcard serves to check all the specifed input signals.&lt;br /&gt;
&lt;br /&gt;
As the Decider Combinator, &amp;lt;br /&amp;gt;&lt;br /&gt;
its input is used to serve if all inputs meets the specified signals or variables. &amp;lt;br /&amp;gt;&lt;br /&gt;
its output is used to serve output every signal. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Side note: &amp;quot;Everything&amp;quot; outputs true by default even if there is no signal to guarantee if that is true. &#039;&#039;Everything is false when every input does not meet the condition, otherwise, output true.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Anything Wildcard:===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This Green Wildcard serves to check all the specifed input signals.&lt;br /&gt;
&lt;br /&gt;
As the Decider Combinator, &lt;br /&gt;
its input is used to serve if any of its inputs meets the specified signals or variables.&lt;br /&gt;
&lt;br /&gt;
Side note: &amp;quot;Anything&amp;quot; outputs false by default if there is no signal to guarantee if it is true. &#039;&#039;Anything is false when any of inputs do not meet the condition, otherwise, it is true.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Each Wildcard:===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This Yellow Wildcard serves to check for each the specifed input signals.&lt;br /&gt;
&lt;br /&gt;
As the Decider Combinator, &amp;lt;br /&amp;gt;&lt;br /&gt;
its input is used to serve if any inputs meets the specified signals or variables. &amp;lt;br /&amp;gt;&lt;br /&gt;
its output is used to serve output the each variable. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the Arithmetic Combinator, &amp;lt;br /&amp;gt;&lt;br /&gt;
its input is used to serve each input, then the following summations are summed and outputted, with each signal as its own respective signals.&lt;br /&gt;
&lt;br /&gt;
== Input Isolator &amp;amp; Gate ==&lt;br /&gt;
An arithmetic combinator set to (In: Each + 0, Out: Each) can be used to swap wire colors and as an isolator to prevent downstream logic from backfeeding into the circuit network&#039;s inputs.&lt;br /&gt;
&lt;br /&gt;
A decider combinator set to (Out: Everything, Input-&amp;gt; Output) will also function as an isolator as long as the set logic condition is true. This can also selectively pass or &#039;gate&#039; inputs only when desired. This could be used to sequentially poll remote train stations for their chest contents, and include only desired stations.&lt;br /&gt;
&lt;br /&gt;
== Set/Reset Latching Switch ==&lt;br /&gt;
You want something to SET a trigger at some quantity, but then STAY on until that quantity hits some other value, the RESET value. You&#039;ll need one decider combinator and one arithmetic combinator. Two decider combinators and a constant combinator can also be used for more complex multi-channel conditions.&lt;br /&gt;
&lt;br /&gt;
Setup the first decider combinator to the desired set conditional and to output a 1. Then connect the output to the input of an arithmetic combinator, and configure it to multiply by the bias value, the difference between the set and reset values, and wire the arithmetic output to the input of the decider. The arithmetic output channel MUST be set the same as the decider&#039;s input channel. That&#039;s it! Whenever your set conditional is reached, the decider will output a &#039;1&#039;, and the bias of the arithmetic combinator will be applied. This will &#039;hold&#039; the output true until the value goes back below the reset point.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a more specific example : &lt;br /&gt;
i want the pump to run when petrol reach 2000, and turn off when reach 200.&amp;lt;br&amp;gt;&lt;br /&gt;
only with green wire&amp;lt;br&amp;gt;&lt;br /&gt;
Tank -&amp;gt; in decider&amp;lt;br&amp;gt;&lt;br /&gt;
out decider-&amp;gt; in arithmetic&amp;lt;br&amp;gt;&lt;br /&gt;
out arithmetic -&amp;gt; in decider&amp;lt;br&amp;gt;&lt;br /&gt;
green wire from in decider, to pump&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pump have the same condition as the decider (Petrol &amp;gt; 2000)&lt;br /&gt;
&lt;br /&gt;
Decider : Petrol &amp;gt; 2000&amp;lt;br&amp;gt;&lt;br /&gt;
out : A = 1&amp;lt;br&amp;gt;&lt;br /&gt;
Arithmetic : A x 1800 (2000 - 200 )&amp;lt;br&amp;gt;&lt;br /&gt;
out : petrol&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Factorio combinator switch.png|620px]]&lt;br /&gt;
&lt;br /&gt;
Backup steam power example with detailed configuration and explanation can be found here:&amp;lt;br /&amp;gt;[[Tutorial:Circuit-network_Cookbook#SR_latch_-_single_decider_version|Tutorial:Circuit-network_Cookbook#SR latch - single decider version]]&lt;br /&gt;
&lt;br /&gt;
== Comparing Outputs ==&lt;br /&gt;
&lt;br /&gt;
== Addressing Outposts ==&lt;br /&gt;
&lt;br /&gt;
== Smart Train Loading ==&lt;br /&gt;
&lt;br /&gt;
Initially designed by [https://www.youtube.com/user/Darkphade MadZuri],&lt;br /&gt;
&lt;br /&gt;
This solves the problem of loading logistics into chests, which tend to be unequal and is slower in the rate of loading logistics into the cargo of trains.&lt;br /&gt;
&lt;br /&gt;
To setup the design, you require an Arithmetic Combinator, as well as Red and Green wires. &#039;&#039;&#039;Wire all the chests used, to the input of the Arithmetic Combinator&#039;&#039;&#039;. &#039;&#039;&#039;Then write (Logistics Item / -Amount of chests) and as the output as the Logistics Item in the Arithmetic Combinator&#039;&#039;&#039;, this will average the amount of items within the chests. Lastly, &#039;&#039;&#039;wire all the inserters used to the output of the Arithmetic Combinator and have the other color of the wire be wired to the adjacent chest&#039;&#039;&#039;. &#039;&#039;&#039;Have the inserters enabled when Logistics Item &amp;lt; 1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A more visual representation as well as questions for the design can be found [https://www.reddit.com/r/factorio/comments/4e03g2/madzuris_smart_loading_train_station_guide/ here].&lt;br /&gt;
&lt;br /&gt;
Explanation of why this works:&lt;br /&gt;
It compares the average amount of total items within the chests and the chest adjacent to the inserter so that it activates when the average number of items is higher than the amount within the chest.&lt;br /&gt;
The reason for why the division denominator is negative is because if the items in the chests are 0, it basically makes it so that it adds 1 to the equation.&lt;br /&gt;
&lt;br /&gt;
== Oil Control ==&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
How to store a constant value for later use, either for a basic counter or for more advanced logic. A decider combinator wired output tied to input and configured greater than zero (for positive values), input -&amp;gt; output will &#039;hold&#039; a value, as long as all other inputs on the network are zero.&lt;br /&gt;
&lt;br /&gt;
Any non-zero input condition will create a basic clock; incrementing the stored value by the sum of all connected input values every cycle. A single pulse of an input will cause a single increment by the pulsed value. Reset to zero occurs whenever the set condition is no longer met, or if a negative pulse equal to the input occurs.&lt;br /&gt;
&lt;br /&gt;
== Basic Clocks ==&lt;br /&gt;
[[File:Timer.png|thumb|right|377px|A basic clock. 30 ticks is the ceiling for Signal 1; which is continuously added.]]&lt;br /&gt;
Clocks are constructed by having the output of a combinator tied back to its own input, such that every cycle advances its own count. Either the arithmetic combinator or the decider combinator can be used.&lt;br /&gt;
&lt;br /&gt;
An arithmetic combinator tied to itself is fun to watch and will happily run-away, but requires additional control logic to reset.&lt;br /&gt;
&lt;br /&gt;
A self-resetting clock requires just a single decider combinator with output wired to input and configured with Less Than (&amp;lt;) and Input -&amp;gt; Output. When a constant combinator is then connected to the input, every cycle it will count up by the value of the Constant Combinator until the set conditional value is reached, then output a zero which will be summed with the constant combinator, and reset the process.&lt;br /&gt;
&lt;br /&gt;
The clock sequence will not include zero, will begin at the value set by the constant combinator, and will include whatever value eventually causes the conditional to be false. An arithmetic combinator can modify the clock sequence but remember its outputs will occur one cycle later than the clock cycle values.&lt;br /&gt;
&lt;br /&gt;
A clock that only counts once can be built using the following setup:&lt;br /&gt;
&lt;br /&gt;
[[File:Onetime_Clock.png|thumb|none|360px|One-time clock. Runs until T=Z+1. Reset via R&amp;gt;0.]]&lt;br /&gt;
&lt;br /&gt;
== Pulse Generators ==&lt;br /&gt;
&lt;br /&gt;
Connecting an additional (=) decider combinator to the output of a basic clock will create a pulse generator, and will pulse a single output every time the clock cycles through the set condition. Any output value can be used, either directly from the clock sequence (input-&amp;gt;output), a 1, or some value on a separate logic channel on the circuit network, such as set by a constant combinator. or by the circuit network.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:PulseGen.png|500px]]&lt;br /&gt;
*&#039;&#039;The value 1 can be written as any positive integer, so long as it is within the cap or ceiling of your timer.&#039;&#039;&lt;br /&gt;
*&#039;&#039;As an example from the above timer, this light will pulse every 1st tick after the timer reaches 30 ticks, making it pulse 1/30th of a second, as Factorio updates at 60 times per second.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Counter ==&lt;br /&gt;
A counter is used to count the number of input events, and output the sum of that count. Any pulsing input into a decider combinator configured input -&amp;gt; output and wired between output and input will create a counter, but this input must be zero at all other times or else the combinator will run away like a clock. A pulse generator is normally used to accomplish this. Combining several gating decider isolators set with sequential conditionals, a clock, and a pulse generator to the input of a counter will allow remote polling and counting of each isolator&#039;s contents.&lt;br /&gt;
&lt;br /&gt;
== Logic Gates ==&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Unary NOT&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:NOT.png|415px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary OR&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:OR.png|300px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;*Deprecated: Use the Arithmetic Combinator&#039;s OR option instead.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary NOR&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:NOR.png|415px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary XOR&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:XOR.png|300px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 1!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||  0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 ||  1 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  0 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 ||  1 || 0&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;*Deprecated: Use the Arithmetic Combinator&#039;s XOR option instead.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary AND&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:AND.png|530px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;*Deprecated: Use the Arithmetic Combinator&#039;s AND option instead.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Trinary AND&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:TrinaryAND.png|415px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Input 3!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 1  || 1&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary NAND&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:NAND.png|300px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary XNOR/XAND&#039;&#039;&#039;===&lt;br /&gt;
----&lt;br /&gt;
[[File:XAND.png|300px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Input 1!!Input 2!!Output&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0  || 1&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0  || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1  || 1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Memory Cells ==&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Simple Latch&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
When looping the combinator to itself, use a different colour of wire from your main inputs or outputs. &lt;br /&gt;
&lt;br /&gt;
[[File:SimpleLatchv2.png|300px]]&lt;br /&gt;
&lt;br /&gt;
Truth Table:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Output 1!!Input 1!!Input 2!! Output 1 (t+1)&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || 0 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 1 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1 || 1 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 0 || 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 0 || 1 &#039;&#039;(2)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0 || 1 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1 || 1 || 1 &#039;&#039;(2)&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|} &lt;br /&gt;
&#039;&#039;Output 1 is the green wire loop seen in the picture, it carries the value to latch.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Input 1 is Set, while Input 2 is Reset.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Binary Cell&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
RS NOR Latch&lt;br /&gt;
[[File:RS-NOR.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Advanced Cell&#039;&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
Cell for storing a positive value:&lt;br /&gt;
&lt;br /&gt;
[[File:AdvancedMemoryCell.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Connect the desired value as signal 3 on the right side to set the memory cell and connect a negative value as signal 3 to reset the cell.  *Please note the arithmetic combinator&#039;s output should be facing the opposite direction of the decider combinators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Address Enable Switch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
*[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=14556 Combinators 101 (Tutorial)]&lt;br /&gt;
*[[Arithmetic combinator]]&lt;br /&gt;
*[[Constant Combinator]]&lt;br /&gt;
*[[Decider Combinator]]&lt;br /&gt;
*[[Circuit network]]&lt;br /&gt;
*[[Circuit-network_Cookbook]]&lt;br /&gt;
[[Category:Tutorial]]&lt;br /&gt;
[[Category:English page]]&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=142786</id>
		<title>Tutorial:Circuit network cookbook</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Circuit_network_cookbook&amp;diff=142786"/>
		<updated>2017-07-24T09:53:32Z</updated>

		<summary type="html">&lt;p&gt;Moon69: Add detailed example of single decider SR latch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Foreword == &lt;br /&gt;
&lt;br /&gt;
This page provides examples of simple circuit network designs and some not so simple designs that others can use, combine and modify. They are designed to be as easy to understand as possible.  To see the settings of combinators without opening them, the option &amp;quot;Show combinator settings when detailed info is on&amp;quot; in the graphics options has to be checked and detailed info has to be turned on.&lt;br /&gt;
&lt;br /&gt;
==Lamp showing chest content condition==&lt;br /&gt;
[[File:LightWiredToChest.png|right|218 × 412px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the simplest possible use of circuit-network. A lamp is light depending on the number of goods (in this example  empty barrels) in a chest.&lt;br /&gt;
&lt;br /&gt;
===Setting up circuit connection===&lt;br /&gt;
* The lamp is connected to the chest&lt;br /&gt;
* the lamp is set to light if the chest contain less than 10 empty barrels.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LamponBarrelCondition.png|right|400x400px]]&lt;br /&gt;
===To set the light condition===&lt;br /&gt;
# open the lamp (right click on it)&lt;br /&gt;
# Set the input to barrels&lt;br /&gt;
# Set the operator to &amp;lt; (las than)&lt;br /&gt;
# Set the constant number:&lt;br /&gt;
## Right lick on the constant number&lt;br /&gt;
## Draw the slide until 10 is shown, or edit the value box directly&lt;br /&gt;
## Press set&lt;br /&gt;
&lt;br /&gt;
Depending on the condition you set you may light the lamp if the barrel is empty, or contain a decent number of articles.&lt;br /&gt;
&lt;br /&gt;
The draw back with this scenario is that the lamp have a white light , and is therefore difficult to differ from ordinary lamp at night.&lt;br /&gt;
&lt;br /&gt;
== Oil Setups ==&lt;br /&gt;
[[File:LgtOilCracking.png|left|400x400px]]&lt;br /&gt;
=== Light Oil Cracking ===&lt;br /&gt;
* This circuit provides balanced light oil and petroleum gas production by cracking excess light oil into gas. &lt;br /&gt;
* The [[Small pump]] is connected to the [[Storage tank]] by a [[Red wire]]. &lt;br /&gt;
* The [[small pump]] has an enabled condition set to &#039;&#039;&#039;Light Oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:HvyOilCracking.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Heavy Oil Cracking ===&lt;br /&gt;
* This circuit extends on the previous circuit by adding optional heavy oil cracking to provide lubricant etc.&lt;br /&gt;
* The [[Small pump]] has an enabled condition set to &#039;&#039;&#039;Heavy oil &amp;gt; 2000&#039;&#039;&#039;.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[file:BalancedPlasticSulfur.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Petroleum split evenly between plastic and sulphuric acid ===&lt;br /&gt;
* This circuit buffers gas in the tank until there is at least 100, then it lets the tank drain until there is less than 50 and the cycle repeats.&lt;br /&gt;
* It has a few elements that work together to do achieve this. &lt;br /&gt;
* Firstly the [[Small pump]] is connected to the [[Wooden chest]] by a [[Red wire]] and the enabled condition on the [[Small pump]] is set to &#039;&#039;&#039;Raw wood &amp;gt; 0&#039;&#039;&#039;.&lt;br /&gt;
* Both of the [[Basic inserter]]s are connected to the [[Storage tank]] by [[Red wire]]s. &lt;br /&gt;
* The enabled condition on the left inserter is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039; &lt;br /&gt;
* The enabled condition on the right inserter is &#039;&#039;&#039;Petroleum gas &amp;lt; 50&#039;&#039;&#039;. &lt;br /&gt;
* You will need to insert a single &amp;quot;Raw wood&amp;quot; into the chest to make it all work. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is also possible to do this with [[decider combinator]]s instead of the inserters, belt and the Wood chest or even just belts.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Lights ==&lt;br /&gt;
[[File:ConditionalLights.png|left|400x400px]]&lt;br /&gt;
=== Conditional Lights ===&lt;br /&gt;
* In this circuit we connect a series of [[lamp]]s to a [[Storage Tank]].&lt;br /&gt;
* By setting different conditions on each [[lamp]] we can build an indicator strip. &lt;br /&gt;
* The Enabled condition of the first [[lamp]] is &#039;&#039;&#039;Petroleum gas &amp;gt; 100&#039;&#039;&#039;.&lt;br /&gt;
* The others light up when gas is greater than 200, 300, 400 and 500 respectively.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
In this scenario you can connect the storage tank to the lamps directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ColoredLights.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Colored Lights ===&lt;br /&gt;
* To light a [[lamp]] with a color rather than white, you need an intermediate device like an [[Arithmetic combinator]] that can send a color signal.  &lt;br /&gt;
Instead of directly connect  the the [[Lamp]] and the [[Storage tank]] you need:&amp;lt;BR&amp;gt;&lt;br /&gt;
1 Add the [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
2 Connect the [[Storage tank]] with the input of the  [[Arithmetic combinator]].&amp;lt;BR&amp;gt;&lt;br /&gt;
3 Connect the  output of the [[Arithmetic combinator]] with the [[lamp]].&amp;lt;BR&amp;gt;&lt;br /&gt;
4 Set up the [[Arithmetic combinator]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
4.1 Setting the input to Petroleum Gas + 0 (the constant 0 not the signal 0)&amp;lt;BR&amp;gt;&lt;br /&gt;
4.2 Set the output to the Pink signal (on the bottom row of the last tab of signals.)&amp;lt;BR&amp;gt;&lt;br /&gt;
5 Set up the [[lamp]]:&amp;lt;BR&amp;gt;&lt;br /&gt;
5.1  Select the &amp;quot;Use colors&amp;quot; check box on the lamp.&amp;lt;BR&amp;gt;&lt;br /&gt;
5.2 Set the condition to the Pink signal, and what value you want (i.e. &amp;gt; 100)&amp;lt;BR&amp;gt;&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
[[file:MulitipleChestsAndPoles.png|left|400x400px]]&lt;br /&gt;
=== Multiple Storages === &lt;br /&gt;
* If you connect multiple chests to a pole, the pole displays the sum of items in all the chests. &lt;br /&gt;
* This also works with [[Storage tank]]s and [[roboport]]s.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ConstantComb.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator ===&lt;br /&gt;
* With a [[constant combinator]] you can generate any signals you may need. &lt;br /&gt;
* In this example we have generated a signal of 50 Laser turrets and 200 Piercing round magazine. &lt;br /&gt;
* Constant combinators are not of much use on their own but we shall use them later.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:LogicGates.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Logic gates ===&lt;br /&gt;
* In each case the two inputs can be connected with the same color wire or different colors. The inputs are powered by two [[Constant combinator]]s each of them output an A signal with value 1 for true and nothing or false.&lt;br /&gt;
* You can use [[Decider combinator]]s to make all of the common logic gates.&lt;br /&gt;
* The output for each should be set to 1 and the signal of your choice.&lt;br /&gt;
* Use the following settings to create different gates:&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
    NOT  A=0&lt;br /&gt;
    NOR  A=0&lt;br /&gt;
    NAND A&amp;lt;2&lt;br /&gt;
    XOR  A=1&lt;br /&gt;
    AND  A=2&lt;br /&gt;
    OR   A&amp;gt;0&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:ThisASign.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Constant combinator signs ===&lt;br /&gt;
* You can use [[Constant combinator]]s to make signs, just set the letter signals in the combinator, each combinator can display 2 characters side by side.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MemoryCell.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Memory Cell / Counter ===&lt;br /&gt;
* Basic memory cell that counts all the items moved by the inserter&lt;br /&gt;
* The [[Fast inserter]] is connected to &#039;&#039;&#039;BOTH&#039;&#039;&#039; ends of the arithmetic combinator.&lt;br /&gt;
&lt;br /&gt;
* If the [[Fast inserter]] hasn&#039;t picked anything up this tick the input to the Arithmetic combinator is the same as and output and hence the values are persisted. &lt;br /&gt;
* When the [[Fast inserter]] does pick something up its value is added to the output from the previous tick thus incrementing that item. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:BeltCache.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Automatic Belt-Cache ===&lt;br /&gt;
* Some intermediate products are huge in demand during peak-production only. To bypass the need of providing a huge amount of factories in order to cover that peaks, a cache-unit can be used. The unit stores items, while the belt has backed up (so theres obviously no current demand downstream) and releases items as soon as the belt gets too empty.&lt;br /&gt;
* The blue area are 3 parts of Express belts. According to the wiki, each belt can hold up to 7.11 items. This means the feeding fast belt can not provide 7.11 items for the express belts as long as the belt is moving. (And while the belt is moving, we don&#039;t want to cache items, but let regular production run, or even release items from the cache.)&lt;br /&gt;
* This means, once the counters on the two express belts are 7.11 each, the belt has backed up, so we can start &amp;quot;caching&amp;quot; items into our storage array. &lt;br /&gt;
* For this purpose, the counters are connected to the arithmetic combinator (A) which multiples the input (*100) into green signals. So, if the belt has backed up, B shows &amp;quot;&amp;gt;1422&amp;quot; green signals.&lt;br /&gt;
* This is the activation condition for the Belt (C), which will redirect the input tp the storage array.&lt;br /&gt;
* Since items should only be released if the belt starts to clear, the counter (D) is evaluated by the belt (E) which is only activated, if item-count on (D) is smaller than 6 (this number has to be adjusted to personal needs, when the cache should become &amp;quot;active&amp;quot; and release items)&lt;br /&gt;
* The layout can be extended to cache whatever amount of items is required. (Some balancing for the release-method would be required ofc.)&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:combinatorMultiplierDetailed.png|left|400x400px]]&lt;br /&gt;
=== Multiplier and Dictionaries/Arrays ===&lt;br /&gt;
* Multiplying two signals together is simple and requires only a single combinator, however multiplying a set of signals is more complicated.&lt;br /&gt;
* A proof is shown below for the equation and why it works.&lt;br /&gt;
* A dictionary is a system that allows a value on a specific signal to be accessed. For example, A can contain many signals (either from a constant combinator or memory cell) and B can contain 1 of a specific signal (such as blue signal). What remains is the blue-signal value from A. This is because all the other signals are multiplied by 0.&lt;br /&gt;
* Arrays are similar to dictionaries, but instead of using a signal as a key, we use a number. Constant combinators are placed mapping each signal to a unique number (such as 1 yellow belt, 2 red belt, 3 blue belt, 4 burner inserter, etc). Then, use a combinator of &amp;quot;each = index OUTPUT 1 of each&amp;quot; and plug that in as the input to a dictionary.&lt;br /&gt;
[[File:combinatorMultiplierMath.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
    ((A+B)^2 - (A-B)^2)/4 = AB&lt;br /&gt;
    (A+B)^2 - (A-B)^2 = 4AB&lt;br /&gt;
    (A^2 + 2AB + B^2) - (A^2 - 2AB + B^2) = 4AB&lt;br /&gt;
    4AB = 4AB&lt;br /&gt;
&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Inserters ==&lt;br /&gt;
[[File:LimitItemsPlacedIntoAChest.png|left|400x400px]]&lt;br /&gt;
=== Limit items placed into a chest ===&lt;br /&gt;
*  The [[Basic inserter]] is connected to the [[Wooden chest]] using a [[Red wire]]. &lt;br /&gt;
*  The inserter&#039;s enabled condition is &#039;&#039;&#039;Advanced Circuit &amp;lt; 10&#039;&#039;&#039;. &lt;br /&gt;
*  In reality this means the inserter may place more than 10 Advanced circuits in the chest because it could pick up-to 3 at once. &lt;br /&gt;
*  This effect can be even greater with Stack inserters because of their large carrying capacity. &lt;br /&gt;
*  This technique still gives far greater control than limiting the inventory on the chest.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SmartOutpostUnloader.png|left|400x400px]]&lt;br /&gt;
=== Keeping outpost stocked with specified items ===&lt;br /&gt;
*  This circuit keeps a [[Storage chest]] at an outpost stocked with customized levels of different items. &lt;br /&gt;
*  For example you could keep an outpost stocked with 50 laser turrets and 200 piercing magazine rounds but not have to worry about it being over filled. &lt;br /&gt;
*  The [[storage chest]] is attached to the input of the [[Arithmetic combinator]] (left side in the picture) with a [[Red wire]]. &lt;br /&gt;
*  Another couple of [[Red wire]]s join the output of the [[Arithmetic combinator]] (right side) to the [[constant combinator]] and to the [[stack filter inserter]]. &lt;br /&gt;
*  The [[Arithmetic combinator]] &#039;&#039;&#039;multiples&#039;&#039;&#039; each input value (from the storage chest) by &#039;&#039;&#039;-1&#039;&#039;&#039;. &lt;br /&gt;
*  Finally the filter stack inserter&#039;s mode of operation is set to &#039;&#039;&#039;Set filters&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*  So the input to the [[stack filter inserter]] is &#039;&#039;&#039;&amp;lt;Constant combinator&amp;gt; - &amp;lt;Storage chest contents&amp;gt;&#039;&#039;&#039; and the filter is set to filter the item of greatest demand.   &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SolarAccumalatorBalancer.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Balanced Solar panel / Accumulator Production ===&lt;br /&gt;
* This circuit balances production of [[Solar panel]]s and [[Accumulator]]s to a desired ratio in my case 24:20.&lt;br /&gt;
* The first [[Arithmetic combinator]] takes the number of accumulators in the chest and &#039;&#039;&#039;multiples&#039;&#039;&#039; it by &#039;&#039;&#039;24&#039;&#039;&#039;. &lt;br /&gt;
* The second [[Arithmetic combinator]] takes the output of the first combinator and &#039;&#039;&#039;divides&#039;&#039;&#039; it by &#039;&#039;&#039;20&#039;&#039;&#039;. &lt;br /&gt;
* This gives us the number of accumulators that we can directly compare to the number of Solar panels in both inserters. &lt;br /&gt;
* If the number of accumulators is greater we enable the Solar panels inserter, if the number of Solar panels is greater we enable the accumulators inserter. &lt;br /&gt;
* However, if they are equal, neither machine does anything. So we add a single accumulator to one of the inserters using a constant combinator and a wire of the other color, therefore breaking the deadlock.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Sushi Belts ==&lt;br /&gt;
[[File:SushiScience1.png|left|400x400px]]&lt;br /&gt;
=== Reading Belt Design ===&lt;br /&gt;
* Six belts in a row are connected with Red wire and set to &#039;&#039;&#039;Read belts contents&#039;&#039;&#039; and &#039;&#039;&#039;Hold&#039;&#039;&#039; &lt;br /&gt;
* This [[Red wire]] is then connected to the inserters that insert onto the belt. &lt;br /&gt;
* Read hand contents is unselected for all inserters.&lt;br /&gt;
* Mode of operation is set to &#039;&#039;&#039;Enable/Disable&#039;&#039;&#039; on all inserters. &lt;br /&gt;
* The first inserter is enabled when &#039;&#039;&#039;Science pack 1 = 0&#039;&#039;&#039;&lt;br /&gt;
* The other inserters are set similarly for the other science packs. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SushiScience2.png|left]|400x400px]]&lt;br /&gt;
=== Memory Cell Design ===&lt;br /&gt;
* This circuit counts the number of items of each type on a looping belt by counting the numbers that are added and removed from the belt by inserters.&lt;br /&gt;
* Each inserter that takes items off the belt is connected together with Red wire and each of these inserters is set to &#039;&#039;&#039;Mode of operation none, Read hand content selected&#039;&#039;&#039; and &#039;&#039;&#039;Hand read mode pulse&#039;&#039;&#039;. &lt;br /&gt;
* These inserters are connected to the input of the left arithmetic combinator. &lt;br /&gt;
* The left [[Arithmetic combinator]] multiples &#039;&#039;&#039;each&#039;&#039;&#039; input by &#039;&#039;&#039;-1&#039;&#039;&#039; and outputs it to &#039;&#039;&#039;each&#039;&#039;&#039;. &lt;br /&gt;
* The right [[Arithmetic combinator]] is a &#039;&#039;&#039;memory cell&#039;&#039;&#039; as above.&lt;br /&gt;
* The memory cell&#039;s input is connected to the inserters that are placing items on the belt and the output of the left [[Arithmetic combinator]]. &lt;br /&gt;
* The inserters that place items onto the belt have an enabled condition that is based on the number of items on the belt.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Splitters ==&lt;br /&gt;
[[file:CondSplitter.png|left|400x400px]]&lt;br /&gt;
=== Conditional splitter ===&lt;br /&gt;
* This is the most simple circuit you can have for &amp;quot;controlling&amp;quot; a splitter.&lt;br /&gt;
* A signal X=1 is transmitted from off screen when the items need to be sent down the belt.&lt;br /&gt;
* The belt on the left is enabled when X=1.&lt;br /&gt;
* The belt on the right is enabled when X=0.&lt;br /&gt;
* The two belts are wired together and to a pole. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:PrioritySplitter.png|left|400x400px]]&lt;br /&gt;
=== Priority Splitter ===&lt;br /&gt;
* This circuit prioritizes items to the belt going of the screen to the left but will send items straight on if the belt to the left is backed up.&lt;br /&gt;
* Its not perfect and will leak some items but its good enough for most applications. &lt;br /&gt;
* The balancer means it will work even if the supply or demand is uneven. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
* It is critical that the belts are setup as in this picture otherwise it may not work. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Power ==&lt;br /&gt;
[[File:SteamBackup.png|left|400x400px]]&lt;br /&gt;
=== Backup steam power ===&lt;br /&gt;
* The [[steam engine]]s are not directly connected to the power network. They are connected to the power network through a [[Power switch]]. &lt;br /&gt;
* The [[power switch]] is connected to one of the [[accumulator]]s in the main network. &lt;br /&gt;
* The [[power switch]] turns on when A &amp;lt; 10. That is when the [[accumulator]]s are less than 10% full.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Latches ==&lt;br /&gt;
=== SR latch - single decider version ===&lt;br /&gt;
[https://forums.factorio.com/viewtopic.php?f=193&amp;amp;t=14556 This discussion] on the Factorio forums starts with the common 2 decider RS latch version, but the thread goes on to explain why this single decider version is better.&lt;br /&gt;
==== Backup steam example ====&lt;br /&gt;
This example will turn on the steam generator when the Accumulator charge drops to 20%, but will &amp;quot;latch&amp;quot; (remember) the On state until the accumulator is charged to 90%.&lt;br /&gt;
&lt;br /&gt;
Latching is used to avoid Hysteresis where the power switch rapidly cycles on and off (as the accumulator falls to 19%, charges to 20%, falls to 19% and so on).&lt;br /&gt;
[[File:SR-01-Layout.png|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:50em;&amp;quot;&amp;gt;&lt;br /&gt;
Blueprint string for above backup steam example&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&amp;lt;pre style=&amp;quot;white-space: pre-wrap; &lt;br /&gt;
 white-space: -moz-pre-wrap; &lt;br /&gt;
 white-space: -pre-wrap; &lt;br /&gt;
 white-space: -o-pre-wrap; &lt;br /&gt;
 word-wrap: break-word;&amp;quot;&amp;gt;&lt;br /&gt;
0eNrFVk1vozAQ/SuVz1ABCaRBq5WqXntKjqsKOTBJR8IGGTtpFPHfd+w0HyU0G6pVewkxnnmemfdmzI4tSgO1QqlZumOYV7Jh6Z8da3AleWnf6W0NLGVrVNrQG49JLuyLvYU/Z63HUBbwxtKw9QZ4zs48o15P1CBObgXkWIDy80osUHJdqTOAUfviMZAaNcI+A7fYZtKIBSiK7YgjoEAjfCgh1wpzv65KoFPqqiHnStrzCdAPA49t6Rm1NrYOWjQY7QrY6FQZwcvyX1jJFajxEYrnuRGmdGW6DCe+jx1KcB9TDYl1raoyW8ArXyM5kFVldG10djObj6zdI0kKHp2Mdiy0PysFIM8pwYKldHyOKjeo3TI8y8Wup93tl7Yv3fiaOC6zjt6z9uk4VqDaR+rY7CvBO2ZGewUec1qiaobVxaE3mtseiwK7EjVXLsaU/SKPobWe7zHrLYVmpM6WqhIZSsJg6ZKXDQyiYkzF9Vhk9xUU3d3kNiaSQUwEB/l9Hw+uZg1YjGzYiPpA1+/vpKuHjk7fRNf7JrJTsZf05MLwoIFbzLvtOvlEFZNjKepqQ5poNqjz10s9jA6N+fk8Ohx/FMFXNXDqxeCC20F901vCJxN07UjVG9K4+x9YQp5M2LUZfbTpq+XDKRsNnG4cuULZcz089HZWD+D0a8Pz52bnNPgPzTj76dlJAnDfNenZp5fHSr4ACp/NZ3fPnHrkDt64qN31vwbVuFIn43GUjCdxHIVt+xcL2lBp&amp;lt;/pre&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-02-Accumulator.png|left]]Accumulator outputs the current charge level as % on signal [[File:Signal-A.png]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-03-RangeDeciders.png|left]]First decider outputs &amp;quot;Set&amp;quot; ([[File:Signal-S.png]] = 1) if Accumulator is less than 20%.&lt;br /&gt;
Second decider outputs &amp;quot;Reset&amp;quot; ([[File:Signal-R.png]] = 1) once Accumulator is more than 90% full.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-04-SRLatch.png|left]]&lt;br /&gt;
==== SR Latch configuration ====&lt;br /&gt;
&#039;&#039;&#039;The central decider and green feedback wire is the actual SR Latch.&#039;&#039;&#039;&lt;br /&gt;
It latches the Set signal [[File:Signal-S.png]] until the Reset signal [[File:Signal-R.png]] is received (and vice-versa).&amp;lt;br /&amp;gt;&lt;br /&gt;
NB: the latch expects binary inputs ([[File:Signal-S.png]] &amp;amp; [[File:Signal-R.png]] must be 0 or 1) - this is why the previous two deciders are required.&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
[[File:SR-05-PowerSwitch.png|left]]The Power switch isolates the generator from the rest of the factory until [[File:Signal-S.png]] = 1&lt;br /&gt;
&amp;lt;br clear=all&amp;gt; &lt;br /&gt;
----&lt;br /&gt;
=== SR latch ===&lt;br /&gt;
[[File:SRLatch.png|left|400x400px]]&lt;br /&gt;
* This should be familiar to anyone with any background in electronics. &lt;br /&gt;
* The signal is set and reset with the [[constant combinator]]s on the left by setting an A=1 signal. &lt;br /&gt;
* The latch &amp;quot;remembers&amp;quot; which one was last set and the light stays on until another signal is received.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:SRlatchinaction.png|left|400x400px]]&lt;br /&gt;
=== Usage of SR latch ===&lt;br /&gt;
* Here is an example of how you could use an SR latch.&lt;br /&gt;
* The two extra [[Decider combinator]]s provide the set and reset conditions. &lt;br /&gt;
* Petroleum gas &amp;lt; 50 and petroleum gas &amp;gt; 100. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BeltLatch.png|left|400x400px]]&lt;br /&gt;
=== Belt only latch ===&lt;br /&gt;
* This is the most compact latch I am aware of. &lt;br /&gt;
* To make it work you need to place &#039;&#039;&#039;3&#039;&#039;&#039; raw wood on the inside lane of the belt.&lt;br /&gt;
* I believe it will have higher latency than the combinator version but in most situations you will not notice the difference. &lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Displays ==&lt;br /&gt;
[[File:5digitDisplay.png|left|400x400px]]&lt;br /&gt;
=== Numerical Display ===&lt;br /&gt;
* Each digit is driven by its own [[Green wire]], that wire holds 15 signals one for each lamp used in the digit.&lt;br /&gt;
* [[Constant combinator]]s are used to define which lamp should light up for each value. &lt;br /&gt;
* Blueprint string including decoder [https://www.dropbox.com/s/5o13xuwthalzzfe/Brain2.txt?dl=0]&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:BWDisplay.png|left|400x400px]]&lt;br /&gt;
&lt;br /&gt;
=== Black and White Grid Display ===&lt;br /&gt;
* Each row has its own [[Red wire]] connection and within that row each light has a numbered signal 0-9.&lt;br /&gt;
* We turn each light on by just setting or clearing the relevant signal.&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
[[File:MultiColoredDisplay.png|left|400x400px]]&lt;br /&gt;
=== Multicolor Display by DaveMcW ===&lt;br /&gt;
* To understand how this works, you first need to understand how color lights choose which color to light up when there are multiple colored signals. &lt;br /&gt;
* The [[lamp]] will light up with the colored signal that is greater than zero and earliest in this list: Red, Green, Blue, Yellow, Pink, Cyan, White.  &lt;br /&gt;
* We have a [[Red wire]] per column, that wire has each of the colored signals on it at different values and a numbered signal for each row. &lt;br /&gt;
* There is a [[Arithmetic combinator]] for each cell that subtracts the &amp;quot;row&amp;quot; value from each of the colored signals. &lt;br /&gt;
* And this enables us to choose the color for each cell. &lt;br /&gt;
* Simple!&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Arithmetic combinator]]&lt;br /&gt;
* [[Constant Combinator]]&lt;br /&gt;
* [[Decider Combinator]]&lt;br /&gt;
* [[Circuit network]]&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-01-Layout.png&amp;diff=142785</id>
		<title>File:SR-01-Layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-01-Layout.png&amp;diff=142785"/>
		<updated>2017-07-24T07:59:12Z</updated>

		<summary type="html">&lt;p&gt;Moon69: Moon69 uploaded a new version of File:SR-01-Layout.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - layout and wiring&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Signal-S.png&amp;diff=142782</id>
		<title>File:Signal-S.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Signal-S.png&amp;diff=142782"/>
		<updated>2017-07-23T19:28:24Z</updated>

		<summary type="html">&lt;p&gt;Moon69: Signal S icon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Signal S icon&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Signal-R.png&amp;diff=142781</id>
		<title>File:Signal-R.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Signal-R.png&amp;diff=142781"/>
		<updated>2017-07-23T19:28:09Z</updated>

		<summary type="html">&lt;p&gt;Moon69: Signal R icon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Signal R icon&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:Signal-A.png&amp;diff=142780</id>
		<title>File:Signal-A.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:Signal-A.png&amp;diff=142780"/>
		<updated>2017-07-23T19:27:40Z</updated>

		<summary type="html">&lt;p&gt;Moon69: Signal A icon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Signal A icon&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-05-PowerSwitch.png&amp;diff=142779</id>
		<title>File:SR-05-PowerSwitch.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-05-PowerSwitch.png&amp;diff=142779"/>
		<updated>2017-07-23T19:13:09Z</updated>

		<summary type="html">&lt;p&gt;Moon69: SR Latch example - Power switch configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - Power switch configuration&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-04-SRLatch.png&amp;diff=142778</id>
		<title>File:SR-04-SRLatch.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-04-SRLatch.png&amp;diff=142778"/>
		<updated>2017-07-23T19:12:46Z</updated>

		<summary type="html">&lt;p&gt;Moon69: SR Latch example - SR Latch decider configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - SR Latch decider configuration&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-03-RangeDeciders.png&amp;diff=142777</id>
		<title>File:SR-03-RangeDeciders.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-03-RangeDeciders.png&amp;diff=142777"/>
		<updated>2017-07-23T19:12:16Z</updated>

		<summary type="html">&lt;p&gt;Moon69: SR Latch example - Range Deciders configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - Range Deciders configuration&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-02-Accumulator.png&amp;diff=142776</id>
		<title>File:SR-02-Accumulator.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-02-Accumulator.png&amp;diff=142776"/>
		<updated>2017-07-23T19:11:13Z</updated>

		<summary type="html">&lt;p&gt;Moon69: SR Latch example - Accumulator configuration&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - Accumulator configuration&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=File:SR-01-Layout.png&amp;diff=142775</id>
		<title>File:SR-01-Layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=File:SR-01-Layout.png&amp;diff=142775"/>
		<updated>2017-07-23T19:10:34Z</updated>

		<summary type="html">&lt;p&gt;Moon69: SR Latch example - layout and wiring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SR Latch example - layout and wiring&lt;/div&gt;</summary>
		<author><name>Moon69</name></author>
	</entry>
</feed>