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 v0.34:Mechanical 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 "v0.34"). 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 32: Line 32:
  
 
=== Example ===
 
=== Example ===
The first example shows a load based XOR gate. It takes input signals from two different triggers. Its output gear (<span style="color:#FFFF44">O</span>) is powered when exactly one of the two input triggers is on and the other one is off. This is done as follows:<br />The power will be connected to the gear with the <span style="color:#44FF44">P</span> (from the bottom of the diagram or another z-level). One input is linked to gear <span style="color:#FF44FF">1</span> the other to gear <span style="color:#FF44FF">2</span>. This way power will flow from <span style="color:#44FF44">P</span> to <span style="color:#FFFF44">O</span> if either one of the input signals is off. The power input is linked directly to the load <span style="color:#FF4444">L</span> which must be calibrated precisely so that the power provided can move the output and load and ''one'' of the input-toggled gears, but not ''both''. You can build this on top of a [[Mechanical logic#Power to signal converter|power to signal converter]] as shown on this page.<br />As you can see, this gate is complicated to construct. You will need four gears and four more to connect the input in addition to all the components needed for the converter and the load, and your load assembly will need to be precisely calibrated and can only be used for this circuit. When using a common load (shared with other circuits), the gate would have to be linked to it through two signal-driven gears put in line. This would increase the parts count by two installed and four link gears.
+
The first example shows a load based XOR gate. It takes input signals from two different triggers. It's output gear (<span style="color:#FFFF44">O</span>) is powered when exactly one of the two input triggers is on and the other one is off. This is done as follows:<br />The power will be connected to the gear with the <span style="color:#44FF44">P</span> (from the bottom of the diagram or another z-level). One input is linked to gear <span style="color:#FF44FF">1</span> the other to gear <span style="color:#FF44FF">2</span>. This way power will flow from <span style="color:#44FF44">P</span> to <span style="color:#FFFF44">O</span> if either one of the input signals is off. Additionally both inputs are linked to gear <span style="color:#FF44FF">3</span>, that is connected to the load <span style="color:#FF4444">L</span>. Since gears toggle the gear will be active if both signals where off (or on), and the load will stop any flow of power then. You can build this on top of a [[Mechanical logic#Power to signal converter|power to signal converter]] as shown on this page.<br />As you can see you will need many mechanisms to build this gate. 5 for the gears, 8 to connect to the input in addition to all the components needed for the converter and the load.
 
<div style="width:1px; white-space:nowrap;">
 
<div style="width:1px; white-space:nowrap;">
 
'''load based XOR'''
 
'''load based XOR'''
Line 53: Line 53:
 
|{{RTL|#FFF}}
 
|{{RTL|#FFF}}
 
|-
 
|-
|{{RTL|#FFF}}
 
 
|{{RTL|#FFF|&nbsp;|#FFF|L|#F44|right}}
 
|{{RTL|#FFF|&nbsp;|#FFF|L|#F44|right}}
 +
|{{RTL|#444|*|#DDD||||3|#F4F|right}}
 
|{{RTL|#444|*|#DDD||||P|#4F4|right}}
 
|{{RTL|#444|*|#DDD||||P|#4F4|right}}
 
|{{RTL|#444|*|#DDD||||2|#D4D|right}}
 
|{{RTL|#444|*|#DDD||||2|#D4D|right}}
Line 92: Line 92:
 
|}
 
|}
 
</div>
 
</div>
In stark contrast to the load-based XOR, it consists of a single gear. While it requires a power source and an output, it can accept power from an axle and serve as output gear by itself. This is how it works:<br />Connect it to your source of power, and link it to one of your input triggers. Build a temporary lever anywhere and connect it, too. Pull the lever once. You can deconstruct the temporary lever now. Now the gear is disengaged, and you link the second input trigger to it. Since gears toggle, every time your trigger changes state and sends a signal the gear will change state. Initially both triggers are off, and the gear is disengaged. When one trigger changes state, it will activate the gear. Independent of which trigger changes next, both will have the same state afterwards, and the gear will be disengaged again. So the gear will transport power when both input triggers are at different state: XOR. You can build this on top of a [[Mechanical logic#Power to signal converter|power to signal converter]] as shown on this page.<br />As you can see, you won't need many mechanisms to build this gate. 1 for the gear, 4 to connect to the input and 1 will be lost after disconnecting the temporary lever (that needs 3 temporarily). And of course you will need all the components for the converter, but no load.<br>
+
In stark contrast to the load-based XOR, you'll need only one gear. This is how it works:<br />Connect it to your source of power, and link it to one of your input triggers. Build a temporary lever anywhere and connect it, too. Pull the lever once. You can deconstruct the temporary lever now. Now the gear is disengaged, and you link the second input trigger to it. Since gears toggle, every time your trigger changes state and sends a signal the gear will change state. Initially both triggers are off, and the gear is disengaged. When one trigger changes state, it will activate the gear. Independent of which trigger changes next, both will have the same state afterwards, and the gear will be disengaged again. So the gear will transport power when both input triggers are at different state: XOR. You can build this on top of a [[Mechanical logic#Power to signal converter|power to signal converter]] as shown on this page.<br />As you can see, you won't need many mechanisms to build this gate. 1 for the gear, 4 to connect to the input and 1 will be lost after disconnecting the temporary lever (that needs 3 temporarily). And of course you will need all the components for the converter, but no load.<br>
  
 
'''toggle based XNOR'''
 
'''toggle based XNOR'''
* Use a single gear as for the XOR, but omit the temporary lever step.
+
* Use a singe gear as for the XOR, but omit the temporary lever step.
  
 
'''toggle based NOR'''
 
'''toggle based NOR'''

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)

Templates used on this page: