D Flip-Flop

Master-Slave edge triggered register.

Mohith N
Updated: 19 March 2026
12 min read

The D flip-flop is the most widely used sequential element in all of VLSI design. Every register file, pipeline stage, and state machine in a processor chip is built around this basic building block. Unlike the D latch, the D flip-flop is edge-triggered, meaning it captures data at a single clock edge and ignores input at all other times.

Master LatchMASTERActive: CLK=0Slave LatchSLAVEActive: CLK=1DQmQCLK̅CLKCLK feeds Master inverted, Slave directlyTruth TableCLKDQ+Rising00Rising11LowXQHighXQ
Figure 1: Master-Slave D flip-flop. Master samples on CLK=0, Slave transfers on CLK=1, making output change only at rising edge.

Core Concept Explanation

The fundamental problem with a D latch is that it is transparent during the entire time the clock is high. Any noise or glitch on D reaches Q directly. The D flip-flop solves this by cascading two D latches with complementary clocks, called the master-slave configuration. The master latch is active when CLK is low and the slave latch is active when CLK is high. Because these two windows never overlap, data can only propagate from input to output at the clock transition moment.

At the rising edge of CLK, the master latch closes and freezes the captured data, while the slave latch opens and transfers that frozen value to the output Q. This makes the entire flip-flop positive edge-triggered. The output Q changes only at the rising clock edge and remains stable for the rest of the clock period, regardless of how D changes.

In CMOS implementation, each latch is built using a transmission gate pair and inverters. The master has TG1 enabled by CLK-bar and TG2 as the hold feedback. The slave has TG3 enabled by CLK and TG4 as the hold feedback. In total, a standard master-slave D flip-flop uses approximately 20 to 24 transistors in full CMOS.

Mathematical Expression and Timing

The characteristic equation of the D flip-flop is simply:

Q(n+1) = D, sampled at the active clock edge

For timing analysis, two critical parameters define the operating limits of a flip-flop. The setup time (t_su) is the minimum duration D must be stable before the clock edge. The hold time (t_h) is the minimum duration D must remain stable after the clock edge. Together they define a forbidden window around the clock edge during which D must not change.

The clock-to-Q delay, denoted t_cq, is the propagation delay from the active clock edge to when Q settles to its new valid value. A typical t_cq for a D flip-flop in 180nm CMOS is 300 to 600 ps.

Practical Understanding

In any synchronous digital system, all flip-flops share a common clock. The maximum operating frequency of the system is determined by the longest combinational path between two flip-flops, the flip-flop setup time, and the clock-to-Q delay. This is captured in the timing constraint equation: T_clk >= t_cq + t_logic + t_su.

D flip-flops are used in registers, counters, shift registers, and as state holders in finite state machines. In modern process nodes (7nm, 5nm), the standard cell D flip-flop is carefully characterized across process, voltage, and temperature corners to ensure timing closure across all operating conditions.

A critical failure mode is metastability, which occurs when D changes within the setup-hold window. The flip-flop internal nodes settle to an intermediate voltage that is neither logic 0 nor logic 1. The flip-flop eventually resolves, but the time to resolution is unpredictable, which can cause system failure.

Example
Given:
t_cq = 400 ps (clock-to-Q delay)
t_su = 150 ps (setup time)
Combinational logic delay between two flip-flops = 1.2 ns
Clock period T_clk = 2 ns

Why this formula applies:
The critical path must complete within one clock cycle minus setup and cq delays
T_clk >= t_cq + t_logic + t_su

Formula:
Slack = T_clk - (t_cq + t_logic + t_su)

Substitution:
Slack = 2 ns - (0.4 + 1.2 + 0.15) ns

Calculation:
Slack = 2 - 1.75 = 0.25 ns

Final Answer: Timing slack = 0.25 ns (positive, so timing is met). If t_logic were 1.5 ns, slack = -0.05 ns (timing violation).
Exam Tip: In GATE, the D flip-flop characteristic equation Q(n+1) = D is always evaluated at the active clock edge. If asked about latch vs flip-flop behavior, remember: latch is level-sensitive (responds to CLK level), flip-flop is edge-triggered (responds only to transition). This is the most common trap in sequential circuit MCQs.

Loading lab...

Quick Revision

  • D flip-flop is edge-triggered: Q(n+1) = D, captured only at the active clock edge.
  • Built using master-slave cascade: master samples at CLK=0, slave transfers at CLK=1.
  • Key timing parameters: setup time (t_su), hold time (t_h), clock-to-Q delay (t_cq).
  • Timing constraint: T_clk >= t_cq + t_logic + t_su defines maximum frequency.
  • Metastability occurs when D changes inside the setup-hold window around the clock edge.
  • Typical CMOS implementation: approximately 20 to 24 transistors using transmission gates.
  • Trap: Latch propagates glitches during CLK=1; flip-flop never propagates mid-clock glitches.

D Flip-Flop Quiz

Test your understanding of D flip-flop operation versus transparent latch behavior.

Question 1 of 3

Q1.The characteristic equation of a D flip-flop is Q(t+1) = D. Why does the D flip-flop not have a forbidden state?