MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How a basic RS flip-flop is built and how its states change
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (600 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How a basic RS flip-flop is built and how its states change

The basic RS flip-flop is the smallest memory element: two cross-coupled NAND gates. This page shows how it holds a state, how set and reset flip it, and which input combination is forbidden.

1. How it works

The basic RS latch is two 2-input NAND gates cross coupled: the output Q of one gate feeds an input of the other, the Qbar output feeds back, and the two remaining inputs are the active-low set Sbar and reset Rbar. The cross-coupled positive feedback makes the circuit hold whatever state it falls into until power is removed. It is the ancestor of every clocked flip-flop memory cell.

2. Numbers and practice

State table: Sbar 0 with Rbar 1 forces Q to 1, the set action. Sbar 1 with Rbar 0 forces Q to 0, the reset. Both at 1 keeps the previous state, which is the memory. Both at 0 is forbidden: both outputs sit at 1, the Q and Qbar complement rule breaks, and releasing them together leaves the state undefined. So in normal operation never drive both inputs low.

3. Pitfalls and fixes

Strengths and limits: it is simple and directly level controlled, but the inputs are level sensitive with no clock gating, so noise can false-trigger it, and the forbidden state exists. Industry uses it mainly for switch debouncing or as the lowest-level latch, while real sequencing goes to clocked flip-flops. Buffer the Q output with an LED or a gate instead of driving heavy loads directly.

4. Basic RS flip-flop state quick reference

SbarRbarNext Q
011 set
100 reset
11Hold previous
00Forbidden undefined
0→10→1Race undefined
1→01→0First to arrive wins

5. Notes

For switch debouncing connect Sbar and Rbar to the two sides of the key through pull-up resistors; the output is then stable and glitch free. Never let Sbar and Rbar both go low; add interlocking if necessary.

6. References

The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Flip-flops and latches per GB/T 4728 symbols and IEC 60748 series. Always check the device datasheet and the product design file for ratings and derating.

7. Cautions

⚠️ Three common pitfalls:
① Sbar and Rbar low together then released together:state undefined, which side wins is luck and system behavior uncontrolled
② Level sensitivity mistaken for edge action:noise flips it at once because there is no clock gating
③ Q output driving a heavy load directly:Q sags and the complementary relationship breaks

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL