What is Flip-flop?
The basic element of sequential circuits that stores one bit. A D flip-flop captures its input at a clock edge.
Japanese name: フリップフロップ
The basic element of sequential circuits that stores one bit. A D flip-flop captures its input at a clock edge.
Japanese name: フリップフロップ
A D flip-flop samples its D input at the active clock edge and holds that value at Q until the next edge; changes between edges are ignored. Internally it is usually two latches clocked in opposite phases in a master-slave arrangement. A latch, by contrast, is level-sensitive: while enabled it is transparent and passes input straight to output. Edge triggering makes timing far easier to analyze, which is why flip-flops form CPU registers, pipeline stage boundaries, state machines and counters in synchronous designs.
Data must be stable for a setup time before the edge and a hold time after it. On a register-to-register path the clock period must cover clock-to-output delay, logic delay and setup time: with 0.15 + 2.2 + 0.15 ns the minimum period is 2.5 ns, or 400 MHz. Setup violations can be fixed by slowing the clock, but hold violations cannot, because the check compares data launched and captured on the same edge; designers add delay buffers instead. Clock skew that delays the capture clock helps setup but hurts hold.
If data changes inside the setup-hold window, as happens with signals from an unrelated clock, the flip-flop can become metastable, its output lingering between 0 and 1. The chance that it remains unresolved falls exponentially with time but never reaches zero. A synchronizer of two or more flip-flops in series gives the first stage a full clock period to settle, pushing the mean time between failures to thousands of years or more under most design conditions. Multi-bit values cross clock domains through asynchronous FIFOs or handshakes, and CDC (clock domain crossing) verification tools check that these structures are present.
A JK flip-flop sets with J = 1, K = 0, resets with J = 0, K = 1, holds with both 0 and toggles with both 1, giving meaning to the forbidden input of an SR flip-flop. Tying J and K together as a single input T makes a T flip-flop, which toggles on every edge when T = 1, dividing the clock frequency by two with a 50 percent duty cycle; chains of them form ripple counters and dividers. Modern logic uses D flip-flops almost exclusively. For testing, scan design adds a multiplexer at each flip-flop input so the flip-flops can be chained into shift registers to load and observe internal states.
Answer: C. It captures the value of the D input at a clock edge and holds it until the next edge
A D flip-flop captures its D input on the rising (or falling) clock edge and holds it until the next edge; changes between edges do not affect the output. It is the building block of sequential circuits—CPU registers, pipeline stage boundaries and counters—and is typically built from two latches in a master-slave arrangement. Correct capture requires meeting setup and hold times.
Answer: B. The minimum time the data input must be stable before the clock edge
For a flip-flop to capture correctly, data must be stable for a certain time before the clock edge—the setup time. A violation occurs if the clock-to-output delay plus the data-path delay exceeds the clock period minus the setup time, and it can be fixed by slowing the clock. The time data must remain stable after the edge is the hold time. Violating either can capture wrong values or cause metastability.
A latch is level-sensitive and passes its input to the output whenever it is enabled, while a flip-flop is edge-triggered and samples its input only at the clock edge. A typical D flip-flop is built from two latches enabled on opposite clock phases.
The hold check compares data launched and captured on the same clock edge, so the clock period does not appear in it. The fix is to add delay to the short path, usually with buffers.
Add the clock-to-output delay, the worst-case combinational delay and the setup time, adjusting for clock skew, to get the minimum period; the maximum frequency is its reciprocal. The slowest such path on the chip, the critical path, sets the chip's limit.
Flip-flop appears in 37 practice questions across 6 topics, including Timing analysis and CDC, HDL & Verification, Logic circuits.
Building real circuits is a good way to check what you learned in the questions.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.