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.

User:Larix/MPL/2

From Dwarf Fortress Wiki
< User:Larix‎ | MPL
Revision as of 19:13, 8 October 2013 by Larix (talk | contribs) (Created page with "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, ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

NOT/IDENTITY:


The pressure plate is active only when the hatch cover is closed. If the hatch is open, the cart will move in a circle, never swinging out to the west. A pressure plate on the circle track gives an "identity" signal, useful if your input signal is generated by a device you do not wish to directly tamper with.


AND/NAND:



The pressure plate to the southwest collects the AND, the one in the northeast the NAND signal. The AND plate is only activated when the cart can pass without hindrance through both pits.


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:



The pit to the south has a hatch cover over the southern hole. 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:


In the centre, a 'bump ramp' to limit incoming carts' speed, to the southeast a "bunker", a two-pit EW ramp with the second ramp underground with no exit at all; this returns the cart onto its entrance tile, at a moderate speed, somewhere around what a medium-speed roller.does. When both inputs are equal, the cart passes over the northern pressure plate, if they're different, they pass over the southern plate. Some variations on this design work, too. As far as i could determine, this design stays in its state reliably and can be switched during operation, although opening the second hatch cover while the cart is on top of it may result in a temporary false result or too-long return time. If the gate is supposed to be built with no more than two switchable devices - hatch covers in this case - one of the paths must lead over a hatch cover, a design i prefer to avoid when possible.

The concept of the AND and OR gates can be expanded to accomodate additional inputs. Four-input AND:



Three-input OR:


Four-input OR - barely fast enough to provide a stable NOR:


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-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.

Door-and-hatch OR gate:


This circuit doesn't use straight track ramps, the northern pit is engraved with a track crossing (NESW), the southern ramp is a normal NW 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.