0% found this document useful (0 votes)
5 views11 pages

S-R Latch Tutorial and Circuit Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views11 pages

S-R Latch Tutorial and Circuit Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

The S-R Latch (Quickstart Tutorial) [Link]

com/s-r-latch/

The S-R Latch (Quickstart Tutorial)


October 27, 2022 by Omar Muñoz Urias

The S-R latch is a key circuit in digital storage units. In this tutorial, you will
learn how it works, its truth table, and how to build one with different logic
gates.

S-R Latch Symbol

What is an S-R Latch?


Before starting with the S-R latch you need to know what a latch is. A latch
is an asynchronous circuit (it doesn’t require a clock signal to work), and it
has two stable states, HIGH (“1”) and LOW (“0”), that can be used for
storing binary data. Many sequential circuits and larger storage devices,
such as shift registers, use latches as their principal building block.

The simplest latch is the Set-Reset (S-R) latch. You can build one by

1 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

connecting two NOR gates with a cross-feedback loop.

S-R Latch with NOR gates

This feedback path is crucial to storing one bit of data as long as the
circuit is powered. In this circuit, the upper gate has the S input and the
main output Q, while the lower gate has the R input and the inverted
output Q̅ .

How does the S-R Latch work?


First of all, let’s define the truth table of the S-R latch:

Input S Input R Output Q

0 0 Previous State

0 1 0

1 0 1

2 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

Input S Input R Output Q

1 1 0 (Invalid)

S-R Latch truth table

Now, let’s analyze how the S-R latch works using its truth table and its
circuit with NOR gates. Remember that the NOR gate only gives “1” when
both inputs are “0”, with any other input combination the output is “0”.

You can see in the truth table that when both inputs S and R are equal to
“0”, the output Q remains the same as it was. This is the memory function
of the S-R latch because it saves the previous value. Suppose the Q output
is “1” in the present state. If you now place both inputs in “0”, then the
output will remain “1” as follows:

Then, how would you “Reset” the Q output to “0”? Well, as you can see in
the truth table, you need a “1” in the R input and a “0” in the S input.

3 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

10 Simple Steps to Learn Electronics


Electronics is easy when you know what to focus on and what to
ignore. Learn what "the basics" really is and how to learn it fast.

First Name

Email Address

Download Guide

4 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

But, if you want to “Set” a “1” in the Q output just follow the truth table
and place a “1” in the S input and a “0” in the R input.

Finally, the S and R inputs should never be “1” at the same time because
the NOR gate only gives “1” when both of its inputs are “0”, but if one
input is “1”, then the output will be “0”. As a result, if S and R are “1”, both

5 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

latches’ outputs will be “0” at the same time, something that violates this
latch’s working principle.

SR-LATCH WITH NAND GATES


The S-R Latch can also be built using two NAND gates:

S-R Latch with NAND gates

In the above circuit, you might have noticed slight differences from the
one with NOR gates. Now the inputs have been swapped, with the S input
in the upper gate and the R input in the lower gate. In addition, the inputs
have been negated.

It works the same way as with NOR gates, just that the inputs are inverted.
Here’s the truth table:

Input S Input R Output Q

6 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

Input S Input R Output Q

1 1 Previous State

1 0 0

0 1 1

0 0 0 (Invalid)

Truth table for S-R Latch with NAND gates

Example Circuit
As a practical example, you can build an SR latch using the CD4001 chip.
Below you can see how the CD4001 has four NOR gates inside, making it
ideal for this kind of application.

7 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

The circuit works as follows: when the button PB2 is pushed, the LED L2
turns on and stays on even after PB2 is released, while the LED L1 remains
off. LED L2 turns off when the button PB1 is pressed, whereas LED L1 turns
and stays on even after PB1 has been released. To assemble the above
circuit you need:

• The CD4001 chip


• Two push buttons (PB1 and PB2)
• Two LEDs
• Two 10 kΩ resistors (R1 and R2)
• Two 330 Ω resistors (R3 and R4)

Questions?
Do you have any questions about S-R Latch? Let me know in the
comments below.

More Digital Electronics Tutorials


• The Binary Number System
• Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR
The S-R Latch
• The D Latch
• The D Flip-Flop
• The JK Flip-Flop
• The T Flip-Flop
• The Shift Register
• Binary Adders: The Half Adder
• Binary Adders: The Full Adder
• How To Use Open Collector Outputs

8 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

• 4000 Series IC Tutorials


• 7400 Series IC Tutorials

Get Our Basic Electronic Components


Guide
Learn how the basic electronic components work so that circuit
diagrams will start making sense to you.

First Name

Email Address

Download Guide

More Digital Electronics Tutorials

The Binary Number System


Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR

9 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

The S-R Latch


The D Latch
The D Flip-Flop
The JK Flip-Flop
The T Flip-Flop
The Shift Register
Binary Adders: The Half Adder
Binary Adders: The Full Adder
How To Use Open Collector Outputs
4000 Series IC Tutorials
7400 Series IC Tutorials

Other Topics

Circuit Calculators & Converters

Maker Lifestyle

Newsletter Archive

Podcast

Blog

Social:

10 z 11 18.07.2024, 12:44
The S-R Latch (Quickstart Tutorial) [Link]

Facebook

Twitter

YouTube

Products

Electronics Course

Other Products

All contents are Copyright © 2024 by Ohmify AS

11 z 11 18.07.2024, 12:44

Common questions

Powered by AI

Logic gates such as AND, OR, NAND, and NOR are fundamental building blocks in digital storage units. They perform basic logical functions that are essential for the construction of complex digital circuits like latches, flip-flops, and shift registers. NOR and NAND gates, in particular, are used to construct S-R latches, the simplest form of memory storage that can store a single bit of binary data, which is critical for forming larger storage devices .

The CD4001 chip contains four NOR gates within a single integrated circuit, making it ideal for constructing an S-R latch by using two of these gates. This integration simplifies circuit design by reducing the number of discrete components required. The user can directly use the gates on the chip to create the cross-feedback loop necessary for the memory function of the S-R latch, thus providing a compact and efficient design solution .

Teaching digital circuit concepts to beginners poses challenges, such as making abstract concepts like logic gates and asynchronous operations relatable and tangible. Beginners must master foundational knowledge in binary logic, gate functions, and circuit behavior without becoming overwhelmed. Tutorials often aim to simplify these topics through visual aids, step-by-step instructions, and interactive components, yet the complexity in understanding feedback loops and state retention in circuits like S-R latches requires a gradual contextual buildup and frequent practical application to reinforce learning .

An S-R latch using NOR gates requires the Set (S) and Reset (R) inputs to be 0 to maintain the existing output state, either 0 or 1. Contrarily, an S-R latch with NAND gates operates with inverted logic, meaning 1 inputs are needed to maintain the previous state. Additionally, with NOR gates, the invalid state occurs when both inputs are 1, while in NAND gate configurations, it happens when both inputs are 0. Thus, the NAND-based version essentially inverts the logic required on inputs to yield similar output behavior .

Using asynchronous circuits like latches in larger sequential circuits affords certain advantages and challenges. Asynchronous latches, like the S-R latch, do not require clock signals, allowing for simplicity and potentially faster operation since they can change states immediately upon input changes. However, this lack of synchronization can lead to unreliable operations due to race conditions and edge-triggered errors if not carefully managed. In contrast, synchronized circuits, such as flip-flops, use clock signals to precisely control state changes, providing predictability and coordination within complex systems .

Open collector outputs enhance logic circuit functionality by allowing multiple outputs to be connected to a single line, with the line pulled to a high state using a pull-up resistor. This permits multiple gating conditions to be realized within a single circuit without encountering conflicting signals, essential for creating wired-AND logic configurations. It also facilitates the direct connection of logic level signals with circuit components that operate at different voltages, broadening the versatility and application of logic circuits in various electronic systems .

Understanding both SR latches and more complex sequential circuits like flip-flops is vital in digital system design as they fundamentally differ in synchronization and functionality. Latches provide asynchronous state control, useful in simple toggling and temporary data storage, but can lead to timing issues in larger systems. Flip-flops, being synchronous, introduce precise timing control through clock signals, which is essential in maintaining state consistency across all system components. Knowing these differences allows for optimal design strategies to achieve desired performance and reliability in digital systems .

The cross-feedback loop in an S-R latch with NOR gates is essential for its operation as it provides a way to store binary data by maintaining the state of the outputs. When both inputs S and R are 0, the output Q stays in its previous state, which is the memory function of the latch. By having the output of each NOR gate connected to one of the inputs of the other gate, any change in input results in both gates updating their outputs based on the other gate's output, thus maintaining the state of the latch .

The invalid state in an S-R latch occurs when both the S and R inputs are 1 simultaneously. Under these conditions, both NOR gates output 0 simultaneously, conflicting with the design of the latch, which relies on one output being the inverse of the other. This inconsistent state cannot represent a valid binary value and undermines the stability of the latch, leading to unpredictable behavior. Avoiding this invalid state is crucial for ensuring reliable circuit operation .

To reset the Q output to 0 in an S-R latch using NOR gates, the R input needs to be set to 1 while the S input is maintained at 0. This combination ensures that the NOR gate outputs on the R side generate a low state, consequently forcing the cross-feedback loop to maintain a zero state at the Q output. This resetting process is crucial in binary data storage as it provides a method to reliably change the state to store binary '0', thus enabling toggling between binary states required for data manipulation and retention .

You might also like