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/4

From Dwarf Fortress Wiki
Jump to navigation Jump to search

Links: project writeups posted on the forum:


Powerless adder:[edit]

http://www.bay12forums.com/smf/index.php?topic=128979.msg4429364#msg4429364 http://www.bay12forums.com/smf/index.php?topic=128979.msg4429366#msg4429366

Commentary:

Due to the limitations of MPL, this design adds very, very slowly compared with mechanical adders. It also took a lot of time to link everything up. The separately adressable memory feeding the "reader" was a major but in the end quite valuable effort; it demonstrates that separate adressable memory banks ("registers"?) holding information for an indefinite time and run off a single shared input are a definite possibility, something that's absolutely necessary for anything nearing an actual programmable computer.

The solution i found - a counter/memory which performs all carry calculations by itself and holds the actual calculation result - strikes me as rather unorthodox, as well as the addition running from highest to lowest bit when classic binary calculations go from lowest to highest.

Precise dwarven clock:[edit]

http://www.bay12forums.com/smf/index.php?topic=128979.msg4430617#msg4430617

Commentary:

This clock is absolutely precise when it comes to days, but due to varying delays in the primary counting circuit, the hours ended up very irregular. The hour signals all arrive at the exact same time every day, but the distances between them range between maybe twenty and one hundred steps.

In my first attempt at building a dwarven clock, i had not yet started looking for useable repeaters and ended up with a highly imprecise contraption. But working on it gave me more interest in counting circuits and i eventually stumbled over the device i ended up using not only here but also as the basis of the calculator. After i had found the small-size 720-step repeater, it was only a matter of putting the parts together. The project even offered an opportunity to actually use some of the logic gates i had constructed, to check for various dates and use them to trigger a few specific devices.

Subtractor and multiplier:[edit]

http://www.bay12forums.com/smf/index.php?topic=128979.msg4442685#msg4442685

Commentary:

This is primarily an extension of the pure adder above - it's taking the input from the same memory banks - but the calculating memory had to be built anew, the subtraction functionality wasn't included in the adder's memory. The subtractor could probably be designed to allow addition as well, taking input from the same reading circuit, merely using two different-weight minecarts and weight-adjusted pressure plates.

I'm rather pleased with my accidental discovery of binary complementary to display negative numbers, although getting the final 'minus one' to trigger when going negative - to get the correct complement for display - was quite a bit of a headache and the circuitry ended up insanely tangled.

The multiplier was merely a proof-of-concept, size and potential time consumption for multiplications done like this rise with the square of the number "length", which quickly becomes utterly impractical when the base time consumption for every generated bit is around 200 steps: multiplying 15 * 15, the biggest calculation possible here, would take about two and a half days. Expanding multiplication to the 100 * 100 range would result in calculation times ranging up to eight days.

Seven-segment display controller[edit]

http://www.bay12forums.com/smf/index.php?topic=15096.msg5243326#msg5243326

Commentary:

This device, while utterly impractical, demonstrates very clearly the peculiarities of pathing logic. Somewhat similar concepts could be used in creature logic (which also depends on pathing), but minecart pathing can take the paradigm to extreme levels because

  • Minecarts path deterministically, they don't "weigh" paths, they either have a path or they don't.
  • Minecart paths can be made one-directional very easily. A track corner will only affect the path of carts which enter it from one of its connection directions. Carts arriving from the two non-connected directions just pass over it in a straight line.
  • Minecart paths can cross each other freely. In contrast, power or fluid cannot be sent "through" an output sensor in separate directions, i.e. without enabling intersecting power/fluid paths.
  • Minecart paths can be combined easily, while power and fluid tend towards "backwards flow" in such cases.

Using these advantages, it's entirely possible to have four distinct paths all passing over a single pressure plate. N.B. - the paths are distinct and separate before passing over the plate, and they're still separate after passage.

I used an "off-switch" logic for this display controller. It was pretty much the approach that presented itself when looking at the problem: to get all sixteen symbols displayed, 34 individual "segment off" signals are required, but a full 78 "segment on" ones. The fiddlier conditions in conventional logic notations didn't bother me, since (minecart) pathing already provided me with a relatively simple four-bit-to-sixteen-outputs pre-decoder. So i didn't need to look at individual bit-to-segment logic, but rather at which pre-decoded _numbers_ shared dark segments in their displays; the features of pure minecart pathing mentioned above then allowed combining paths for shared segments, resulting in a decoder using the absolute minimum of seven pressure plates to pick up signals for the seven display segments.

I think i understand now why the probably quite numerous computer specialists don't show much interest in MPL - it's very different from classical computing.

Signalless adder, with loop-controlled bit shift[edit]

A demonstration of an extremely exotic logic discipline, which works without signals and thus needs no mechanisms to build. All input consists of minecart weights, minecart speeds and presence/absence of carts. Those parameters can be translated into distinct pathing decisions of carts and used for data (i.e. minecart) processing.

Thread: http://www.bay12forums.com/smf/index.php?topic=138595.0 Movies: http://mkv25.net/dfma/movie-2661-signallesseight-bitadder http://mkv25.net/dfma/movie-2662-advancedsignallesscalculator