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.
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.
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.
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.
| Sbar | Rbar | Next Q |
|---|---|---|
| 0 | 1 | 1 set |
| 1 | 0 | 0 reset |
| 1 | 1 | Hold previous |
| 0 | 0 | Forbidden undefined |
| 0→1 | 0→1 | Race undefined |
| 1→0 | 1→0 | First to arrive wins |
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.
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.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.