Actions

User

Editing Carsten Milkau/RS-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:
An RS-latch is a circuit that stores which of its inputs was last "on". It has typically two inputs: input ''reset'' storing value "0" and input ''set'' storing value "1", hence the name. It can have multiple outputs (possibly inverted), which typically differ mostly in their behavior when multiple inputs are "on" at the same time. Usually, it is considered illegal to set more than one input to "on", but sometimes this is used deliberately (e.g. when constructing an [[Edge-Triggered RS-Latch]]).
+
== RS-latch ==
  
== Definition ==
+
An RS-latch is a circuit that stores which of its inputs was last "on". It has typically two inputs: input ''reset'' storing value "0" and input ''set'' storing value "1", hence the name. It can have multiple outputs, which typically differ mostly in their behavior when multiple inputs are "on" at the same time.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 19: Line 19:
 
|}
 
|}
  
It is possible to define a variant with more than two values. Also, the values stored need not necessarily be 0 and 1.  
+
It is possible to define a variant with more than two values. The values stored need not necessarily be 0 and 1.  
  
 
=== Connectors ===
 
=== Connectors ===
  
* Reset: Stores the first value (typically 0)
+
* Enabled: if 1, store ''data'', else do nothing.
* Set: Stores the second value (typically 1)
+
* Data: input
* Output1: Stored value (first value if in illegal state)
+
* Output: stored value
* Output2: Stored value (second value if in illegal state)
 
  
=== Illegal State ===
+
=== Using Logic Select Unit and Logic Reader ===
  
If multiple inputs are on at the same time, the latch is considered in "illegal state". In principle, the RS-latch assumes both values at once, which circulate through the latch when both inputs turn off immediately (see value table), i.e. the latch becomes a [[Clock]]. This is usually undesired, but can be useful in some cases.
+
[[File:D-latch.png|thumb|D-latch using select unit and reader]]
  
== Implementation Using Logic Select Units ==
+
This d-latch can store any value. It works in two steps:
  
[[File:RS-Latch Using Select Units.png|thumb|An RS-Latch implemented using two Logic Select Units and two Logic Memory units]]
+
<ol>
 +
<li>a Logic Select Unit determines whether to store the last output or the "data" input using the "enabled" input. i.e.
 +
<pre>  if enabled
 +
  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>
  
This RS-latch can store arbitrary values. It can also easily be extended to support more than two different values. It consists of a loop of [[Kit (Logic Processor)#Logic Select Unit|Logic Select Units]], each connected to a dedicated memory cell (or other data source). If all inputs are off, the values circulate in the loop. If one input is on, its corresponding value is read from the respective memory cell and replaces all values in the loop (unless an additional input is on).
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 43: Line 48:
 
! Unit name || Unit type    || Connector / Setting || Source / Value
 
! Unit name || Unit type    || Connector / Setting || Source / Value
 
|-  
 
|-  
| select 1  || Logic Select Unit  || select       || '''reset''' (input)
+
| select 1  || Logic Select Unit  || select         || '''enabled''' (input)
 
|-
 
|-
|          ||              || 0 (input 1)         || select 2
+
|          ||              || 0 (input 1)   || reader 1
 
|-
 
|-
|          ||              || 1 (input 2)         || "0" (constant)
+
|          ||              || 1 (input 2)   || '''data''' (input)
 
|-
 
|-
|           ||              || output              || '''output1''' (output)
+
| reader 1 || Logic Reader || in            || select 1
|-
 
| select 2 || Logic Select Unit  || select        || '''set''' (input)
 
|-
 
|          ||              || 0 (input 1)        || select 1
 
 
|-
 
|-
|          ||              || 1 (input 2)        || "1" (constant)
+
|          ||              || var            || setting
 
|-
 
|-
|          ||              || output              || '''output2''' (output)
+
|          ||              || out            || '''output''' (output)
 
|}
 
|}

Please note that all contributions to Unofficial Stationeers Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Unofficial Stationeers Wiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)