Actions

User

Difference between revisions of "Carsten Milkau/D-Latch"

From Unofficial Stationeers Wiki

< User:Carsten Milkau
(Created page with "== D-latch == 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||x...")
 
m (Carsten Milkau moved page Carsten Milkau/D-Latch to User:Carsten Milkau/D-Latch: This was supposed to be a user page.)
 
(14 intermediate revisions by the same user not shown)
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.
+
== Definition ==
  
{|
+
{| class="wikitable"
|enabled||data||previous output||output
+
|+ value table
 +
|-
 +
!colspan="3"|'''inputs'''||'''outputs'''
 +
|-
 +
!enable||data||previous output||output
 
|-
 
|-
|0||x||y||y
+
|0||''x''||''y''||''y''
 
|-
 
|-
|1||x||y||x
+
|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 ===
 +
 
 +
* enable: if 1, store ''data'', else do nothing.
 +
* data: input
 +
* output: stored value
 +
 
 +
== Relation to Multiplexer (Logic Select Unit) ==
  
=== Connectors ===
+
In theory, a single multiplexer ([[Kit_(Logic_Processor)#Logic_Select_Unit|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.
  
* Enabled: if 1, store ''data'', else do nothing.
+
== Implementation Using Logic Select Unit and Logic Reader ==
* Data: input
 
* Output: stored value
 
  
=== Using Select and Reader Unit ===
+
[[File:D-latch.png|thumb|D-latch using select unit and reader]]
  
 
This d-latch can store any value. It works in two steps:
 
This d-latch can store any value. It works in two steps:
  
==== Step 1 : Selection ====
+
<ol>
a select unit determines whether to output the "stored value" or the "data" input using the "enabled" input. i.e.  
+
<li>a Logic Select Unit determines whether to store the last output or the "data" input using the "enable" input. i.e.  
 +
<pre>  if enable
 +
  then store = data
 +
  else store = output</pre></li>
 +
<li>a [[Kit_(Logic_I/O)#Logic_Reader|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.
 +
<pre>  output = store</pre></li>
 +
</ol>
  
  if enabled
 
  then output = stored
 
  else output = data</code>
 
  
==== Step 2: Feedback ====
+
{| class="wikitable"
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.
+
|+ Circuit setup
 
+
|-
  stored = output
+
! 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)
 +
|}

Latest revision as of 16:07, 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.

Definition[edit]

value table
inputs outputs
enable data previous output output
0 x y y
1 x y x

Connectors[edit]

  • enable: if 1, store data, else do nothing.
  • data: input
  • output: stored value

Relation to Multiplexer (Logic Select Unit)[edit]

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[edit]

D-latch using select unit and reader

This d-latch can store any value. It works in two steps:

  1. 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
  2. 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


Circuit setup
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)