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:Larix/MPL/2

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:
'''Basic logic gates in MPL'''
+
 
 +
== 2. The basic logic gates in MPL ==
 +
 
  
 
These designs all use straight track ramps in the pits and only use hatches for switching. They are very reliable, but slow and space-hungry, since every single bifurcation will require a one by two pit and entrance and exit tracks. They are constructed with a constantly-moving cart, waiting for input changes and adjusting their output according to the new logic condition with a moderate delay. They can be switched in full operation, and only the XOR/XNOR one runs a small risk of creating a false output when switched at the wrong moment. With some fancy pathing, all of these logic gates can also be used in their opposing function.  
 
These designs all use straight track ramps in the pits and only use hatches for switching. They are very reliable, but slow and space-hungry, since every single bifurcation will require a one by two pit and entrance and exit tracks. They are constructed with a constantly-moving cart, waiting for input changes and adjusting their output according to the new logic condition with a moderate delay. They can be switched in full operation, and only the XOR/XNOR one runs a small risk of creating a false output when switched at the wrong moment. With some fancy pathing, all of these logic gates can also be used in their opposing function.  
  
All designs were built and tested and have proven functional.
+
'''NOT/IDENTITY:'''
 
 
===NOT/IDENTITY===
 
  
 
[[File:Nicht-Gatter.png]]
 
[[File:Nicht-Gatter.png]]
Line 12: Line 12:
  
  
===AND/NAND===
+
'''AND/NAND:'''
  
 
[[File:UndNichtUnd.png]]
 
[[File:UndNichtUnd.png]]
Line 23: Line 23:
 
To the north, a near-minimal AND gate (could be made one tile smaller), to the south an AND-based custom gate, designed to give a notable result if the first input is on and the second off.
 
To the north, a near-minimal AND gate (could be made one tile smaller), to the south an AND-based custom gate, designed to give a notable result if the first input is on and the second off.
  
===OR/NOR===
+
'''OR/NOR:'''
  
 
[[File:OderNichtUnd.png]]
 
[[File:OderNichtUnd.png]]
Line 30: Line 30:
 
If both hatches are closed, the cart will bounce between the two ramps, constantly returned and sent to the other. To the far southeast there's a ramp directly against a wall, used to limit the speed of carts which got to pass through a ramp-pit. Carts passing through the E-W ramp will otherwise accelerate so much that they derail/jump and stop.  
 
If both hatches are closed, the cart will bounce between the two ramps, constantly returned and sent to the other. To the far southeast there's a ramp directly against a wall, used to limit the speed of carts which got to pass through a ramp-pit. Carts passing through the E-W ramp will otherwise accelerate so much that they derail/jump and stop.  
  
===XOR/XNOR===
+
'''XOR/XNOR:'''
  
 
[[File:Äquivalenz-Differenz.png]]
 
[[File:Äquivalenz-Differenz.png]]
Line 47: Line 47:
  
  
===Cooking with doors===
+
'''Cooking with doors:'''
  
 
A door can be used to block a cart from exiting a ramp '''to''' a specific flat floor tile, while a hatch is best used to block a cart from exiting '''from''' a specific ramp tile. Doors can thus be combined with hatch covers to build logic gates consisting of a single 2x1 pit.
 
A door can be used to block a cart from exiting a ramp '''to''' a specific flat floor tile, while a hatch is best used to block a cart from exiting '''from''' a specific ramp tile. Doors can thus be combined with hatch covers to build logic gates consisting of a single 2x1 pit.
A door-and-hatch AND gate would simply put a hatch cover on top of the output ramp and the door in the output tile. Only if both devices are opened, the cart can leave on the output side, otherwise it will be returned on the input side. A dual-function AND/NAND gate based on this design could be built by simply taking the NOT/identity gate above and adding a switchable door on the NW corner just east of the pit. As a nice benefit, in such a circuit, both gates are in fact checked simultaneously - the cart's attempt to move out of the pit takes a single game step, and if on that step either building is shut, the cart will return, and only if both are open will it pass.
+
A door-and-hatch AND gate would simply put a hatch cover on top of the output ramp and the door in the output tile. Only if both devices are opened, the cart can leave on the output side, otherwise it will be returned on the input side. A dual-function AND/NAND gate based on this design could be built by simply taking the NOT/identity gate above and adding a switchable door on the NW corner just east of the pit.
  
 
'''Door-and-hatch OR gate:'''
 
'''Door-and-hatch OR gate:'''
Line 56: Line 56:
 
[[File:Oderminimal.png]]
 
[[File:Oderminimal.png]]
  
This circuit doesn't use straight track ramps, the northern pit is engraved with a track crossing (NESW), the southern ramp is a normal NE corner track ramp. If the door is open, the cart will pass through the single pit to the north and leave to the west. If the door is closed but the hatch cover open, the cart will leave the pit from the southern ramp, going east. If both devices are closed, the cart will leave from the northern pit, going north. This design needs a fairly high operation speed, more than a dwarven push can produce, thus the impulse ramp to the east. In the form presented, the circuit can only perform "single-pass" checks. Since a cart passing straight across the northern hole gains no ramp acceleration, an additional accelerator would be required for long-term operation.
+
This circuit doesn't use straight track ramps, the northern pit is engraved with a track crossing (NESW), the southern ramp is a normal NE corner track ramp. If the door is open, the cart will pass through the single pit to the north and leave to the west. If the door is closed but the hatch cover open, the cart will leave the pit from the southern ramp, going east. If both devices are closed, the cart will leave from the northern pit, going north. This design needs a fairly high operation speed, more than a dwarven push can produce, thus the impulse ramp to the east. I do not know if this circuit is capable of keeping a cart circulating and operative or if it's limited to "single-pass" checks.
 
 
===Esoteric use of bridges for switching===
 
 
 
Since bridges really are treated like normal (all-direction) track by the game in their lowered/extended position and also overwrite the track features of the tile below, a retracting bridge over a flat tile of non-track floor can also change the behaviour of a minecart: a cart coming from ordinary floor will jump over a pit even if moving at low speed, but a cart coming from a track tile will enter a pit containing a track ramp unless it's moving at derail speed over flat floor. Thus, extending/retracting the bridge will switch the cart's behaviour between going down the ramp and ignoring the ramp and jumping over it.
 
 
 
Combining this feature with a two-long bridge on the other end of a straight double-ramp pit, i constructed a full bit-compare logic gate using only those two switchable devices to generate the four possible outputs for the four possible input signal combinations. It is a curiosity, since for most logical purposes, such distinctions are not needed and since only bridges can be used, the gate reacts with a significant delay to input and should not be switched during operation - a bridge changing state under a cart will throw the cart around and force it to stop. It's worth mentioning that the more classical use of bridges to cover/reveal track corners offers the same functionality in switching cart paths - a full bit-compare gate can be built with two 1x1 bridges over flat track, too.
 

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)