Editing Carsten Milkau/D-Latch
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
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: | ||
+ | == D-latch == | ||
+ | |||
A d-latch is a circuit that stores the last value seen at its "data" input while its "enable" input was on. | A d-latch is a circuit that stores the last value seen at its "data" input while its "enable" input was on. | ||
− | + | {| | |
− | + | |enabled||data||previous output||output | |
− | {| | ||
− | |||
− | | | ||
− | |||
− | |||
− | |||
|- | |- | ||
− | |0|| | + | |0||x||y||y |
|- | |- | ||
− | |1|| | + | |1||x||y||x |
|} | |} | ||
+ | |||
+ | In theory, a single [[Kit_(Logic_Processor)#Logic_Select_Unit|select unit]] can do this (selector input = enable, input 1 = data, input 2 = output, output = output). In practice, this is not possible as the game does not allow it to have its own output as input. However, several constructions using two or more circuits are possible. | ||
=== Connectors === | === Connectors === | ||
− | * | + | * Enabled: if 1, store ''data'', else do nothing. |
− | * | + | * Data: input |
− | * | + | * Output: stored value |
− | == | + | === Using Select and Reader Unit === |
− | + | This d-latch can store any value. It works in two steps: | |
− | |||
− | |||
− | |||
− | |||
− | + | ==== Step 1 : Selection ==== | |
+ | a select unit determines whether to output the "stored value" or the "data" input using the "enabled" input. i.e. | ||
− | + | if enabled | |
− | + | then output = stored | |
− | + | else output = data</code> | |
− | then | ||
− | else | ||
− | |||
− | |||
− | </ | ||
+ | ==== Step 2: Feedback ==== | ||
+ | a reader unit feeds the output value back into the select unit so it can circulate (effectively being stored). This would be obsolete if the select unit could read its own output. | ||
− | + | stored = output | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |