Difference between revisions of "SR Latch"

From Coder Merlin
m (Clarifying that when Q is high it is true, and when it is low it is false, because I had some trouble understanding this.)
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:Gate latch.jpg|thumb|Gate latch]]
[[File:Gate latch.jpg|thumb|Gate latch]]
== Prerequisites ==
== Curriculum ==
* [[W1013 Boolean Algebra]]
{{MerlinCurriculumData|{{ROOTPAGENAME}}}}
* [[W1014 Logic Gates]]
* [[W1016 Logic Composition]]
== Background ==
== Background ==
Our memory enables us to remember an event after the original stimulus is gone.  A ''latch'' is a device used to fasten something into place.  In the case of an SR Latch, the role is to latch a single, binary digit enabling it to ''remember'' a value even after the original value (stimulus) is no longer present.
Our memory enables us to remember an event after the original stimulus is gone.  A ''latch'' is a device used to fasten something into place.  In the case of an SR Latch, the role is to latch a single, binary digit enabling it to ''remember'' a value even after the original value (stimulus) is no longer present.
Line 9: Line 7:
We've learned a lot about Boolean algebra and logic gates and how composition enables us to construct complex functionality from simple components.  However, all functionality which we've considered so far presents an instantaneous value for output based upon the ''current'' input values.  One of the most basic requirements of a computer is an ability to remember (or '''store''') values for later use.  This experience will describe one means of storing values by building a latch out of the logic gates with which we are already familiar.
We've learned a lot about Boolean algebra and logic gates and how composition enables us to construct complex functionality from simple components.  However, all functionality which we've considered so far presents an instantaneous value for output based upon the ''current'' input values.  One of the most basic requirements of a computer is an ability to remember (or '''store''') values for later use.  This experience will describe one means of storing values by building a latch out of the logic gates with which we are already familiar.
== The SR Latch ==
== The SR Latch ==
In electronics, a latch is a circuit that has two stable states and can be used to store information.  One of the most fundamental of these latches is an '''SR Latch'''.  An SR Latch is able to ''capture'' its input value and preserve that value for use at a later time.  An SR Latch has two inputs:  The first is labeled '''set''' (or just ''S''); its role is to set the output <math>Q</math> high; the second is labeled '''reset''' (or just ''R''); its role is to reset the output <math>Q</math> to make it low.  <math>\overline{Q}</math> will always be the negated value of <math>Q</math>.  The interesting aspect of a latch, however, is that when we set ''both set and reset'' to low.  In this case, the latch will hold the previous value, i.e. the new value of <math>Q</math> at time ''t'', <math>Q_t</math>, will be equal to the value at time ''t''-1, <math>Q_{t-1}</math>.   
In electronics, a latch is a circuit that has two stable states and can be used to store information.  One of the most fundamental of these latches is an '''SR Latch'''.  An SR Latch is able to ''capture'' its input value and preserve that value for use at a later time.  An SR Latch has two inputs:  The first is labeled '''set''' (or just ''S''); its role is to set the output <math>Q</math> high, or true; the second is labeled '''reset''' (or just ''R''); its role is to reset the output <math>Q</math> to make it low, or false.  <math>\overline{Q}</math> will always be the negated value of <math>Q</math>.  The interesting aspect of a latch, however, is that when we set ''both set and reset'' to low.  In this case, the latch will hold the previous value, i.e. the new value of <math>Q</math> at time ''t'', <math>Q_t</math>, will be equal to the value at time ''t''-1, <math>Q_{t-1}</math>.   
{| class="wikitable"
{| class="wikitable"
! Reset  
! Reset  
Line 93: Line 91:
== Exercises ==
== Exercises ==
{{W1018-Exercises}}
{{W1018-Exercises}}
== Excursions ==
{{W1018-Excursions}}
== References ==
== References ==
* [https://en.wikibooks.org/wiki/Digital_Circuits/Latches Latches] (Wikibooks)
* [https://en.wikibooks.org/wiki/Digital_Circuits/Latches Latches] (Wikibooks)
{{Experience
|experienceID=W1018
|experienceUnit=Boolean algebra
|knowledgeAndSkills=§10.332
|topicAreas=Boolean algebra
|classroomTime=30 minutes
|studyTime=1 hour
|acquiredKnowledge=understand the construction and use of SR latches as the conceptual basis for memory
|acquiredSkill=demonstrate proficiency in constructing and using SR latches
}}

Revision as of 18:03, 7 September 2021

Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder
Gate latch

Curriculum[edit]

ExercisesIcon.png
 Coder Merlin™  Computer Science Curriculum Data

Unit: Boolean algebra

Experience Name: SR Latch (W1018)

Next Experience: ()

Knowledge and skills:

  • §10.332 Demonstrate understanding and proficiency in the use of SR latches

Topic areas: Boolean algebra

Classroom time (average): 30 minutes

Study time (average): 60 minutes

Successful completion requires knowledge: understand the construction and use of SR latches as the conceptual basis for memory

Successful completion requires skills: demonstrate proficiency in constructing and using SR latches

Background[edit]

Our memory enables us to remember an event after the original stimulus is gone. A latch is a device used to fasten something into place. In the case of an SR Latch, the role is to latch a single, binary digit enabling it to remember a value even after the original value (stimulus) is no longer present.

Introduction[edit]

We've learned a lot about Boolean algebra and logic gates and how composition enables us to construct complex functionality from simple components. However, all functionality which we've considered so far presents an instantaneous value for output based upon the current input values. One of the most basic requirements of a computer is an ability to remember (or store) values for later use. This experience will describe one means of storing values by building a latch out of the logic gates with which we are already familiar.

The SR Latch[edit]

In electronics, a latch is a circuit that has two stable states and can be used to store information. One of the most fundamental of these latches is an SR Latch. An SR Latch is able to capture its input value and preserve that value for use at a later time. An SR Latch has two inputs: The first is labeled set (or just S); its role is to set the output high, or true; the second is labeled reset (or just R); its role is to reset the output to make it low, or false. will always be the negated value of . The interesting aspect of a latch, however, is that when we set both set and reset to low. In this case, the latch will hold the previous value, i.e. the new value of at time t, , will be equal to the value at time t-1, .

Reset Set State
0 0 Latch
0 1 Set 1 0
1 0 Reset 0 1
1 1 Forbidden undefined undefined

An SR Latch may be easily constructed using two NOR gates:

RS Flip-flop (NOR)

Note that the SR Latch relies on feedback in order to maintain its state.

SR Latch Graph[edit]

Carefully consider the following SR Latch graph:
SR Latch Graph.png
The x-axis indicates the time, in milliseconds, progressing rightward. The y-axis indicates the voltage, individually, for S (Set), R (Reset), and Q (output). In table form, this would appear as:

Time (ms) S (Set) R (Reset) Q (Output)
0 H L H
10 L L H
20 L L H
30 L H L
40 L H L
50 L L L
60 L L L
70 H L H
80 L L H
90 L L H
100 L L H

Observe the following state changes:

  • At 0ms, S is high causing the output to go high (set).
  • At 10ms, both S and R are low and the system enters a latch state. Because the previous output was high, it remains high (set).
  • At 20ms, the system remains in a latch state. Because the previous output was high, it remains high (set).
  • At 30ms, R is high causing the output to go low (reset).
  • At 40ms, R remains high; the output remains low (reset).
  • At 50ms, both S and R are low and the system enters a latch state. Because the previous output was low, it remains low (reset).
  • At 60ms, the system remains in a latch state. Because the previous output was low, it remains low (reset).
  • At 70ms, S is high causing the output to go high (set).
  • At 80ms, both S and R are low and the system enters a latch state. Because the previous output was high, it remains high (set).
  • At 90ms, the system remains in a latch state. Because the previous output was high, it remains high (set).
  • At 100ms, the system remains in a latch state. Because the previous output was high, it remains high (set).

Key Concepts[edit]

Key ConceptsKeyConceptsIcon.png
  • An SR Latch is able to capture its input value and preserve that value for use at a later time
  • An SR Latch has two inputs:
    • set (or just S)
    • reset (or just R)
  • An SR Latch's output is labeled
    • is set to high (set) when set (S) is high
    • is set to low (reset) when reset (R) is high
    • holds (latches) its previous value, when both S and R are low
  • An SR Latch can be easily constructed using two NOR gates
  • An SR Latch relies on feedback in order to maintain its state

Exercises[edit]

Template:W1018-Exercises

Excursions[edit]

Excursions101 138 Boeheimkirchen 070430.jpg

While an SR Latch is fully capable of remembering a single bit of information, it's generally not used to build a memory cell because it lacks the ability to perform synchronously with a clock signal. In order to synchronize the data with a clock signal, rather than use a latch, we generally use a device called a "flip-flop". One of the most basic designs is called a D-type Flip Flop.

  • Research a D-type Flip Flop
  • Construct a D-type Flip Flop using Falstad's Editor using only AND, OR, NOT, XOR, NOR, and NAND gates.
  • Export each circuit using the File | Export As Text... option from the menu bar
  • The text contains all of your work for the exercise. Select the entire text, copy it, and paste it into your journal using the correct excursion number.
  • Answer the following questions:
    • What additional functionality does a D-type Flip Flop provide that is unavailable in an SR Latch?
    • How do the inputs to a D-type Flip Flop differ from the inputs of an SR Latch?
    • How does a D-type Flip Flip protect against the forbidden state of an SR Latch?

References[edit]


Experience Metadata

Experience ID W1018
Next experience ID
Unit Boolean algebra
Knowledge and skills §10.332
Topic areas Boolean algebra
Classroom time 30 minutes
Study time 1 hour60 minutes <br />
Acquired knowledge understand the construction and use of SR latches as the conceptual basis for memory
Acquired skill demonstrate proficiency in constructing and using SR latches
Additional categories