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.

Difference between revisions of "User talk:SL/Logic Gates"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Regarding the Repeater)
 
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Regarding the Repeater ==
+
== One Pump, Many Gates? ==
 +
Why use one pump per gate -- why not use one pump for many gates?  They certainly have lots of water flow.  I have a screw pump raise water, fill a raised pool, emptying into logic gates, with arrangements to cut off the water and drain the pool when maintenance is necessary.
  
Actually there ARE faster versions of this - that's 2 or more desyncronized repeaters. --[[User:Digger|Digger]] 05:33, 1 March 2008 (EST)
+
Also, here is a very simple oscillator (repeater).  Water enters the cell in the lower left, crossing the closed hatch.  When the water rises high enough, the pressure plate(set 5-7 in my case, tune as you like) opens the hatch and dumps to empty space/river channel/etc below the hatch.  It can't empty the cell completely but doesn't need to, since a slight lowering is enough to register a 0 on the pressure plate and restart the sequence.
 +
<pre>
 +
###
 +
#^#
 +
#H#
 +
~##
 +
</pre>
 +
 
 +
One could modify this a bit to make a small register.  To set the bit, open the floodgate(X) to let water fill the cell;  this will trigger the pressure plate for a logic 1 that will persist until the water dries up.  To clear the bit, open the hatch(H) to empty the contents of the memory cell.  You may want to have the pressure plate 'active off' since dumping a cell empty might respond faster than filling it up.  Having both the floodgate and hatch open at the same time is disallowed.  This is not quite a flip-flop;  it's more like a single bit of DRAM.
 +
<pre>
 +
###
 +
#^#
 +
#H#
 +
#X#
 +
~~~
 +
</pre>
 +
 
 +
Here's something more like an R/S flip-flop, as yet untested, providing equal and opposite outputs.  The hatches are the logic inputs.  The left pressure plate closes the right floodgate when submerged, and the right pressure plate closes the left floodgate when submerged;  opening the left hatch will thus flood the right cell and vice versa.
 +
<pre>
 +
#####
 +
#^#^#
 +
#H#H#
 +
#X#X#
 +
~~~~~
 +
</pre>
 +
04:25, 11 October 2008 (EDT)
 +
 
 +
== The Repeater ==
 +
 
 +
Actually there ARE faster versions of this - that's 2 or more desynchronized repeaters. --[[User:Digger|Digger]] 05:33, 1 March 2008 (EST)
 +
 
 +
Can anyone else get the repeater to work without using masterpiece mechanisms in the pressure plates?  I can't, so I'm assuming you need masterpiece mechanisms.  Too bad I don't have a mechanic capable of that yet >_< --[[User:Sukasa|Sukasa]] 23:07, 5 April 2008 (EDT)
 +
 
 +
I can't get it to work how it's shown there.  I found that if you move the left pressure plate one tile to the left, it starts to work nicely.  Voila, you have a Clk line for the rest of your mad dwarfputer (I'm currently working on a project for a Turing Machine but I haven't worked out the details yet.  Advice would be appreciated - I'm new to dwarfputing) [[User:Soundandfury|soundandfury]] 16:27, 11 January 2009 (EST)
 +
 
 +
Re: The Memory setup.
 +
 
 +
In the current example; You can't actually build it. It took me a bit of thinking and working, but I managed to make a system that efficiently (as far as I could tell) used space to make memory switches or registers, depending on what you want to call them.
 +
 
 +
Start with:
 +
<pre>
 +
################
 +
###_#_#<#_#_####
 +
###.#.#.#.#.####
 +
###.#.#.#.#.####
 +
###...#.#...####
 +
#_._._..._._._##
 +
#_.....>....._#~
 +
#_._._..._._._##
 +
###...###...####
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
###_#_###_#_####
 +
################</pre>
 +
 
 +
This is one z below ground. The #'s are walls that are NOT mined out. < is Stair Up, > is Stair Down. _ is a Channel, .'s are mined out. The ~ is a Water Source, NOT infinite. Use a pool! (If it's infinite, the water flowing back down won't be able to...
 +
 
 +
While you're in the Mining mood, go down a z-level and clear out AT LEAST this one z level lower:
 +
<pre>
 +
################
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
#.#.#.###.#.#.##
 +
#......<......##
 +
#.#.#.###.#.#.##
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
###.#.###.#.####
 +
################</pre>
 +
 
 +
Note that this is the minimum required; If you're using a large pool you'll need more to make sure you don't flood your mechanism level.
 +
 
 +
Place hatches on all the channels EXCEPT the far left and far right triple channels. Place axles, gears, and Pressure Plates so you end up with:
 +
<pre>
 +
################
 +
###¢#¢#<#¢#¢####
 +
###^#^#.#^#^####
 +
###.#.#.#.#.####
 +
###.*.#.#.*.####
 +
#_.¢|¢...¢|¢._##
 +
#_--*..>..*--_#~
 +
#_.¢|¢...¢|¢._##
 +
###.*.###.*.####
 +
###.#.###.#.####
 +
###^#^###^#^####
 +
###¢#¢###¢#¢####
 +
################</pre>
 +
 
 +
Finally, put waterwheels over the channels, hung off of the axles. You *should* be able to figure out where the pumps should go, but remember to link your hatches and pressure plates BEFORE building the pumps, because you won't be able to reach them again without digging another stair. To get the water to flow, you just dig out that wall between the water wheel and the pool by digging a channel one z above it. I'm not *sure*, but you may need to put a second or third water wheel inline with the first one for this to actually provide you enough power. STILL, this setup gives you a grand total of 8 memory registers, plenty to do whatever you want with whatever devious traps you have in mind. (I use it to operate bridges over magma channels.) Have fun! --[[User:CrushU|CrushU]] 00:23, 21 April 2008 (EDT)
 +
 
 +
== Traditional R/S Flip Flop ==
 +
I wanted a kind of switch that could be operated by soldiers, which meant pressure plate input only.  Rather than try and build a toggler I built a flip-flop;  one pressure plate flips it into one state, the other pressure plate flips it back to the other.  Therefore I can mass my soldiers by the defensive bridge and have it drop automatically, then station a soldier on the closing plate when the madness is all done.
 +
 
 +
Note that, like any traditional flip-flop, it expects active-1 inputs.  Hooking up pressure plates directly will just feed it 00 all the time, I had to put the pressure plate inputs through fluid inverters first.
 +
 
 +
<pre>~~~~~~~
 +
#BB#BB#
 +
#^###^#
 +
#.###.#
 +
#######</pre> Please note, that is four bridges, not a pair of 2-unit bridges.  The bridges tilt upwards to block water.  And those pressure plates are water 3-7.
 +
 
 +
The left pressure plate directly operates the right outer brige, and the right pressure plate directly operates the left outer bridge.  The two inner bridges are driven by pressure plates after being fed through inverters(not pictured).
 +
 
 +
It tends to oscillate for a little bit when first given water unless you keep a dwarf on one(and ONLY one!) of the input plates.  After that it is pretty stable.  Switching states is very reliable but not especially fast.  It consumes very little water since 3 out of 4 bridges will be closed at nearly all times.
 +
 
 +
Avoiding bridges to replace them with doors would mean adding two inverters to the flip-flop and removing two from the inputs...  Hmm...  The speed increase could well be worth it, further research may be necessary.  (That sound?  It's soggy dwarves, crying.)
 +
 
 +
We really need a 'fluid logic' page, but until there is one, people seem to be adding their designs here...  --[[User:Corona688|Corona688]] 14:41, 5 May 2009 (UTC)

Latest revision as of 14:45, 5 May 2009

One Pump, Many Gates?[edit]

Why use one pump per gate -- why not use one pump for many gates? They certainly have lots of water flow. I have a screw pump raise water, fill a raised pool, emptying into logic gates, with arrangements to cut off the water and drain the pool when maintenance is necessary.

Also, here is a very simple oscillator (repeater). Water enters the cell in the lower left, crossing the closed hatch. When the water rises high enough, the pressure plate(set 5-7 in my case, tune as you like) opens the hatch and dumps to empty space/river channel/etc below the hatch. It can't empty the cell completely but doesn't need to, since a slight lowering is enough to register a 0 on the pressure plate and restart the sequence.

###
#^#
#H#
~##

One could modify this a bit to make a small register. To set the bit, open the floodgate(X) to let water fill the cell; this will trigger the pressure plate for a logic 1 that will persist until the water dries up. To clear the bit, open the hatch(H) to empty the contents of the memory cell. You may want to have the pressure plate 'active off' since dumping a cell empty might respond faster than filling it up. Having both the floodgate and hatch open at the same time is disallowed. This is not quite a flip-flop; it's more like a single bit of DRAM.

###
#^#
#H#
#X#
~~~

Here's something more like an R/S flip-flop, as yet untested, providing equal and opposite outputs. The hatches are the logic inputs. The left pressure plate closes the right floodgate when submerged, and the right pressure plate closes the left floodgate when submerged; opening the left hatch will thus flood the right cell and vice versa.

#####
#^#^#
#H#H#
#X#X#
~~~~~

04:25, 11 October 2008 (EDT)

The Repeater[edit]

Actually there ARE faster versions of this - that's 2 or more desynchronized repeaters. --Digger 05:33, 1 March 2008 (EST)

Can anyone else get the repeater to work without using masterpiece mechanisms in the pressure plates? I can't, so I'm assuming you need masterpiece mechanisms. Too bad I don't have a mechanic capable of that yet >_< --Sukasa 23:07, 5 April 2008 (EDT)

I can't get it to work how it's shown there. I found that if you move the left pressure plate one tile to the left, it starts to work nicely. Voila, you have a Clk line for the rest of your mad dwarfputer (I'm currently working on a project for a Turing Machine but I haven't worked out the details yet. Advice would be appreciated - I'm new to dwarfputing) soundandfury 16:27, 11 January 2009 (EST)

Re: The Memory setup.

In the current example; You can't actually build it. It took me a bit of thinking and working, but I managed to make a system that efficiently (as far as I could tell) used space to make memory switches or registers, depending on what you want to call them.

Start with:

################
###_#_#<#_#_####
###.#.#.#.#.####
###.#.#.#.#.####
###...#.#...####
#_._._..._._._##
#_.....>....._#~
#_._._..._._._##
###...###...####
###.#.###.#.####
###.#.###.#.####
###_#_###_#_####
################

This is one z below ground. The #'s are walls that are NOT mined out. < is Stair Up, > is Stair Down. _ is a Channel, .'s are mined out. The ~ is a Water Source, NOT infinite. Use a pool! (If it's infinite, the water flowing back down won't be able to...

While you're in the Mining mood, go down a z-level and clear out AT LEAST this one z level lower:

################
###.#.###.#.####
###.#.###.#.####
###.#.###.#.####
###.#.###.#.####
#.#.#.###.#.#.##
#......<......##
#.#.#.###.#.#.##
###.#.###.#.####
###.#.###.#.####
###.#.###.#.####
###.#.###.#.####
################

Note that this is the minimum required; If you're using a large pool you'll need more to make sure you don't flood your mechanism level.

Place hatches on all the channels EXCEPT the far left and far right triple channels. Place axles, gears, and Pressure Plates so you end up with:

################
###¢#¢#<#¢#¢####
###^#^#.#^#^####
###.#.#.#.#.####
###.*.#.#.*.####
#_.¢|¢...¢|¢._##
#_--*..>..*--_#~
#_.¢|¢...¢|¢._##
###.*.###.*.####
###.#.###.#.####
###^#^###^#^####
###¢#¢###¢#¢####
################

Finally, put waterwheels over the channels, hung off of the axles. You *should* be able to figure out where the pumps should go, but remember to link your hatches and pressure plates BEFORE building the pumps, because you won't be able to reach them again without digging another stair. To get the water to flow, you just dig out that wall between the water wheel and the pool by digging a channel one z above it. I'm not *sure*, but you may need to put a second or third water wheel inline with the first one for this to actually provide you enough power. STILL, this setup gives you a grand total of 8 memory registers, plenty to do whatever you want with whatever devious traps you have in mind. (I use it to operate bridges over magma channels.) Have fun! --CrushU 00:23, 21 April 2008 (EDT)

Traditional R/S Flip Flop[edit]

I wanted a kind of switch that could be operated by soldiers, which meant pressure plate input only. Rather than try and build a toggler I built a flip-flop; one pressure plate flips it into one state, the other pressure plate flips it back to the other. Therefore I can mass my soldiers by the defensive bridge and have it drop automatically, then station a soldier on the closing plate when the madness is all done.

Note that, like any traditional flip-flop, it expects active-1 inputs. Hooking up pressure plates directly will just feed it 00 all the time, I had to put the pressure plate inputs through fluid inverters first.

~~~~~~~
#BB#BB#
#^###^#
#.###.#
#######

Please note, that is four bridges, not a pair of 2-unit bridges. The bridges tilt upwards to block water. And those pressure plates are water 3-7.

The left pressure plate directly operates the right outer brige, and the right pressure plate directly operates the left outer bridge. The two inner bridges are driven by pressure plates after being fed through inverters(not pictured).

It tends to oscillate for a little bit when first given water unless you keep a dwarf on one(and ONLY one!) of the input plates. After that it is pretty stable. Switching states is very reliable but not especially fast. It consumes very little water since 3 out of 4 bridges will be closed at nearly all times.

Avoiding bridges to replace them with doors would mean adding two inverters to the flip-flop and removing two from the inputs... Hmm... The speed increase could well be worth it, further research may be necessary. (That sound? It's soggy dwarves, crying.)

We really need a 'fluid logic' page, but until there is one, people seem to be adding their designs here... --Corona688 14:41, 5 May 2009 (UTC)