4DVolt

Flip-Flop Circuit: How to Build an SR Latch Step by Step

Published on Oct 29, 2026

Illustration: Flip-Flop Circuit: How to Build an SR Latch Step by Step

A flip-flop is a circuit with two stable states that stores 1 bit: it “remembers” the last command it received. The simplest way to build one is to connect two NOR (or NAND) gates in cross-coupled feedback, forming an SR latch. From it come the D and T flip-flops, the basis of registers, counters and frequency dividers.

What a flip-flop is

Combinational circuits, such as logic gates, depend only on the inputs of the moment. The flip-flop is sequential: the output also depends on the previous state. That is why it is the basic memory cell of digital circuits. It has two complementary outputs, Q and Q̅ (Q inverted).

Step by step: SR latch with two NOR gates

1. Gather the components

Two NOR gates (a 7402 IC has four), two push buttons, two 10 kΩ resistors to hold the inputs at a low level (pull-down), two LEDs with 330 Ω resistors and a 5 V supply.

2. Wire them in cross-coupled feedback

The output of the first NOR goes to an input of the second, and the output of the second goes back to an input of the first. The free inputs are S (set) and R (reset). The output of the NOR that receives S is Q̅; the one that receives R is Q.

3. Test the four cases

SROutput QEffect
00HoldsMemory: keeps the last state
101Set: turns the output on
010Reset: turns the output off
11InvalidBoth outputs go to 0; avoid it

Press S and release: the Q LED lights up and stays on even with the button released. That is what defines memory. Press R and it goes off.

Loading the simulator…
Close S and open it again: the green LED (Q) stays on by itself. Close R and it goes off while the red one (Q̅) lights up. Closing both at once is the invalid state.

From the latch to the D and T flip-flops

  • D flip-flop: has a data input (D) and a clock input. On each rising edge of the clock, Q copies the value of D. It solves the invalid state of the SR and is the basis of registers.
  • T (toggle) flip-flop: on each clock pulse, the output flips. Connecting Q̅ back to the D input of a D flip-flop gives you this behavior and divides the clock frequency by 2. Chaining several forms a binary counter.

In practice, it is common to use a ready-made IC, such as the 7474 (two D flip-flops) or the 4013, instead of building it from gates.

Another “flip-flop”: the two-transistor blinker

With two NPN transistors, two capacitors and four resistors you can build an astable multivibrator, which alternates two LEDs without needing a clock. It does not store state, but it is often called a flip-flop in bench projects. The blink speed depends on R × C: with 47 kΩ and 10 µF, the LEDs swap roughly every 0.3 s (0.69 × R × C). See how to read these values in resistor color code and values and capacitor: types, codes and how to use it.

D and T flip-flop tables

TypeInputOn the clock rising edge
DD = 0Q goes to 0
DD = 1Q goes to 1
TT = 0Q holds
TT = 1Q toggles

What a flip-flop is used for

  • Registers: several D flip-flops in a row store a multi-bit word.
  • Counters: chained T flip-flops count in binary.
  • Frequency dividers: each stage divides the clock by 2.
  • Button debouncing: an SR latch cleans up the noise of the mechanical contact.
  • Memory: the static memory cell (SRAM) uses the same cross-coupled feedback.

Common mistakes when building a flip-flop

  • Leaving the S and R inputs floating, without a pull-down, and the circuit changes by itself.
  • Driving S and R at the same time on the SR latch.
  • Using a button without debouncing as the clock: one press becomes several pulses.
  • Forgetting the series resistor with the LED.
  • Connecting the IC without power (VCC and GND).

How to do this on the platform

In the 4DVolt electronics design editor, the library already has logic gates and flip-flops. Build the latch by dragging the gates, wire them up, press play on the simulation and follow the Q output with the oscilloscope, without building anything on a breadboard.

To read the gate and component symbols in the schematic, see electronic component symbols.

This text is informational and simplified. Check the datasheet of the IC you use for pinout and operating voltages.

Read also

Questions and answers No questions yet

You need to be logged in to take part. Log in or Create free account