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

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 111: Line 111:
 
}}
 
}}
  
1 Track/ramps  
+
1. Track/ramps  
 
   
 
   
2 engraved track on the ramps in the pits   
+
2. engraved track on the ramps in the pits   
  
3 buildings   
+
3. buildings   
  
4 space-saving expansion using a door to "e"nable the cell, designed by Nil Eyeglazed/VasilN.
+
4. space-saving expansion using a door to "e"nable the cell, designed by Nil Eyeglazed/VasilN.
  
 
In the "off" state, the cart remains in the northern ramp-pit, because its exit is blocked by the closed hatch to the south.  
 
In the "off" state, the cart remains in the northern ramp-pit, because its exit is blocked by the closed hatch to the south.  
Line 170: Line 170:
 
   ║^  ║║  ▼    ^▲▲▲    ╚╔║╗
 
   ║^  ║║  ▼    ^▲▲▲    ╚╔║╗
 
   ▼╗  ║╗  d¢      ###    ###
 
   ▼╗  ║╗  d¢      ###    ###
  e¢▲# ╚║#  ^     III.a   III.b
+
  e¢▲# ╚║#  ^     3.a     3.b
 
   ##  ##  ▼
 
   ##  ##  ▼
   I.a I.b  ☺
+
   1.a 1.b  ☺
 
           eG
 
           eG
 
           #
 
           #
 
           #
 
           #
           II.
+
           2.
  
 
}}
 
}}
Line 190: Line 190:
 
e - building that moderates the delay for returning the cart
 
e - building that moderates the delay for returning the cart
  
I.: building-moderated delay, lateral bypass
+
1.: building-moderated delay, lateral bypass
  
 
d & e are activated by the read signal: the door lets a "set" cart out of its pit. It passes over the pressure plate ''once'' and then cycles through the four-tile circle in the very south; the cart must come in at the correct speed for the orbit to properly establish and remain stable. Once hatch e closes again, the cart leaves straight to the north (instead of SE while circling) and returns to the "set" pit.  
 
d & e are activated by the read signal: the door lets a "set" cart out of its pit. It passes over the pressure plate ''once'' and then cycles through the four-tile circle in the very south; the cart must come in at the correct speed for the orbit to properly establish and remain stable. Once hatch e closes again, the cart leaves straight to the north (instead of SE while circling) and returns to the "set" pit.  
  
II.: building-moderated, vertical bypass
+
2.: building-moderated, vertical bypass
  
 
Instead of keeping the cart in motion until the read signal turns off, this design makes use of the different delays for different buildings. In the south, there's a floor grate over a bunker pit. When a read is performed, an "on" cart leaves its pit to the south, touches the pressure plate and comes to rest on the grate. The grate takes 100 steps to open. At this point, the cart drops into the pit, picks up speed and leaves to the north. Immediately north of the grate, it passes over a tile of ordinary floor (here engraved with a friendly face) before facing a pit. Since it comes from normal floor, the cart ignores the pit (has no downward connection and wouldn't change the cart's speed in any way) and jumps instead. The jump is far enough that the cart passes over the pressure plate north of the pit without touching it. The assumption is that by this time the actual read signal has timed out again and the read hatch is already closed, keeping the cart constrained in the holding pit.
 
Instead of keeping the cart in motion until the read signal turns off, this design makes use of the different delays for different buildings. In the south, there's a floor grate over a bunker pit. When a read is performed, an "on" cart leaves its pit to the south, touches the pressure plate and comes to rest on the grate. The grate takes 100 steps to open. At this point, the cart drops into the pit, picks up speed and leaves to the north. Immediately north of the grate, it passes over a tile of ordinary floor (here engraved with a friendly face) before facing a pit. Since it comes from normal floor, the cart ignores the pit (has no downward connection and wouldn't change the cart's speed in any way) and jumps instead. The jump is far enough that the cart passes over the pressure plate north of the pit without touching it. The assumption is that by this time the actual read signal has timed out again and the read hatch is already closed, keeping the cart constrained in the holding pit.
  
III.: path-moderated, lateral bypass
+
3.: path-moderated, lateral bypass
  
 
Of course, we can also give a cart enough path that it takes 100+ steps to return to the holding pit (assuming the read request is produced by a short-term signal that shuts the requesting building after about 100 steps). It uses the same "ramp comb" as the third model of a clock repeater. The sole difference is that the corner at the entrance to the array ensures that the cart enters it in the middle of the tile, so that it takes only 15 passes over the central displacement ramp to exit the array, giving a total return delay of about 160 steps.  
 
Of course, we can also give a cart enough path that it takes 100+ steps to return to the holding pit (assuming the read request is produced by a short-term signal that shuts the requesting building after about 100 steps). It uses the same "ramp comb" as the third model of a clock repeater. The sole difference is that the corner at the entrance to the array ensures that the cart enters it in the middle of the tile, so that it takes only 15 passes over the central displacement ramp to exit the array, giving a total return delay of about 160 steps.  
Line 237: Line 237:
  
 
With my concept of storing information purely in minecart weights and evaluating sets of carts selectively i managed to circumvent the problem to a degree: with eight different weight groups of carts, each cart can hold three bits of information, and reading can be grouped - you only read one set of carts at a time, while several other sets are kept in readiness. Consequently, i managed to build a memory array holding 768 bits of information at a cost of under 500 mechanisms. The downside is that this kind of memory would be extremely laborious and slow to write to, i never considered using it as anything other than a ROM. At three bits per cart, it also took over 200 minecarts to fill. A full kilobyte implemented like this may cost "only" 2000-3000 mechanisms, but it would also require about 2500 minecarts, each individually selected, placed and put in motion.
 
With my concept of storing information purely in minecart weights and evaluating sets of carts selectively i managed to circumvent the problem to a degree: with eight different weight groups of carts, each cart can hold three bits of information, and reading can be grouped - you only read one set of carts at a time, while several other sets are kept in readiness. Consequently, i managed to build a memory array holding 768 bits of information at a cost of under 500 mechanisms. The downside is that this kind of memory would be extremely laborious and slow to write to, i never considered using it as anything other than a ROM. At three bits per cart, it also took over 200 minecarts to fill. A full kilobyte implemented like this may cost "only" 2000-3000 mechanisms, but it would also require about 2500 minecarts, each individually selected, placed and put in motion.
 
===Appendix: Destructive Reading===
 
 
If our memory cell has a constantly-active output, we're in trouble when we want to reference only one of several cells for use by another device. Transmitting the "state" of one of several cells to a receiver can be done by AND gates, e.g. mechanically:
 
 
{{Diagram|spaces=yes|\
 
.
 
Power in
 
  ║
 
┤┤┤┤┤┤ "distributor" roller
 
☼☼☼☼☼☼ state 1-6
 
☼☼☼☼☼☼ select 1-6
 
┤┤┤┤┤┤ "collector" roller
 
  ║
 
Power out
 
}}
 
 
Each "state" gear assembly is linked to the output of a memory cell.
 
Each "select" gear assembly is linked to a "read selector".
 
Power will come out (and activate whatever we've placed to the south) when both the state and the select gear of (at least) one cell are active at the same time. Having the gears next to each other doesn't pose a problem, since power only passes gears in cardinal directions; power can only get to a select gear - and through it to the collection roller and output - if the state gear of the very same cell is engaged.
 
 
Clearly, this method works, but it requires a fair number of mechanisms installed and dissipates quite a bit of power.
 
 
But we can reduce the architecture cost by reading the cells destructively. "Destructive read" means that we ''change the state of the memory cell'' and observe whether the output changes or stays the same. If the output changes, the cell was previously in the opposite state, if not, it was already in the "written" state. I've come up with two basic premises:
 
 
A - output to door or hatch, relevant is the last signal received, requiring flipping.
 
 
Under this premise, we link ''all'' the outputs we wish to collect to a single piece of furniture, preferably a door or hatch cover. In DF switching, furniture always takes on the state of the ''last valid signal'' it received. So if a door is linked to ten different memory cells, it doesn't matter if one or nine of the cells are in "on" state, it only matters if the last change in memory cells was from "off" to "on" or vice versa. To read a memory cell in this way, we
 
* first send a signal cycle to the door ("on" signal, followed normally by "off"), shutting it.
 
* send a "write" signal to the memory cell we wish to test, setting it to a specific value, either "on" or "off". The cell must have an output plate that goes active in the position we're setting the cell to in the read operation. I.e. if we read by turning the cell off, we must have an output plate that's active when the cell's off.
 
-> If the cell changes state, the door opens. If the cell stays in the same state, the door remains shut.
 
* now we test the shut/open state of the door with a logic device, e.g. by running a minecart so that it tries to pass, activating/deactivating the actual output.
 
 
The cost of this reading array consists of the door, its linkages, the testing mechanism for the door itself and a simple circuit to flip the door shut. We need no extra machinery for the destructive read itself - that's done by the same mechanism that's used for normally setting the cell to zero.
 
 
B - output to gear assembly, test via edge detector.
 
 
Gearboxes toggle their state whenever they receive a signal, no matter which kind. Thus, a gear assembly operates as a parity gate. Here, it doesn't matter what kind of signal was last received, it only matters if the ''total'' number of signals received since the gear was constructed is even or odd. We can simply link all our outputs to a single gear assembly, but of course, whether this assembly is deactivated or activated depends on how many memory cells in total are on or off. When we want to read a cell, we still just set it to a given state, but  now we only know that the gear assembly's state ''will change if the memory cell's state changes''. We cannot know whether it'll engage or disengage. Thus, we need something that only gives output upon state changes (a.k.a. an edge detector). Fortunately, that's pretty simple with minecart-actuated mechanical logic:
 
 
{{Diagram|spaces=yes|\
 
.       
 
#    # 
 
┬┴    ▲   
 
^┴☼  ║ 
 
┬┴    ║ 
 
#    # 
 
.
 
}}
 
 
To the left, the buildings. There are two rollers, both pushing to the north; one on the southern end, one on the northern end of the track. The northern tile is a track ramp with NS track. Power goes through the switched gear, distributed by a three-tile NS roller (push direction irrelevant, only used to provide power and hold up the roller on the ramp).
 
 
When power is provided, a minecart on the track will remain on the ramp, held at its "top" by the roller. When power turns off, the cart rolls off the ramp, across the central tile and comes to rest on top of the southern roller, against the wall. When power turns on again, the cart crosses the central tile once more and gets dragged "up" the ramp by the northern roller.
 
 
The result is indeed that this device produces no output in a stable "on" or "off" state, but does produce one signal cycle (on followed ~100 steps later by an off) everytime power supply changes. And since power supply changes everytime the gear assembly toggles, that produces our output. Evidently, this thing not only produces a signal cycle during reading, but when writing as well. We need further machinery to make sure the output is only processed when we actually want to read something. Still, the main cost of this reading mechanism is again the single gear assembly and its links. We don't need to "flip" our gear like a door before reading, making the reading process much faster. Once again, the reading itself is done by the normal mechanism that writes the reference state to the memory cell.
 
 
 
Two final notes:
 
 
Destructive reads, as the name implies, destroy the memory state they read. We can restore the cell's state from the output generated, if we so desire, but that means extra effort.
 
 
Destructive reading allows relatively cheaper largish memory, but it still only reduces the cost per-bit from about a dozen to at best six mechanisms.
 

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)

Templates used on this page: