Difference between revisions of "Carsten Milkau/D-Latch"
From Unofficial Stationeers Wiki
< User:Carsten Milkau
(Restructuring) |
(enabled -> enable) |
||
Line 8: | Line 8: | ||
!colspan="3"|'''inputs'''||'''outputs''' | !colspan="3"|'''inputs'''||'''outputs''' | ||
|- | |- | ||
− | ! | + | !enable||data||previous output||output |
|- | |- | ||
|0||''x''||''y''||''y'' | |0||''x''||''y''||''y'' | ||
Line 17: | Line 17: | ||
=== Connectors === | === Connectors === | ||
− | * | + | * enable: if 1, store ''data'', else do nothing. |
− | * | + | * data: input |
− | * | + | * output: stored value |
== Relation to Multiplexer (Logic Select Unit) == | == Relation to Multiplexer (Logic Select Unit) == | ||
Line 32: | Line 32: | ||
<ol> | <ol> | ||
− | <li>a Logic Select Unit determines whether to store the last output or the "data" input using the " | + | <li>a Logic Select Unit determines whether to store the last output or the "data" input using the "enable" input. i.e. |
− | <pre> if | + | <pre> if enable |
then store = data | then store = data | ||
else store = output</pre></li> | else store = output</pre></li> | ||
Line 46: | Line 46: | ||
! Unit name || Unit type || Connector / Setting || Source / Value | ! Unit name || Unit type || Connector / Setting || Source / Value | ||
|- | |- | ||
− | | select 1 || Logic Select Unit || select || ''' | + | | select 1 || Logic Select Unit || select || '''enable''' (input) |
|- | |- | ||
| || || 0 (input 1) || reader 1 | | || || 0 (input 1) || reader 1 |
Revision as of 15:50, 18 July 2018
A d-latch is a circuit that stores the last value seen at its "data" input while its "enable" input was on.
Contents
Definition
inputs | outputs | ||
---|---|---|---|
enable | data | previous output | output |
0 | x | y | y |
1 | x | y | x |
Connectors
- enable: if 1, store data, else do nothing.
- data: input
- output: stored value
Relation to Multiplexer (Logic Select Unit)
In theory, a single multiplexer (Logic Select Unit) can do this (selector input = enable, input 1 = output, input 2 = data, 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.
Implementation Using Logic Select Unit and Logic Reader
This d-latch can store any value. It works in two steps:
- a Logic Select Unit determines whether to store the last output or the "data" input using the "enable" input. i.e.
if enable then store = data else store = output
- a Logic Reader mirrors the value to be stored and feeds it 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.
output = store
Unit name | Unit type | Connector / Setting | Source / Value |
---|---|---|---|
select 1 | Logic Select Unit | select | enable (input) |
0 (input 1) | reader 1 | ||
1 (input 2) | data (input) | ||
reader 1 | Logic Reader | in | select 1 |
var | setting | ||
out | output (output) |