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 User:Jjdorf/Logic Gates

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.


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:
 
I'll be using this as a spot to keep all my preferred logic designs in one spot.  Each design will specify the power requirements, build materials (excluding walls if constructing rather than digging), and build order, including the points when an input or output needs to be hooked up to things.  I consider gate technology in DF to be of two major types, Fluid Logic (FL), and Mechanical Logic (ML).  Borg logic, while interesting and certainly amusing, I believe to have too much of an impracticality in pathfinding cost and a lack of precision; Thus, I will generally disregard it until more intrepid scientists prove my biased assumptions incorrect.  For the most part, I will be using [[DF2010:Mechanical logic]] for my basic logic gates, due to the fact that I want to completely avoid the need for an infinite water source.  The exception to this restriction lies in two gates (so far), and these exceptions occur for a simply reason: they have variants which do not lose water.  Another design goal is the creation of mechanical logic gates that do not, in any way, use load gear trains to affect their operation.  I have verified that gears toggle, rather than set and reset, and that pre-toggling gears for the various gate designs also works, and as such, the mechanical logic designs below are far less complex and still 100% feasible to build, though the ones that require pre-toggling will cost one or two more mechanisms.
 
I'll be using this as a spot to keep all my preferred logic designs in one spot.  Each design will specify the power requirements, build materials (excluding walls if constructing rather than digging), and build order, including the points when an input or output needs to be hooked up to things.  I consider gate technology in DF to be of two major types, Fluid Logic (FL), and Mechanical Logic (ML).  Borg logic, while interesting and certainly amusing, I believe to have too much of an impracticality in pathfinding cost and a lack of precision; Thus, I will generally disregard it until more intrepid scientists prove my biased assumptions incorrect.  For the most part, I will be using [[DF2010:Mechanical logic]] for my basic logic gates, due to the fact that I want to completely avoid the need for an infinite water source.  The exception to this restriction lies in two gates (so far), and these exceptions occur for a simply reason: they have variants which do not lose water.  Another design goal is the creation of mechanical logic gates that do not, in any way, use load gear trains to affect their operation.  I have verified that gears toggle, rather than set and reset, and that pre-toggling gears for the various gate designs also works, and as such, the mechanical logic designs below are far less complex and still 100% feasible to build, though the ones that require pre-toggling will cost one or two more mechanisms.
===NOTE===
+
=NOTE=
 
A previous version of this page holds a fluid logic memory cell, derived from the one found on [[User:SL/Logic_Gates]], however I have further converted it, and since it uses gears, inverted pressure plate logic, and pre-toggling with one of the gears, I am listing only it in this and further versions of the page.
 
A previous version of this page holds a fluid logic memory cell, derived from the one found on [[User:SL/Logic_Gates]], however I have further converted it, and since it uses gears, inverted pressure plate logic, and pre-toggling with one of the gears, I am listing only it in this and further versions of the page.
===Design Guidelines===
+
=Design Guidelines=
 
Because the natural state of a gear is to be engaged, the first guideline is that all logic inputs to a gate must be made while the input is logically TRUE.  This means that a lever intended to control an input must be flipped on before being linked to a logic gate, and it means that pressure plates must be designed to be on when the water level is under 4/7 or lower.  Exceptions for general purpose I/O can be made, but for logic gate design, this rule must be adhered to.
 
Because the natural state of a gear is to be engaged, the first guideline is that all logic inputs to a gate must be made while the input is logically TRUE.  This means that a lever intended to control an input must be flipped on before being linked to a logic gate, and it means that pressure plates must be designed to be on when the water level is under 4/7 or lower.  Exceptions for general purpose I/O can be made, but for logic gate design, this rule must be adhered to.
  
Line 17: Line 17:
 
  XXXXXX    XXXXXX
 
  XXXXXX    XXXXXX
  
Both doors (D) are ordinarily forbidden under normal operation.  A water drain path is unnecessary if you can force the pump on when you need to access the pressure plate for adjustments or replacement.  When the pump is on, and the thing is built and filled with the right amount of water, no water will ever be on the pressure plate tile.  Once the pump shuts off, the bottom floor will be fully submerged, four tiles of 7/7 water.  The mechanical input (S) provides the power to the pump.  Enough power must be available at this point to drive the pump (10 units) when the signal gear or axle is functioning.  The pressure plate (o) on the bottom layer is set to 0-3 water level.  The screw pump (%>) pumps away from the signal mechanism, towards a floor grate (#).
+
Both doors (D) are ordinarily forbidden under normal operation.  A water drain path is a good idea if maintenance is ever necessary on the bottom floor.  The mechanical input (S) provides the power to the pump.  Enough power must be available at this point to drive the pump (10 units) when the signal gear or axle is functioning.  The pressure plate (o) on the bottom layer is set to 0-3 water level.  The screw pump (%>) pumps away from the signal mechanism, towards a floor grate (#).
 
===Building===
 
===Building===
 
* First, construct or dig the walls and floors.  If constructing, do NOT build floors at the empty space tiles (.), channel the same tiles if digging from the rock.
 
* First, construct or dig the walls and floors.  If constructing, do NOT build floors at the empty space tiles (.), channel the same tiles if digging from the rock.
Line 32: Line 32:
 
1 Block
 
1 Block
 
1 Grate
 
1 Grate
 +
===Inverter===
 +
An inverter can be built with identical properties and build sequence by simply changing the pressure plate to trigger on 4-7 water.
 +
===Hybrid===
 +
Technically, this gate is designed for use solely in a hybrid environment, as the end result of a mechanical logic gear chain.  If intended to be used completely as Fluid logic, the source would be converted to a power input, moved to the side of the pump instead of over the source tile, a hatch would be placed over the source tile, defaulting to closed when off.
 
===Notes===
 
===Notes===
A Rotation sensor can also be considered a simple Buffer.  Buffers in actual electronics circuits are often used to increase the number of gates an output signal can be connected to, often by much more than the standard gate output can do.  Thus, I consider mechanical logic and fluid logic to be two different types of gates, and you use the gate that is best suited for the specific job.  Since fluid logic has a greater ''fan-out'' than mechanical logic, the fluid buffer can reset the power needed, since fundamentally, multiple mechanical gates '''can''' be connected together without issue until power runs out.
+
A Rotation sensor can also be considered a simple Buffer.  Buffers in actual electronics circuits are often used to increase the number of gates an output signal can be connected to, often by much more than the standard gate output can do.  Thus, I consider mechanical logic and fluid logic to be two different types of gates, and you use the gate that is best suited for the specific job.  Since fluid logic has a greater ''fan-out'' than mechanical logic, the fluid buffer can reset the power needed, since fundamentally, multiple mechanical gates '''can''' be connected together without issue until power runs out or you need to use load gear assemblies such as in an XOR or XNOR gate.
 +
===TODO===
 +
Verify that a signal gear or axle can be placed at (S) and still allow water to be pumped.  If this is not possible, adjust the design to put the gear one z-level above the pump, making sure to channel the floor to allow power transfer.  Construct and build a prototype and leave it run for a long time to verify the claim of no evaporation.  Dwarf Science!
 
===Pros/Cons===
 
===Pros/Cons===
 
The pressure plate requires 100 steps to switch off, but switches on immediately.  The sensor is water tight and should not evaporate under normal operation, allowing it to be disconnected from an infinite water source.
 
The pressure plate requires 100 steps to switch off, but switches on immediately.  The sensor is water tight and should not evaporate under normal operation, allowing it to be disconnected from an infinite water source.
Line 170: Line 176:
 
  PiO
 
  PiO
  
The difference is that '''both''' the A & B inputs are linked up to the same single input gear.  I have tested with a synchronized pump system that two toggle signals occurring at the same time are treated as two separate toggles, and thus cancel out, as should be.  Of particular note is that this option is as power and space efficient as a simple NOT or Buffer gate.  Building is easy; build the input gear assembly, build a lever, link the lever to the gear, flip the lever then dismantle it, then link the inputs to the gear, ensuring that the input links are active, as per PTML design guidelines.
+
The difference is that '''both''' the A & B inputs are linked up to the same single input gear.  I have tested with a synchronized pump system that two toggle signals occurring at the same time are treated as two separate toggles, and thus cancel out, as should be.  Of particular note is that this option is as power and space efficient as a simple NOT or Buffer gate.  Building is easy; build the input gear assembly, build a lever, link it to the gear, flip the lever, dismantle the lever if the mechanisms are desired, then link the inputs to the gear, ensuring that the input links are not active (logically zero).
 
===Bill of Materials===
 
===Bill of Materials===
 
2 Mechanisms
 
2 Mechanisms
 
2 Additional Mechanisms which are then recovered
 
2 Additional Mechanisms which are then recovered
===Decomposed XOR Gate===
 
The above gate is functionally equivalent to the following, which can be used in more complicated designs.
 
 
PAb
 
BaO
 
 
Another variation:
 
 
PAb
 
  aBO
 
 
==ML 8-bit Adder/Subtractor==
 
From my forum thread, the Adder/Subtractor uses 8 bits of an adder/subtractor assembly, one per input bit, and a carry input endcap.  Inputs are one Z signal, which is false for addition, and true for subtraction; and 1 A and 1 B input per bit of addition.
 
 
First, the 1-bit adder module:
 
 
  CC
 
PBAa  PS
 
  bB
 
 
Link the incoming A signal to the A and a gears, pre-toggling the a gear.  Link the incoming B signal ''and'' the incoming Z signal to the B and b gears, pre-toggling the b gear.  Construct an FL Buffer under the CC gear pair, and link its pressure plate to the S gear.  Also link the A, B, and Z signals to that pressure plate.  Construct a second FL Buffer under S, but ''not'' under the adjacent Power gear (P).  The pressure plate of this second buffer is the result of the addition or subtraction for this bit.
 
 
Second the endcap:
 
 
  *ZP
 
 
Link the Z signal to the Z gear.  The extra gear * simply transfers power.  The final construction will look like this:
 
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  CC
 
PBAa  PS
 
  bB
 
  *ZP
 
  
 
==DPROM==
 
==DPROM==

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)