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:Immibis/RAM
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 1: | Line 1: | ||
− | + | Please note that the content of this page is (currently) only an idea and has not been tested. | |
− | |||
==Space-efficient Random Access Memory== | ==Space-efficient Random Access Memory== | ||
Line 6: | Line 5: | ||
The overall layout is like this: | The overall layout is like this: | ||
− | Z-1 | + | Z -1 |
x x x x x = wall | x x x x x = wall | ||
x x x x H = hatch | x x x x H = hatch | ||
x x x x All the hatches in a single (horizontal) row are connected to one pressure plate | x x x x All the hatches in a single (horizontal) row are connected to one pressure plate | ||
− | x | + | x x x x D = door for access |
− | |||
x x x x | x x x x | ||
x x x x | x x x x | ||
− | Z 0 Z+1 | + | x x x x |
+ | Z 0 Z +1 | ||
xxxxxxx xxxxxxx | xxxxxxx xxxxxxx | ||
− | xHxHxHx x | + | xHxHxHx x x x x |
− | + | xxxxxxx xxDxxxD | |
− | xHxHxHx x | + | xHxHxHx x x x x |
xxxxxxx xxxxxxx | xxxxxxx xxxxxxx | ||
− | xHxHxHx x | + | xHxHxHx x x x x |
− | + | xxxxxxx xxDxxxD | |
− | continued for a while in each direction | + | continued for a while in each direction. |
− | The number of rows | + | The number of rows should be a power of two, the number of columns doesn't have to be. |
The values would be stored in the cells on Z+1. | The values would be stored in the cells on Z+1. | ||
Line 40: | Line 39: | ||
This is a destructive read, so the data must be rewritten afterwards. | This is a destructive read, so the data must be rewritten afterwards. | ||
− | To write a 1 to a cell | + | To write a 1 to a cell: |
− | # Flood all columns to Z0. | + | # Flood all columns except the desired column to Z0. Flood the desired column to Z1. |
# Open the hatches in the desired row. | # Open the hatches in the desired row. | ||
− | |||
# Water will flow into the cell, if it isn't already there. | # Water will flow into the cell, if it isn't already there. | ||
− | To write a 0 to a cell | + | To write a 0 to a cell: |
− | # Flood all columns except the desired column to Z0. | + | # Flood all columns except the desired column to Z0. Drain the desired column. |
− | |||
# Open the hatches in the desired row. | # Open the hatches in the desired row. | ||
# Water will flow out of the cell, if it's there. | # Water will flow out of the cell, if it's there. | ||
Line 113: | Line 110: | ||
The read, write-0 and write-1 inputs can be connected together for every column, if there is a way of disconnecting individual columns from all three at once. | The read, write-0 and write-1 inputs can be connected together for every column, if there is a way of disconnecting individual columns from all three at once. | ||
+ | |||
+ | The control logic needs to do the following (in any order or simultaneously), for any operation: | ||
+ | * Disconnect inputs to all unused columns, so they will be pumped to Z0. | ||
+ | * Send the appropriate signals for 'read', 'write-1' and 'write-0' (one will be true, indicating the operation to be performed) | ||
+ | It then needs to open the hatches for the particular row '''after a delay''', by opening the floodgate to let water into the row control machinery. | ||
+ | |||
+ | write-0 = LATCH(SET = write-operation AND NOT data, RESET = NOT busy) | ||
+ | write-1 = LATCH(SET = (write-operation AND data) OR read-output, RESET = NOT busy) | ||
+ | read = LATCH(SET = (read-operation AND NOT read-sensor), RESET = NOT busy) | ||
+ | read-output = LATCH(SET = read-sensor, RESET = NOT busy) | ||
+ | busy = LATCH(SET = start, RESET = DELAY(start)) | ||
+ | (none of this has been tested) | ||
+ | |||
+ | start, write-operation, read-operation are inputs to the device. | ||
+ | read-output is an output from the device. | ||
+ | read-sensor is generated by OR'ing together all the sensing pressure plates. | ||
+ | read-operation and write-operation should probably be latched when 'start' becomes true. | ||
The address is used as follows: | The address is used as follows: | ||
* As mentioned earlier, the number of rows MUST be a power of two, but the number of columns doesn't need to be. | * As mentioned earlier, the number of rows MUST be a power of two, but the number of columns doesn't need to be. | ||
* If there are 2^N rows, the lower N bits of the address go directly to the row control machinery. | * If there are 2^N rows, the lower N bits of the address go directly to the row control machinery. | ||
− | * The upper bits of the address select which | + | * The upper bits of the address select which row's inputs aren't disconnected. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |