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: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 "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: | ||
− | |||
{{av}} | {{av}} | ||
Machine logic uses the also new system of gears, axles, windmills, and waterwheels to solve problems. Power sources (windmills and waterwheels) transfer power to machine parts (axles and gears). If there is not enough power in a system to allow all the parts to move, it will shut down entirely. Individual gears can also be shut down by levers to interrupt or otherwise alter the transfer of power throughout the machine. All sorts of logic gates can be created based on those rules alone. Currently four have been created in a proof-of-concept sort of way in a relatively quick and cheap manner: | Machine logic uses the also new system of gears, axles, windmills, and waterwheels to solve problems. Power sources (windmills and waterwheels) transfer power to machine parts (axles and gears). If there is not enough power in a system to allow all the parts to move, it will shut down entirely. Individual gears can also be shut down by levers to interrupt or otherwise alter the transfer of power throughout the machine. All sorts of logic gates can be created based on those rules alone. Currently four have been created in a proof-of-concept sort of way in a relatively quick and cheap manner: | ||
Line 17: | Line 16: | ||
==Mechanical Logic== | ==Mechanical Logic== | ||
− | Mechanical Logic is a faster, more reliable replacement for | + | Mechanical Logic is a faster, more reliable replacement for {{L|Computing|Water Logic}}. It is also somewhat more complex, requiring massive amounts of wood, stone, and mechanical power. Unlike the above examples, these designs require constant power, or they will not function correctly. |
The following examples operate on these design rules | The following examples operate on these design rules | ||
Line 26: | Line 25: | ||
* Gearboxes, when supplied a Trigger High, thusly begin to transmit a Logic High signal | * Gearboxes, when supplied a Trigger High, thusly begin to transmit a Logic High signal | ||
− | Note that there are several flaws with Mechanical Logic. As noted, large amounts of wood, stone, and massive amounts of power are required. Secondly, the system operates on the concept of the 'rotation sensor' Obviously, this does not exist in Dwarf Fortress at this time, and there are no plans for such a device to exist - therefore, a surrogate unit is required. | + | Note that there are several flaws with Mechanical Logic. As noted, large amounts of wood, stone, and massive amounts of power are required. Secondly, the system operates on the concept of the 'rotation sensor' Obviously, this does not exist in Dwarf Fortress at this time, and there are no plans for such a device to exist- therefore, a surrogate unit is required. |
− | Now, there is one device we can use | + | Now, there is one device we can use- a pressure pad. Therefore, we simply need to convert mechanical energy into pressure- for example, using a {{L|Screw Pump}}. |
− | + | ``````` | |
− | + | `≈%>^.` | |
− | + | ````^`` | |
− | + | ``````` | |
− | The pump draws from a constantly-filled tile on the left, and pushes | + | The pump draws from a constantly-filled tile on the left, and pushes left. The pressure pad there then acts as the 'sensor' for whether there is rotation present. Finally, the pit on the right acts as a drain- when the pump stops, the water drains out and the pad resets (no rotation). The lower pad shown is used as an 'inverse' out. |
− | Note that in all the examples, "M" is used to denote a rotation sensor - just affix a gearbox instead and route that to one of these units, "P" is used just to say where Power is supposed to be applied, and "X", "Y", and "Z" are just to show that in a multi-part logic gate, which 'sensor' links to which gearbox internally. "o" is a gearbox that does not have any trigger connections, and is used for visual clarity | + | Note that in all the examples, "M" is used to denote a rotation sensor- just affix a gearbox instead and route that to one of these units, "P" is used just to say where Power is supposed to be applied (though not all of these have P where it should be), and "X", "Y", and "Z" are just to show that in a multi-part logic gate, which 'sensor' links to which gearbox internally. "o" is a gearbox that does not have any trigger connections, and is used for visual clarity. |
− | |||
− | |||
==Unclocked Logic== | ==Unclocked Logic== | ||
Line 45: | Line 42: | ||
===(N)OR Gate=== | ===(N)OR Gate=== | ||
− | + | {{qd|cols=8 | |
− | + | |→|{{qd/ch{{!}}*{{!}}F00}}|{{qd/ch{{!}}*{{!}}0F0}}|→|{{qd/ch{{!}}M{{!}}00F}}|.|{{qd/ch{{!}}O{{!}}00F}} | |
+ | |.|.|{{qd/ch{{!}}A{{!}}F00}}|{{qd/ch{{!}}B{{!}}0F0}}|.|.|.}} | ||
===(N)AND Gate=== | ===(N)AND Gate=== | ||
− | + | A | |
− | + | →o*o→M O | |
− | + | o*o | |
− | + | B | |
===(In)equal=== | ===(In)equal=== | ||
When Input A != Input B, O goes LOW. Invert Y and Z to change this | When Input A != Input B, O goes LOW. Invert Y and Z to change this | ||
− | + | A !A | |
− | + | →o*o→M Z →o*o→M Y | |
− | + | o*o o*o | |
− | + | B !B | |
− | + | YZ | |
− | + | →**M O | |
===AND NOT=== | ===AND NOT=== | ||
When A is HIGH and B is LOW, O goes HIGH | When A is HIGH and B is LOW, O goes HIGH | ||
− | + | A | |
− | + | →o*oM O | |
− | + | o*o | |
− | + | !B | |
Line 78: | Line 76: | ||
===NOT or BUFFER=== | ===NOT or BUFFER=== | ||
− | + | →*→M O | |
− | + | A | |
===SELECT=== | ===SELECT=== | ||
Line 85: | Line 83: | ||
O will be either B is A is HIGH, or C otherwise. In other words, IF-THEN-ELSE | O will be either B is A is HIGH, or C otherwise. In other words, IF-THEN-ELSE | ||
− | + | B!A | |
− | + | →* | |
− | + | o→M O | |
− | + | →* | |
− | + | CA | |
===DISTRIBUTOR=== | ===DISTRIBUTOR=== | ||
Line 102: | Line 100: | ||
===S/R LATCH=== | ===S/R LATCH=== | ||
+ | P = Power | ||
S = Set | S = Set | ||
R = Reset | R = Reset | ||
Line 112: | Line 111: | ||
===OSCILLATOR=== | ===OSCILLATOR=== | ||
− | + | →*M O | |
− | + | !O | |
===(AND-NOT) OR=== | ===(AND-NOT) OR=== | ||
Line 233: | Line 232: | ||
A, B are bits in. C is Carry in, O is bit out | A, B are bits in. C is Carry in, O is bit out | ||
− | + | A !A | |
− | + | →o*o→M Z →o*o→M Y | |
− | + | o*o o*o | |
− | + | B !B | |
− | + | YZ | |
− | + | →**M X | |
− | + | X !X | |
− | + | →o*o→M V →o*o→M U | |
− | + | o*o o*o | |
− | + | C !C | |
− | + | VU C | |
− | + | →**M O →o*oM W | |
− | + | o*o | |
− | + | Z | |
− | + | →**→ Carry (Out) | |
− | + | ZW | |
− | + | [[Category:Guides]] | |
− | + | [[Category:Computing]] |