Close Menu
VLSI Web
  • Home
    • About Us
    • Contact Us
    • Privacy Policy
  • Digital Design
    • Digital Circuits
    • Verilog
    • VHDL
    • System Verilog
    • UVM
  • VLSI Roles
    • RTL Design
    • Design Verification
    • Physical Design
    • DFT
    • STA
  • Interviews
  • Informative
  • VLSI Forge
Instagram LinkedIn WhatsApp Telegram
Instagram LinkedIn WhatsApp Telegram
VLSI Web
  • Home
    • About Us
    • Contact Us
    • Privacy Policy
  • Digital Design
    • Digital Circuits
    • Verilog
    • VHDL
    • System Verilog
    • UVM
  • VLSI Roles
    • RTL Design
    • Design Verification
    • Physical Design
    • DFT
    • STA
  • Interviews
  • Informative
  • VLSI Forge
VLSI Web
Digital Circuits

Latches vs Flip-Flops: SR and D Latches Explained

Raju GorlaBy Raju Gorla28 August 2026Updated:11 October 2026No Comments3 Mins Read
Latches vs flip-flops explained
Share
Facebook Twitter LinkedIn Email Telegram WhatsApp

The short answer: a latch is level-sensitive: while its enable is active it is transparent and the output follows the input; when the enable goes inactive it holds the last value. A flip-flop is edge-triggered: it samples its input only at a clock edge. Almost all synchronous designs use flip-flops because their timing is much easier to analyse; latches appear deliberately only in special cases, and accidentally when combinational RTL is written incompletely.

This post combines my older posts on SR latches, D latches and latches vs flip-flops.

  1. Latch vs flip-flop in one waveform
  2. The SR latch
  3. The D latch
  4. Why designs use flip-flops
  5. Accidental latches in RTL

Table of Contents

  • Part 1: Latch vs flip-flop in one waveform
  • Part 2: The SR latch
  • Part 3: The D latch
  • Part 4: Why designs use flip-flops
  • Part 5: Accidental latches in RTL
  • FAQ
    • Is a latch faster than a flip-flop?
    • Why is S = R = 1 forbidden in an SR latch?
    • How do I know if my RTL infers a latch?
    • Do FPGAs support latches?

Part 1: Latch vs flip-flop in one waveform

Waveform comparing a level-sensitive latch with an edge-triggered flip-flop
The latch passes changes through while enabled; the flop only updates at edges.

Part 2: The SR latch

The simplest memory element: two cross-coupled NOR gates (or NAND gates). S sets Q to 1, R resets it to 0, and with both inactive it holds its value. With NOR gates, S = R = 1 is not allowed, because it forces both outputs low and the final state is unpredictable when both are released.

Part 3: The D latch

A D latch adds an enable and removes the forbidden state: while EN = 1, Q follows D; when EN = 0, Q holds. In Verilog:

always @(*)
  if (en) q = d;   // no else: q holds, so this infers a latch

Part 4: Why designs use flip-flops

  • Edge-triggered timing makes paths start and end at well-defined points, so static timing analysis is simple.
  • Latches allow data to race through several stages while enabled, which is useful (time borrowing) but harder to analyse.
  • A flip-flop is effectively two latches in a master-slave arrangement on opposite clock phases.

Part 5: Accidental latches in RTL

The most common way latches appear is by mistake: a combinational block that does not assign an output in every path. Synthesis tools warn about inferred latches, and you should treat those warnings as bugs unless you meant it.

// Bug: no else, so 'y' must hold its value -> latch
always @(*) begin
  if (sel) y = a;
end

// Fix: assign in every path
always @(*) begin
  y = b;           // default
  if (sel) y = a;
end

Practise this on VLSI Forge

I built VLSI Forge so you can write RTL in your browser, run it on a real simulator and check every signal in the waveform. Free, nothing to install.

Sequential logic problems

FAQ

Is a latch faster than a flip-flop?

A latch has a shorter delay and allows time borrowing, which some high-performance designs exploit, but it makes timing harder to close.

Why is S = R = 1 forbidden in an SR latch?

It drives both outputs to the same value, and when both inputs are released together the latch can settle to either state.

How do I know if my RTL infers a latch?

Synthesis reports and lint tools flag inferred latches. Check those reports on every run.

Do FPGAs support latches?

Most FPGA flops can be configured as latches, but FPGA timing tools and designs strongly prefer flip-flops.

Share. Facebook Twitter LinkedIn Email Telegram WhatsApp
Previous ArticleSequential Logic and Synchronous Design Explained
Next Article Flip-Flops Explained: D, JK, T and SR, with Verilog
Raju Gorla
  • Website

Related Posts

Digital Circuits

Registers and Shift Registers: SISO, SIPO, PISO and PIPO

3 September 2026
Digital Circuits

Counters and Clock Dividers in Verilog

2 September 2026
Digital Circuits

Mealy vs Moore State Machines: Differences, Examples and Verilog

1 September 2026
Add A Comment
Leave A Reply Cancel Reply

Topics
  • Digital Circuits
  • Informative
  • Interview Questions
  • Physical Design
  • RTL Design
  • STA
  • System Verilog
  • UVM
  • Verilog
Instagram LinkedIn WhatsApp Telegram
  • About
  • Contact
  • Privacy Policy
  • VLSI Forge
  • Courses
  • Feedback
© 2026 VLSI Web

Type above and press Enter to search. Press Esc to cancel.