Wiki›Blocking vs non-blocking assignments in Verilog: how to choose? · FPGA Knowledge Base

Blocking vs non-blocking assignments in Verilog: how to choose?

Verilog

Flip-flop and digital waveform concept cover

Fig: Register-level circuit with digital waveforms — synchronous logic and assignment

Use non-blocking for sequential logic and blocking for combinational in always blocks to avoid races and sim/synth mismatch.

Why It Matters

The two rules are really about modeling semantics: blocking assignments in combinational always blocks take effect immediately in order, modeling real wires; non-blocking assignments in sequential always blocks update all outputs together at the clock edge, modeling flip-flop sampling. Mixing them causes simulation/synthesis mismatch and even races.

Combinational always @(*) blocking "=" a b & y immediate, like real wires Sequential always @(posedge clk) non-blocking "<=" d FF clk q all outputs update at clock edge

Fig: Behavioral difference between blocking and non-blocking assignments

Keep one simple rule: use <= in sequential always blocks and = in combinational ones, and never mix the two within a single always block.

Related Videos

More FPGA hands-on tutorials on the fpga.love video portal

Video coming soon

Subscribe to fpga.love

Daily Briefing · Weekly Digest · Monthly Deep Dive