Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 4

Author Topic: Programmable Dwarven Computer. With Minecarts.  (Read 16152 times)

Larix

  • Bay Watcher
    • View Profile
Programmable Dwarven Computer. With Minecarts.
« on: January 19, 2015, 05:39:44 pm »



Links for further documentation:
Data Sheet and code reference

Control Logic

Program Listings

Usage advice for the savefile

Map

Savefile (0.34.11)

Excessively large write-up on much of the theory and praxis behind the thing

I'd messed around with minecart logic for quite a while and when i worked out ways to make an adressable memory cell and mass data storage with them, i decided to try building a computer. In the early conceptual stages i decided i was not going to untangle program and data coming from a shared bus and completely separated program and data storage. Since my mass storage concept looked like a good model for expanded program storage, the instruction length worked off the three bits encoded per cart in the mass storage. Thus, the computer uses six-bit instructions, a three-bit operator and a three-bit operand. It operates on ten-bit data: since program and data storage are separate, there's no need whatsoever to use the same or even related register sizes.

In spite of the tiny instruction set, the computer can access output (the line above is the result of a "print to screen" program) and do basic mathematical operations, albeit impressively slowly: addition is trivial, since it's one of the actual instructions, but the computer can also subtract (by constructing the binary complement first), multiply, divide, calculate a Fibonacci sequence (limited by the ten bits, of course) or...

calculate square roots:



The bottom line contains the actual number, the top line the square root. (sqrt of 840 is 28).

Spoiler: program (click to show/hide)

The program was started on 24 Moonstone 268 and finished 12 Malachite 269 - six months and 17 days, 185 days total. Barring accounting errors, those were 567 program steps, at a rate just over three operations per day, 392 steps per operation, 35,47 microurist clock rate by dwarven time, ~ 50 millihertz realtime.

A map has been uploaded: http://mkv25.net/dfma/map-12378-faintedposts

Bits and pieces

User interface



The place to interact with the machine. From here, you can enter program code, set the data registers, set the status bits, connect/cut main power, reset the computer, directly load the first program module from the ROM into active program storage, keep track of the main registers' contents and of the four status bits, shut down the main registers...

and of course start the computer.

It's riddled with more or less helpful notes; i wouldn't find my own way around it otherwise.

Memory cells

I use three different types of read-/writeable memory cells. I could have done with only two types, but kept the powered-cell register in the end, as an hommage to the pioneers of minecart computing. While it takes a lot of mechanisms and is power-dependent, it's fast, reliable and probably quite intuitive for people more into pure mechanical logic.

1. Linear read/write latch



Data register A, containing 0000 011 100 (28). These are ten memory cells, built horizontally, with "double-action" read, write-adressable.

Spoiler (click to show/hide)

Most memory cells i built here used this design.

2. Settable flipflop with optional carry generation



Three cells of the first counting register (register D).

Interlinks between individual cells allow the register to count up or down and cells can easily be written to. Reading its state is more complicated, it has to be done through a separate evaluation circuit.

I'm afraid the construction is a bit too complicated to convey it here. The core is a three-ramp pit with a single hatch cover over the "corner" tile:

Spoiler (click to show/hide)

3. Powered latch



Six bits of memory using Tinypirate's variant of the powered minecart memory cell (first published in Bloodbeard's minecart computation thread).

Spoiler (click to show/hide)

The ten-bit register draws 265 power before input has established, not at all trivial when the entire computer draws 1380 in standby and rarely over 1650 in operation.

Signal bundling

Every main register bank has ten enabling doors and twenty read hatches. There are several operations which write to or read from a register. To avoid having to link all those buildings up to each function, i collected them to a bank of "control" circuits. This way, "write to register A" can be done by establishing a single link to that control circuit. As a simple case of expedience, i also collected the "write to program memory" commands like this: while i could have gotten away with a single "clear all program memory" function, that would have meant linking 48 doors and hatch covers to a single plate. That could easily have taken over half a year to do. In the interest of my own sanity, i collected the functions through eight "clear" and eight "write" controllers.

The obvious downside to such indirect operation is that it introduces reaction delay: a signal sent directly to the targetted building switches the building instantly, a signal sent via control circuit only arrives once the control circuit has responded. It will also only turn off after the control circuit's plate has recovered.

Spoiler: why not keep it simple (click to show/hide)

The remote circuit i settled for introduces a delay, but that delay is absolutely constant and signal length does not expand.



Write control.

All writing to active memory, clearing the buffer or program memory and reading from the buffer and registers A-C is done through such indirect devices.

Program instructions have their "read" commands triggered directly: each only gets activated in one case (when the instruction is needed for execution), affording no benefit from collected operation, _and_ since each possible operation has to pass this step, unnecessary delays here hurt the overall performance of the computer.

Spoiler (click to show/hide)

Mass Storage

By far most of the program code in this computer is stored in a type of ROM: 128 words of code in the bank, while only eight at a time are actually loaded. New code can be loaded into active memory (overwriting the previous contents) by the "load Module" instruction, and an additional status bit can switch between two banks of eight modules each. The actual program store is spacious but fairly unassuming (spoilered for size):

Spoiler (click to show/hide)

It's still fairly compact considering that it can store 768 bits on 75x36x2 tiles. just over 7 tiles per bit. Even more impressively, it does this with less than 500 mechanisms (including the entire adressing and output management). The secret is that information in the mass storage is encoded in minecarts of specified weights that are simply held in readiness in small ramped pits until their data is requested. Then they get released by opening an "output" bridge, weighed by four pressure plates which directly send set signals to the pre-cleared program latches and cycled around and back into their pit through an "input" bridge that's held open until all carts are safely returned; the output bridge closes again ~ 100 steps after it opened, quite a long time before carts have finished their round.

A pair of holding pits looks like this:
Code: [Select]
#####    #####    .B.B.
#═╚═#    #▲▲▲#    ═B.B═
#═╔═#    #▲▲▲#    ═B.B═
#####    #####    .I.O.
z-1, track  z-1     z+0

B - bridge
I - incoming
O - outgoing

enough to hold two minecarts, worth six bits or one program word. The impulse ramps in the pits linked to the walls prevent carts from bouncing back out of the pit after entering (from the west) - they can only leave the pit when the eastern "output" bridge opens.

Minecarts of seven weights (and no minecart as "zero" datum) are used to encode three bits of information per cart; sixteen carts (potentially fewer depending on presence of "000" code segments or unused words) make up a module of eight words, sixteen modules can be stored.

The principle of this mass storage is remarkably simple. It allowed me to build a computer with an extremely small active program memory without crippling computational capacity: longer programs are simply spread over multiple modules and loaded in succession.

Higher information density per cart is possible, and a denser packing of the module, too, but either would increase complication:

Spoiler (click to show/hide)

For added convenience, the module loaded in the first position can be transferred to the program memory by operating a dedicated lever in the control centre. The two-wide bridges over the return tracks can be raised to stop currently circling minecarts - this way, a program module can be unloaded.

"Programming" the ROM is a pretty slow and inelegant process: a cart must be deposited on a pressure plate operating the input bridges of the desired module and the correct-material minecarts assigned to sixteen routes (consisting of a single stop on the western end of the long straight path, with a "push east immediately" order). Entering one module of program code in this way takes two to three weeks.

Mechanical logic devices

1. Adder (not the animal)



The main tool for calculations, this machine adds two ten-bit numbers together. The correct sum rollers are instantly connected to power the moment the inputs are fully established. Reading the result and transferring it to the target register is done by roller-directed minecarts; since i insisted on the compactest possible layout for the adder itself (two lines per bit), logistics are a bit tricky.

The read-out procedure must be started with a notable delay, because inputs come from linear latches and have a "startup" latency of up to 35 steps.

Spoiler (click to show/hide)

2. The comparator



Compares two inputs, passes power (switching the path of a "measuring" minecart on the NE loop) when the tested-for condition is true.

Spoiler (click to show/hide)
« Last Edit: June 11, 2015, 02:56:53 pm by Larix »
Logged

Larix

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #1 on: January 20, 2015, 08:00:09 am »

Features of the Minecart computer:

Instruction size: six bit
Data register width: ten bit, unsigned

No unified clock, proper timing is ensured by various delay circuits. Average time per instruction about 400 game steps. Advancement through a largely self-regulated eight-slot ringcounter run by a single minecart.

Active program memory: eight words of six bit each, powerless minecart latches.

Data registers:

Buffer - for data exchange between registers, input/output. Ten bit, powerless minecart latches.
A, B, C: the three main operation registers. Ten bit, powerless minecart latches
D, E: two counter registers. Six bit, Toggle- and settable powerless "flipflops". Four bits of expansion allow them to be used for storage when not in use as counters.
F: pure storage register. Ten bit, powered memory cells, using the design by Bloodbeard/TinyPirate

Further data storage:
1. The Compact Readonly Adressable Minecart Program Store (short CRAMPS): sixteen modules, each containing sixteen minecarts, each of one of eight possible weights, encoding three bits per cart. Each module contains enough code to fill the active program memory. Each single module can be selected and loaded into program store by dedicated program instructions, greatly extending the possible program length: sixteen modules of eight words each mean the total capacity of the CRAMPS amounts to 128 words of program storage.

Currently, one access and three actual function programs as well as two "bonus" single-module programs are loaded into it, taking up all sixteen modules and encoding 123 program words, i.e 738 bits of information, using 214 minecarts.

The eight information-encoding minecart weights are:
000 - platinum minecart (only required in the top lane) or no cart at all - the latter could be used 32 times.
001 - wood of any type
010 - iron or brass
011 - tin, zinc or pewter
100 - electrum or gold
101 - lead
110 - copper or nickel
111 - silver

The system uses powerless carts, kept in motion by ramp glitches and directed by retracting/extending bridges. Three pairs of bridges are required for every module, the decoding plates for every "line" are shared between all sixteen modules, so the total number of mechanisms used to construct the program storage is smaller than the number of bits it can hold.

2. Additional data are stored in a kind of single-use tape, the Sequential High-density Read-Only-Once Memory (SHROOM). It uses the same basic concept as the CRAMPS, but can only read the datum at the "head" of the tape, other data cannot be accessed. The tape simply advances all later data to the next position automatically when the head datum is read. This process is achieved through ordinary bridges, the process takes a bit over 100 steps per position in the tape to finish. The tape as built holds sixteen ten-bit data; "used" data can be cycled around to the end of the tape if tape read accesses are sufficiently far apart (~1600 steps, four instructions), otherwise they must be "dumped". The tape is one-directional and read-only.
Data from the SHROOM are stored in the buffer, for later use as data to operate on. Sixteen ten-bit data give it a capacity of 160 bits.

Status register: four bits are held by dedicated circuits. They control whether or not jumps can take place, where write operations go to, which I/O devices are accessed and which half of the CRAMPS program modules are loaded from. The status bits can be set by hand or changed by program instructions.

The complete data capacity of the computer amounts to 6x8bits program store, 5x10 and 2x6 bits in data/counter registers, 4 status bits - 114 bits of writeable memory; 768 (CRAMPS) + 160 (SHROOM) bits in ROM storage, 1042 bit in total. It's an actual kilobit computer (even using the binary 2^10 convention).

The added "program tape" currently has a capacity of a further 24 modules (1152 bit). Those are implemented as SHROOM-type single-use sequential tape and no program is loaded at time of writing. In an infinite-size infinite-ressources embark, the tape would be unbounded.

Instructions

The instruction set is what allows doing quite a bit of basic computing with six-bit words. While the first and second three-bit parts of each instruction are decoded separately, it's not a simple operation+adress system. Operands often encode a notable variety of operations.

It's quite long, so i'll put it behind a
Spoiler (click to show/hide)

List of components, based on "installed" numbers in the stocks screen:
mechanisms: 6400
hatch covers: 540
bridges: 270
doors: 150-200 (250ish installed, but that includes bedroom doors)
grates: 26
floodgates: 3

waterwheels: 25. 20 would probably suffice, but i never bothered to look at power load in detail.
rollers: 233 (number of "installed" ropes)
~260 logs for axles

~360 minecarts

DF version: 0.34.11

Time consumed: 15 fort years. Over half a year (with long interruptions) real time.
INVADERS:NO
TEMPERATURE:NO - primarily to avoid trouble with the winter freeze, but it also helped quite a bit with FPS.

Otherwise, a normal fort with normal dwarfs - dwarf speed, food/drink/sleep requirements unchanged. 154 beards currently, fort rules a duchy but hasn't bothered to invite the bog standard monarch.

FPS in "standby" between 30 and 45. Operating the computer lowers FPS notably, to about 20 in low-intensity operations like jumps, single digits down to 4 when reading/writing data, especially when loading modules. FPS is drained almost entirely by opening and closing buildings, minecart pathing doesn't seem to matter much.
« Last Edit: February 27, 2015, 06:07:44 pm by Larix »
Logged

Di

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #2 on: January 20, 2015, 12:19:08 pm »

By Armoks beard...
I'm afraid the forum doesn't have enough dwarven science medals to award you accordingly.
Logged
Quote from: Creamcorn
Dwarf Fortress: Where you meet the limit of your imagination, moral compass, sanity and CPU processor.
http://www.bay12forums.com/smf/index.php?topic=103080.0 Fix sober vampires!
http://www.bay12forums.com/smf/index.php?topic=91442.0 Dwarven Cognitive Science

AbanShakehandles

  • Bay Watcher
    • View Profile
    • microscopes are fun
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #3 on: January 20, 2015, 12:23:36 pm »

I understand this about as well as Urist McRecruit understands his equipment orders,
but all the same, I applaud the hell out your accomplishments.
Logged
It's like we're looking
down on Wayne's basement, only
that's not Wayne's basement.

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #4 on: January 20, 2015, 01:09:45 pm »

Glad to see you are still working on shrinking the requirements for your general purpose dwarfputer Larix!

For everyone else:

Basically, Larix is working on making a custom designed computer architecture that is tailored to the unique constraints of the dwarf fortress simulation environment.  His goal seems to be the distillation of the most powerful computer possible, with the smallest number of parts possible.  Already, he has reduced the number of components down to a very small subset of previous dwarfputer designs.  He does this by constant experimentation with new logic circuit designs, and studious contemplation of reduced instruction set computing.  He is looking for the "ideal balance" between low component count, and computing power derived.

His current computer is a modified Harvard architecture computer-- That is to say, it has a lot in common with what Grace Hopper was developing COBOL on. Basically, a computer that has clearly separate program memory (holds the program instruction code) and data memory (Holds values used to make the evaluations or operations defined in the program).  This reduces the complexity of the computer tremendously, but reduces its usefulness, since the program code is read-only.  (Clever programmers can still make spectacular use of this architecture though)

In the above post, he describes the instruction word architecture he has created, the memory architecture he used, and the speed of execution. Using that information, a clever forumite could create an instruction compiler for this computer, allowing the use of a more well-known programming syntax to write the read-only tape.

I hope he manages to get his design down to under 2000 mechanisms some day.  A truly compact but powerful dwarfputer with an autofort template would open some interesting competitions for the more computationally inclined amongst us.  (The competition would not be to build the dwarfputer, but to make clever programs for it.) Currently, dwarfputing is a fringe element in dwarf fortress, because of the expense in time and resources required, and the precipitous drop in FPS that running one causes. A very small, compact, lean, and efficient dwarfputer could help change that. 

I want to encourage Larix to continue his efforts, as these kinds of diversions give a very good education in computational theory, and greatly hone logic skills.

Some of the obvious applications of a compact and high quality dwarfputer include automated stockpile/resource (water, Magma, etc) management, automated intruder detection and elimination with genuinely automated defenses, driving a display made of hatches to display pictures, automated trams of all kinds, and perhaps even programatically controlled magma casting at some point. (Dwarfputer controls dumping minecarts of magma and raising water levels inside a gantry to make large 3D structures, etc.)

A quick and painless dwarfputer can help remove some tedium from a well established fortress, if implemented well. Larix is doing the really hard work of prototyping and engineering such a computer. The task of hooking it up and programming it is much less complicated.  He deserves lots of kudos.
Logged

SirQuiamus

  • Bay Watcher
  • Keine Experimente!
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #5 on: January 20, 2015, 04:35:50 pm »

Considering that BaronW's calculator used 75 368 mechanisms, building a fully programmable computer with no more than 5940 is already a remarkable achievement, to say nothing of paring it down to 2000.
BTW, why do our modern-day computers still use these unwieldy things called transistors? Surely such outdated junk will eventually be displaced by minecart logic.
Logged

Dorsidwarf

  • Bay Watcher
  • [INTERSTELLAR]
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #6 on: January 20, 2015, 05:35:40 pm »

But surgimus! That's what electrons really are.

Current is the flow rate of minecarts.

Minecarts surround atoms.

When the Heisenburg effect kicks in, that's the minecarts derailing.
« Last Edit: January 20, 2015, 05:38:04 pm by Dorsidwarf »
Logged
Quote from: Rodney Ootkins
Everything is going to be alright

Larix

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #7 on: January 20, 2015, 08:59:39 pm »

Nah. Really tiny gears, that's where the future of computing lies. Once we figure them out, they'll be just perfect - instant response, toggle on every signal, no wires.

The big issue with the machine was getting all the timing right so that it could run autonomously. If you look at Jong's dwarven computer, you'll notice that it needs to be run manually, by a stream of "operate pump" commands, one for each substep of the fetch/execute cycle - it has no working system clock and cannot run by itself.

I didn't build an actual system clock - at the end of each instruction decoding event, a circuit gets triggered that starts the next program step, with a 250-step delay. With the delays from starting a program step to getting through the decoding sequence, that amounts to the quoted average instruction duration of 400 steps. Since each "read" command has an off-switch latency of 200-250 steps (it varies), that means data and program outputs can be active at the same time, but since program and data are entirely separate, they won't tangle.

Concerning mechanism count: i didn't build a few expansions i fully intend to add, just to stay under the 6000-mechanism mark. It'd be really difficult to get similar computational power with significantly fewer machinery. An adder will take several hundred mechanisms, a hundred bits of memory take at least a thousand, often quite a bit more.

In the meantime, i've fiddled a bit more with powerless minecart logic and came up with a pretty decent (although much less flexible) ring counter and a pretty fast decoder - using a very high-speed cart and doors (bridges are not fast - they take 100 steps to react to signals and can only switch carts moving below derail speed, ~2 ticks per tile of path). No indisputably better design for a memory cell, though. My weight-based system works well for read-only mass storage, but not for RAM.

PS: design for a powerless four-bit decoder, last iteration (saving mechanisms):



A very fast cart is needed to run this circuit, because switching is done by derailing vs. being deflected off closed doors. This switch doctrine allows using doors as "two-way" switches, i.e. most doors don't fork one cart path into two output paths, but two input paths into four outputs. Technically, a four-way fork would also be possible on a single door, but space requirements would become ludicrous.

Eight doors are controlled by the input; one door each by inputs one and two, two doors by input three, four doors by input four. This accurately sends the cart over one of sixteen pressure plates, according to the input bit pattern. Response time is short and reasonably constant, varying between ten and fifteen steps. This design keeps the cart ready constantly and resets itself. It could take a new signal ~ every 240 steps. The signals are so short that 100-delay buildings will not cycle but rather toggle when operated through them.

And the one thing that was still missing from my assortment of high-speed powerless circuits: a full adder. This is a ripple-carry adder, since minecarts don't compute instantly but rather at the speed of their movement. (Afterthought: well, one could conceivably run multiple adder cells "in parallel" and somehow look-ahead-calculate the carries for each bit before the carry's actually consulted. "Somehow", yeah. Any calculation under this doctrine consumes time, the more so when calculations get more complex - which they'll definitely do in actual look-ahead calculations. Good luck getting faster than the 10 steps per bit this single-cart ripple-carry adder achieves.)



A four-bit adder. It just calculated 7 + 12 + external carry-in = 20 (4 + overflow if thinking in four-bits).

Each adder cell requires all of three doors, two linked to the two input lines, one to the two pressure plates of the next lower cell that generate the carry. A third pressure plate per cell generates the output. The basic observation is that two doors can decode two bits worth of input into the full four outputs; A AND B gets pulled over its own plate to generate a carry, after that it can be recombined with A NOR B and the carry-in-governed door once again is pathed to provide a two-in-four-out split:
1. A=B (regardless of type) + no carry = no sum, no passed carry
2. A!=B + carry = pass the carry, no sum
3. A=B + carry = sum
4. A!=B + no carry = sum

2. is pulled over its own plate to output the carry, 3. and 4.'s paths are combined and guided over a shared plate to output the sum.

The adder takes about 10 steps per bit. Material cost: three doors and three pressure plates per bit, minimum of five linkages per bit (two inputs, two carry linkages, one output) = 13 mechanisms. A _bit_ less than the 24-36 mechanisms per bit in a fully mechanical adder.

Hmmm, at a moderate additional cost in mechanisms, it could send an _active_ "no-sum" signal as well, ideal to latch the result into a register without needing to clear it first.
« Last Edit: January 21, 2015, 07:50:52 pm by Larix »
Logged

Larix

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #8 on: January 22, 2015, 10:32:34 am »

First post has been slightly updated.

Since it was kind of overflowing, i'll put further design notes here.

Control logic

Building the logic components took a lot of time and mechanisms, but wasn't overly challenging. Building the circuits that actually told the components what to do and when was trickier. First of all, we need to read the next instruction from program memory, through a circuit that keeps track of progression through the positions.

1. Program counter

Spoiler (click to show/hide)



Spoiler: Paths only (click to show/hide)

The part at the bottom is a simple eight-position powered-minecart ring counter that wraps back to the start from position eight.

All the added pathing is there to allow program flow operations: skip next instruction (advances one position without triggering a program read) and jump to position (cart gets sent through the contraption to the north that splits the single path into eight output paths, governed by three bifurcations. These pathing variants are enabled by signals that disengage specific roller groups to let the cart pass through. The "jump target selector" in the north is disengaged entirely (automatically sending the cart to position 1) when resetting the system or whenever a new code module is loaded.

2. Decoder

     

A three-bit (operand) decoder, this one is specific to operation 111 (I/O, control). The basic concept of splitting a cart's path by providing power or no power to a roller should be well-known; it's a compact, fast method that i find easier to trace than gear linkages. The resultant paths in such a multi-function circuit aren't exactly intuitive, though. The main issue is that some of the functions send a standard "line up next instruction" command directly from the circuit, while several others send none (halt; request input at lever array) or from their own dedicated control circuit. Two of the instructions are further differentiated by the I/O control bit.

Spoiler (click to show/hide)

Timing

That was the big issue that was left to handle after the operative devices and control circuits were thought out. The big breakthrough in coming up with a computer design was coming upon the idea of separated areas for program and data storage; probably while reading up on computation basics, taking a closer look at microcontrollers, since those tend to be the simplest available chips capable of computational completeness. This architectural choice (a.k.a. Harvard architecture) combined with the minecart ringcounter, the operation of which is completely state-agnostic - it just takes an unspecific power pulse as input and the minecart resolves the progression simply by its current position - results in a pretty trivial

"Execution cycle":

- power to ring counter
- counter signal triggers instruction read
- primary decoder decodes top three bits of instruction to start signal to secondary decoder (or jump)
- secondary decoder decodes second three bits, directly triggering all signals running the operation, primes next counting step
- instruction executes
- power to ring counter

That's a pretty linear process, and the only requirements are:
1. no lingering instruction signals when a new instruction is read
2. no lingering operation signals (register reads/writes) when a new operation is triggered
3. no operations may take place before relevant active signals have definitely been established

1. and 2. are because doors and hatches always have the state of the _last_ signal received. If a new "on" is sent before the "off" of the last activation arrives, a building can be closed when it should be open. Gear assemblies can also be in the wrong switched state when there are outdated signals still hanging around. They are easy enough to secure against by limiting signal length and putting enough distance between program steps. Since program and data are separate, it doesn't matter when data signals are still live when a new instruction is read/decoded or program signals are still up when data are being read/operated on.

Sufficient distance is provided by using a standard 250-step delay cycle from fully decoding an instruction to triggering the next program count. This gives a fairly large temporal buffer, it could probably be reduced by 50 steps without changing latch design (much more could be cut out with more time-conscious memory cells).

3. is a rather fiddly issue. With minecarts, every action takes time, reading data out of a memory cell and indirect signal triggering add significant and sometimes irregular delays to signal output. Thus, it's necessary to put a delay between triggering the instruction read and triggering the primary decoder. In the add and compare operations, a delay must be put between requesting the input data and evaluating the result. In some write operations, the receiving location must first be set to zero because the input consists of "on" signals only. In those cases, care must be taken to make sure the "write zero" doesn't intersect with the "write positive input". The extra delays from indirect operation don't make this easier.

I also fiddled around with the "load new program module" operation to slightly limit the time it takes. It's still by far the slowest instruction to execute. Things aren't helped by the need to set the entire program memory to zero before reading the new module and that carts take several hundred steps for a cycle through the ROM device.


I think my lack of a computing background made me open to unorthodox approaches and let me shoot for simpler solutions where established conceptions of what computers are or should be might have led to insisting on features that would have been conceptionally more elegant without providing tangible benefits in the setting of DF computing, which is slow, clunky and ressource-hungry. Minecart logic definitely opens some interesting paths by offering arbitrary-lenght delays, "one-way" operation through paths and direct signal generation, not to mention variants based on different-weight carts and plates calibrated for them.
« Last Edit: January 22, 2015, 06:58:01 pm by Larix »
Logged

Baffler

  • Bay Watcher
  • Caveat Lector.
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #9 on: January 22, 2015, 10:36:31 am »

I understand this about as well as Urist McRecruit understands his equipment orders,
but all the same, I applaud the hell out your accomplishments.

Couldn't have said it better myself.
Logged
Quote from: Helgoland
Even if you found a suitable opening, I doubt it would prove all too satisfying. And it might leave some nasty wounds, depending on the moral high ground's geology.
Location subject to periodic change.
Baffler likes silver, walnut trees, the color green, tanzanite, and dogs for their loyalty. When possible he prefers to consume beef, iced tea, and cornbread. He absolutely detests ticks.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #10 on: January 22, 2015, 10:44:08 am »

* Orange Wizard ceremoniously pins the Dwarven Science Medal on Larix.
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Nikow

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #11 on: January 22, 2015, 01:00:12 pm »

I was proud of me, when i figureout how to use water as one bit memory cell to hold my bridge closed... Wonderfull job mr Larix!
Logged
In my fortress dwarves are dying from old age.
Dwarven wine is a little bit like good chicken soup:  solid at room temperature.

Badger Storm

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #12 on: January 22, 2015, 03:21:27 pm »

So you're using a game played on a real computer to make an in-game analog computer?  The very idea of this just makes my head hurt.  It's like fiddling around on a graphing calculator to create an abacus.
Logged

0rion

  • Bay Watcher
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #13 on: January 22, 2015, 04:17:43 pm »

So you're using a game played on a real computer to make an in-game analog computer?  The very idea of this just makes my head hurt.  It's like fiddling around on a graphing calculator to create an abacus.

I think the true and secret goal of Larix is to rewrite DF into DF itself... Eventually, that will lead to a DF spiral.
Anyway, great job here !
« Last Edit: January 22, 2015, 04:47:21 pm by 0rion »
Logged

laularukyrumo

  • Bay Watcher
  • Needs More Socks
    • View Profile
Re: Programmable Dwarven Computer. With Minecarts.
« Reply #14 on: January 22, 2015, 05:28:29 pm »

So you're using a game played on a real computer to make an in-game analog computer?  The very idea of this just makes my head hurt.  It's like fiddling around on a graphing calculator to create an abacus.

I think the true and secret goal of Larix is to rewrite DF into DF itself... Eventually, that will lead to a DF spiral.
Anyway, great job here !

People keep joking about this, but with the designs given here, it's really looking more like a matter of "when" than "if."

Larix, you are a goddamn pioneer. Forget the Dwarven Science Medal. You keep this up, I wouldn't be surprised to see your name in consideration for a Nobel.
Logged
Quote from: Dwarfotaur
Everytime one of my militia has given birth in the Danger Room, it's lead to instant baby smoothies for everyone.

Gotta Catch 'Em All!

Dat Sig Thread
Pages: [1] 2 3 4