Flip flop and latch problems
Every sequential circuit is made of these. The problems start at the SR latch built from two NAND or NOR gates, add an enable, and work up to edge triggered flip flops built as master slave pairs.
196 problems14 free to solve57 easy, 86 medium, 53 hard
Then they turn one flip flop into another, trace the race around condition in a pulse triggered JK, and put a data change inside the setup and hold window to see what the output does.
What these problems cover
- SR latches from NAND and NOR gates, and the forbidden state
- Gated latches and the transparency window
- Master slave and edge triggered D flip flops
- JK and T flip flops, and the race around condition
- Flip flop conversion: JK to D, D to T, T to JK and the rest
- Asynchronous preset and clear, enables, clock to Q delay
Free to start
Solve these with a free account. Every other statement on this page is free to read.
Problems by track
Latches and Flip-Flops126
- SR NOR Latch: Basic Construction
- SR NOR Latch: Normal Operation Waveform Trace
- SR NOR Latch: Forbidden State Behavior
- SR NOR Latch: Race Condition on Simultaneous Forbidden-State Release
- SR NOR Latch: Memory Phase Duration Verification
- SR NOR Latch: Q_bar Polarity and Active Level
- SR NOR Latch: Missing Cross-Coupling Wire Debug
- SR NOR Latch: Set-Dominant Configuration
- SR NAND Latch: Active-Low Input Construction
- SR NAND Latch Active-Low Operation
- SR NAND Latch: Forbidden State
- SR NAND Latch: Simultaneous Forbidden-State Release Race
Gate-Level Logic2
Counters6
Shift Registers5
Clocking and Synchronization13
- Ripple Divide by 4 Phase Delay Analysis
- Divide by 3 with 50 Percent Duty Cycle
- Clock Phase Shifter 180 Degrees
- Asynchronous Reset Pulse Shortener
- Negative Edge Integrated Clock Gating Cell
- Clock Gating Setup Time Violation
- Wake Up Logic for Gated Clock
- Synchronous Clock Switch
- Standard Dual Flip Flop Synchronizer
- Shift Register vs Synchronizer
- Fast to Slow Domain Level Synchronization
- Fast to Slow Domain Missed Pulse Analysis
Fault Testing and Verification2
Interface and Communication Circuits7
Interview Circuit2
Sequential RTL7
Synthesis Intuition2
Clock Domain Crossing and Synchronization2
More problems22
- 3-bit Ripple Counter from Toggle Flip-Flops
- Active Low Reset Polarity Mismatch
- Gated SR Latch: Transparency Window Trace
- Incomplete Case Statement
- Latch vs Clock Enable Inference
- T Flip-Flop from a D Flip-Flop
- The Deeply Nested Latch
- Asynchronous Reset Wired as Synchronous Reset
- JK Flip-Flop from a D Flip-Flop
- JK Flip-Flop from DFF
- JK Flip-Flop vs SR Forbidden State
- Reset Synchronizer Driven by Wrong Clock
How your answer is checked
Circuit problems run on the circuit simulator against the problem's test vectors, clocked cycle by cycle when they are sequential. Verilog problems are compiled with Icarus Verilog and run against a testbench, with the waveform and the Yosys schematic beside the result. Analysis questions are checked against their answer key.
Questions
- Can the simulator show a latch oscillating?
- Yes. Feedback loops are simulated, so an SR latch built from gates holds its state, and a loop that never settles is reported as an oscillation instead of being hidden.
- What is the difference between a latch and a flip flop here?
- The same as on silicon. A latch follows its input while enabled; a flip flop takes it only on a clock edge. Several problems put both on one waveform so the difference is visible.