v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Editing 40d:Fluid logic
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "40d"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
Fluid logic is a form of [[computing]] which uses a fluid (generally [[water]]) controlled by various means, to trigger [[pressure plate]]s and hopefully accomplish some desirable result. | Fluid logic is a form of [[computing]] which uses a fluid (generally [[water]]) controlled by various means, to trigger [[pressure plate]]s and hopefully accomplish some desirable result. | ||
==Infinite Flow Gates== | ==Infinite Flow Gates== | ||
− | <!--[[ | + | <!--[[File:Logic1.gif|thumb]]--> |
− | These logic gates are relatively simple and cheap to make, but require an infinite amount of water and infinite drainage to operate. You can build a circuit system to prevent the loss of water, but closing constructions like floodgates will always destroy water, so you'll always have | + | These logic gates are relatively simple and cheap to make, but require an infinite amount of water and infinite drainage to operate. You can build a circuit system to prevent the loss of water, but closing constructions like floodgates will always destroy water, so you'll always have replace it somehow. The following examples use raising bridges and floodgates, as they have the same delay of 100 steps when reacting to on/off signals. The bridges work as inverted input as they block passage when recieving an on signal while floodgates open in that case.<br clear="all"/> |
− | |||
− | |||
<div style="position:relative; float:none;"> | <div style="position:relative; float:none;"> | ||
Line 21: | Line 18: | ||
|- | |- | ||
|{{RTL|#00A|≈|#DDD}} | |{{RTL|#00A|≈|#DDD}} | ||
− | |{{RTL|# | + | |{{RTL|#AAA|X|#444|A|#0F0}} |
− | |{{RTL|# | + | |{{RTL|#AAA|X|#444|B|#F00}} |
|{{RTL|#00A|^|#DDD}} | |{{RTL|#00A|^|#DDD}} | ||
|{{RTL|#222|·|#BBB}} | |{{RTL|#222|·|#BBB}} | ||
Line 34: | Line 31: | ||
|} | |} | ||
</div> | </div> | ||
− | An AND gate is simply created by putting two floodgates | + | An AND gate is simply created by putting two floodgates in a row, each one connected to one of the input triggers. When both floodgates recieve an on signal, they will open and let the water from the left side pass. The pressure plate behind the floodgates has to be constructed to react on 4-7 water. If you use a pressure plate reacting on 0-3 water, you'll get a NAND gate instead. It's also possible to add more floodgates to process more than two signals in a conjunction, and to use two oppositional pressure plates to get the result of the AND and NAND operation at the same time. If you use a single floodgate and a 0-3 pressure plate, you'll get a NOT gate. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<div style="position:relative; float:none;"> | <div style="position:relative; float:none;"> | ||
Line 52: | Line 43: | ||
|{{RTL|#222}} | |{{RTL|#222}} | ||
|{{RTL|#222}} | |{{RTL|#222}} | ||
− | |||
− | |||
− | |||
− | |||
|{{RTL|#222}} | |{{RTL|#222}} | ||
|- | |- | ||
|{{RTL|#00A|≈|#DDD}} | |{{RTL|#00A|≈|#DDD}} | ||
− | |{{RTL|# | + | |{{RTL|#AAA|╬|#444|A|#0F0}} |
+ | |{{RTL|#AAA|╬|#444|B|#F00}} | ||
|{{RTL|#00A|^|#DDD}} | |{{RTL|#00A|^|#DDD}} | ||
|{{RTL|#222|·|#BBB}} | |{{RTL|#222|·|#BBB}} | ||
|- | |- | ||
− | |||
− | |||
− | |||
|{{RTL|#222}} | |{{RTL|#222}} | ||
− | |||
|{{RTL|#222}} | |{{RTL|#222}} | ||
|{{RTL|#222}} | |{{RTL|#222}} | ||
Line 75: | Line 59: | ||
|} | |} | ||
</div> | </div> | ||
− | An OR gate is simply created by putting two | + | An OR gate is simply created by putting two 1x1 raising bridges in a row, each one connected to one of the input triggers. When one of the bridges recieves an on signal, it will raise and blocks the water passage from the left side. The pressure plate behind the bridges has to be constructed to react on 0-3 water. If you use a pressure plate reacting on 4-7 water, you'll get a NOR gate instead. It's also possible to add more floodgates to process more than two signals in a disjunction, and to use two oppositional pressure plates to get the result of the OR and NOR operation at the same time. If you use a single bridge and a 4-7 pressure plate, you'll get a NOT gate. |
− | |||
− | |||
− | |||
− | |||
<div style="position:relative; float:none;"> | <div style="position:relative; float:none;"> | ||
Line 94: | Line 74: | ||
|- | |- | ||
|{{RTL|#00A|≈|#DDD}} | |{{RTL|#00A|≈|#DDD}} | ||
− | |{{RTL|# | + | |{{RTL|#AAA|X|#444|A|#0F0}} |
− | |{{RTL|# | + | |{{RTL|#AAA|╬|#444|B|#F00}} |
|{{RTL|#DDD}} | |{{RTL|#DDD}} | ||
|{{RTL|#222}} | |{{RTL|#222}} | ||
Line 106: | Line 86: | ||
|- | |- | ||
|{{RTL|#00A|≈|#DDD}} | |{{RTL|#00A|≈|#DDD}} | ||
− | |{{RTL|# | + | |{{RTL|#AAA|X|#444|B|#F00}} |
− | |{{RTL|# | + | |{{RTL|#AAA|╬|#444|A|#0F0}} |
|{{RTL|#DDD}} | |{{RTL|#DDD}} | ||
|{{RTL|#222}} | |{{RTL|#222}} | ||
Line 119: | Line 99: | ||
|} | |} | ||
</div> | </div> | ||
− | A XOR gate is created by putting 1x1 raising bridges and floodgates together. | + | A XOR gate is created by putting 1x1 raising bridges and floodgates together. Bridge and floodgate <font style="font-family: 'Helvetica'; color:#0F0;">A</font> are linked to the same input and bridge and floodgate <font style="font-family: 'Helvetica'; color:#F00;">B</font> are both linked to the other input. When one of the inputs sends an on signal, the bridge will raise/close and the appropriate door will be opened. Only when the floodgate and the bridge at one passage are open, what happenes when exactly one input singal is on, the water will flow to the right. The pressure plate behind the bridges has to be constructed to react on 4-7 water. If you use a pressure plate reacting on 0-3 water, you'll get a NXOR/EQUAL gate instead. It's also possible to use two oppositional pressure plates to get the result of the XOR and NXOR operation at the same time. |
− | + | Processing more input signals is possible but requires an exponentially growing amount of bridges, floodgates and therefore mechanism. It is easier to link the output to another XOR gate. | |
− | |||
− | |||
− | |||
− | |||
− | As mentioned, you can just add more floodgates and bridges and even pressure plates to expand your gates to process more input signals | + | As mentioned, you can just add more floodgates and bridges and even pressure plates to expand your gates to process more input signals. You can combine floodgates and bridges as you need them. The XOR gate for example is nothing else than combined logic: A XOR B = (A AND NOT B) OR (NOT A AND B). |
But sometimes it is easier to use more but simpler gates. | But sometimes it is easier to use more but simpler gates. | ||
+ | <!-- // The following is simply mechanical logic with a power to signal converter... | ||
− | |||
− | |||
− | |||
==Mechanical-Fluid Gates== | ==Mechanical-Fluid Gates== | ||
− | |||
− | |||
[[File:Logic2.gif|thumb]] | [[File:Logic2.gif|thumb]] | ||
The water sources in these diagrams are located 1 z-level below the pumps and gear assemblies. | The water sources in these diagrams are located 1 z-level below the pumps and gear assemblies. | ||
− | These gate designs have the advantage of destroying no water and requiring no drainage off the map, making them suitable for maps where infinite water and/or drainage may be a problem. The only fluid lost will be to evaporation. However, there are a number of disadvantages. They require significantly more materials and time to make, they require | + | These gate designs have the advantage of destroying no water and requiring no drainage off the map, making them suitable for maps where infinite water and/or drainage may be a problem. The only fluid lost will be to evaporation. However, there are a number of disadvantages. They require significantly more materials and time to make, they require [[power]], and a [[flood]] could have disasterous consequences, as it would cover all the plates at once. |
For the XOR-Gate it is assumed that the gear is powered by a windmill on a map with strong wind (40 power). If both gears are active the XOR-Gate would need more than 40 power and will stop working. If you use a different source of power - a waterwheel with axles or combined windmills 20 power each - you´ll have to add or remove some gears or axles to calibrate it.<br clear="all"/> | For the XOR-Gate it is assumed that the gear is powered by a windmill on a map with strong wind (40 power). If both gears are active the XOR-Gate would need more than 40 power and will stop working. If you use a different source of power - a waterwheel with axles or combined windmills 20 power each - you´ll have to add or remove some gears or axles to calibrate it.<br clear="all"/> | ||
− | --> | + | |
+ | //--> | ||
+ | |||
==CMOS Transmission Gate and Inverter Logic== | ==CMOS Transmission Gate and Inverter Logic== | ||
− | + | [[File:Inverter.gif|thumb]] | |
Perhaps the closest to utilizing water as a stand-in for electricity, transmission gate logic can be accomplished by simply having an infinite water source in place of all +Vs, and infinite drainage for all grounds. Simple floodgates behave as standard transmission gates, while bridges are inverted gates. However, unlike the other forms of fluid logic, but like a real world electrical circuit, a dedicated inverter is required, which must be hooked up to +V and ground. | Perhaps the closest to utilizing water as a stand-in for electricity, transmission gate logic can be accomplished by simply having an infinite water source in place of all +Vs, and infinite drainage for all grounds. Simple floodgates behave as standard transmission gates, while bridges are inverted gates. However, unlike the other forms of fluid logic, but like a real world electrical circuit, a dedicated inverter is required, which must be hooked up to +V and ground. | ||
Line 335: | Line 309: | ||
The main factors that affect the speed of these gates are the delays of floodgates and bridges, and the switch-off delay of pressure plates. These cannot be eliminated. | The main factors that affect the speed of these gates are the delays of floodgates and bridges, and the switch-off delay of pressure plates. These cannot be eliminated. | ||
− | Another factor is the flowing speed of the water. It can be improved. First, the water should flow in from a reservoir a few z-levels higher | + | Another factor is the flowing speed of the water. It can be improved. First, the water should flow in from a reservoir a few z-levels higher then the gates themselves (the more the better). This way, water will flow in much faster. Next, replace the pressure plates with up stairs, and make a 2x1 room one z-level above. On on tile is a down stair, and on the other is the pressure plate. Now the water will also flow out faster, or at least the pressure plate will switch off sooner. |
This increases the water consumption a bit, but it still remains relatively low. | This increases the water consumption a bit, but it still remains relatively low. | ||
− | + | [[Category:Constructions]] | |
− | + | [[Category:Computing]] |