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 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.
If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.
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: | ||
− | {{ | + | {{Migrated_article}} |
− | {{ | + | {{quality|Exceptional|19:04, 16 April 2011 (UTC)}}{{Computing}} |
− | {{ | + | {{av}} |
− | + | 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== | ||
Line 137: | Line 137: | ||
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 as with real world electrical circuits, 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 as with real world electrical circuits, a dedicated inverter is required, which must be hooked up to +V and ground. | ||
− | ==Advanced | + | ==Advanced CMOS Gates== |
− | This type of logic uses the | + | This type of logic uses the same concept as real CMOS circuits do, which causes them to minimize [[power]] (in this case, water) consumption. The idea is that water should only flow when there is a state change. |
===Basic Design=== | ===Basic Design=== | ||
Line 160: | Line 160: | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | |{{RTF| | + | |{{RTF|║}} |
|} | |} | ||
− | Here, {{Tile|A|#FFF|#000}} is a set of floodgates and/or drawbridges that let water flow exactly when ''f'' evaluates to true, {{Tile|B|#FFF|#000}} is the same except that it lets water flow when ''f'' evaluates to false, {{Tile|^|#808|#000}} is a pressure plate set to activate on | + | Here, {{Tile|A|#FFF|#000}} is a set of floodgates and/or drawbridges that let water flow exactly when ''f'' evaluates to true, {{Tile|B|#FFF|#000}} is the same except that it lets water flow when ''f'' evaluates to false, {{Tile|^|#808|#000}} is a pressure plate set to activate on water levels 4-7, and {{Tile|#|#FFF|#000}} is the drain. |
===Examples=== | ===Examples=== | ||
− | In the following examples, {{Tile|X|#000|#888}} is a floodgate, and {{Tile|╬|#FFF|#000}} is a drawbridge. Red ones are connected to input A | + | In the following examples, {{Tile|X|#000|#888}} is a floodgate, and {{Tile|╬|#FFF|#000}} is a drawbridge. Red ones are connected to input A, green ones to input B and blue ones to input C. |
====NOT==== | ====NOT==== | ||
Line 188: | Line 188: | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | |{{RTF| | + | |{{RTF|║}} |
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
====AND==== | ====AND==== | ||
Line 213: | Line 207: | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|{{RT|X|#FFF|#080}} | |{{RT|X|#FFF|#080}} | ||
+ | |{{RTF|║}} | ||
+ | |{{000}} | ||
+ | |- | ||
+ | |{{RTF|║}} | ||
+ | |{{RT0|^|#808}} | ||
|{{RTF|╚}} | |{{RTF|╚}} | ||
|{{RTF|╗}} | |{{RTF|╗}} | ||
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
− | |{{ | + | |{{000}} |
− | |{{ | + | |{{000}} |
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
+ | |{{RT|╬|#F00|#000}} | ||
|{{RT|╬|#0F0|#000}} | |{{RT|╬|#0F0|#000}} | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |||
|- | |- | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | |{{RTF| | + | |{{RTF|#}} |
+ | |{{RTF|║}} | ||
|} | |} | ||
Line 239: | Line 239: | ||
|- | |- | ||
|{{RTF|╗}} | |{{RTF|╗}} | ||
− | |{{RT| | + | |{{RT|X|#FFF|#800}} |
+ | |{{RT|X|#FFF|#080}} | ||
|{{RTF|╔}} | |{{RTF|╔}} | ||
− | |||
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
− | |{{ | + | |{{000}} |
− | |{{ | + | |{{000}} |
− | |{{RTF| | + | |{{RTF|║}} |
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|{{RT0|^|#808}} | |{{RT0|^|#808}} | ||
− | |{{RT| | + | |{{RTF|╔}} |
+ | |{{RTF|╝}} | ||
+ | |- | ||
+ | |{{RTF|║}} | ||
+ | |{{RT|╬|#F00|#000}} | ||
|{{RTF|║}} | |{{RTF|║}} | ||
+ | |{{000}} | ||
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
− | |{{RT| | + | |{{RT|╬|#0F0|#000}} |
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{ | + | |{{000}} |
|- | |- | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | |{{RTF| | + | |{{RTF|║}} |
+ | |{{000}} | ||
|} | |} | ||
− | |||
− | |||
− | |||
====XOR==== | ====XOR==== | ||
Line 272: | Line 275: | ||
{| style="border-spacing: 0" | {| style="border-spacing: 0" | ||
+ | |{{H2O}} | ||
|{{H2O}} | |{{H2O}} | ||
|{{H2O}} | |{{H2O}} | ||
Line 279: | Line 283: | ||
|{{RTF|╗}} | |{{RTF|╗}} | ||
|{{RT|X|#FFF|#800}} | |{{RT|X|#FFF|#800}} | ||
+ | |{{RTF|║}} | ||
|{{RT|X|#FFF|#080}} | |{{RT|X|#FFF|#080}} | ||
|{{RTF|╔}} | |{{RTF|╔}} | ||
Line 284: | Line 289: | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|{{RT|╬|#0F0|#000}} | |{{RT|╬|#0F0|#000}} | ||
+ | |{{RTF|║}} | ||
|{{RT|╬|#F00|#000}} | |{{RT|╬|#F00|#000}} | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
|{{RTF|║}} | |{{RTF|║}} | ||
+ | |{{000}} | ||
|{{RT0|^|#808}} | |{{RT0|^|#808}} | ||
|{{000}} | |{{000}} | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
+ | |{{RTF|║}} | ||
+ | |{{RT|╬|#F00|#000}} | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|{{RT|X|#FFF|#800}} | |{{RT|X|#FFF|#800}} | ||
+ | |{{RTF|║}} | ||
+ | |- | ||
+ | |{{RTF|║}} | ||
+ | |{{RT|╬|#0F0|#000}} | ||
+ | |{{RTF|║}} | ||
|{{RT|X|#FFF|#080}} | |{{RT|X|#FFF|#080}} | ||
|{{RTF|║}} | |{{RTF|║}} | ||
|- | |- | ||
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | |{{RTF| | + | |{{RTF|║}} |
− | |{{RTF| | + | |{{RTF|#}} |
− | | | + | |{{RTF|║}} |
|} | |} | ||
− | |||
− | |||
===Advantages And Disadvantages=== | ===Advantages And Disadvantages=== | ||
− | The basic advantage of this design is that it uses much less water than infinite flow gates. A river is enough to supply even the more complex systems, | + | The basic advantage of this design is that it uses much less water than infinite flow gates. A river is enough to supply even the more complex systems, maybe with an added reservoir to neutralise flow irregularities. Similarly, for the drain, it is enough to excavate a cavern where the water can evaporate. |
− | The disadvantage is that it requires more resources to construct, and more careful planning, since floodgates tend to block paths | + | The disadvantage is that it requires many more resources to construct, and more careful planning, since floodgates tend to block paths. |
− | == | + | ===Faster Version=== |
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, although designs that seek to replace as many buildings as possible with doors and hatches may minimize delays. | 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, although designs that seek to replace as many buildings as possible with doors and hatches may minimize delays. | ||
− | Another factor is the flowing speed of the water. It can be improved. First, the water should flow in from a | + | 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 than 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 one 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. To minimize latency when deactivated, assuming sufficient inflow, the pressure plate can be set to trigger only on a full 7 units of water. This increases the water consumption a bit, but it still remains relatively low. |
==Edge Detector== | ==Edge Detector== | ||
Line 408: | Line 420: | ||
Each time the input trigger is toggled, the appropriate pressure plate will activate, remain active until the water finishes flowing, then deactivate after about 100 steps. | Each time the input trigger is toggled, the appropriate pressure plate will activate, remain active until the water finishes flowing, then deactivate after about 100 steps. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{Category|Constructions}} | {{Category|Constructions}} | ||
{{Category|Computing}} | {{Category|Computing}} | ||
{{Category|Logic}} | {{Category|Logic}} | ||
− |