Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
    • Scripted Flows and Regression
    • Debugging QoR
    • Simulation-Synthesis Mismatch
      • Sensitivity Lists and Races
      • Blocking and Non-Blocking Assignments
      • X Pessimism, Optimism, and Init
      • Case Priority and Wildcards
      • Directives, Widths, and Gate Simulation
  • Interview and Judgment11
Loading lesson

‹Simulation-Synthesis Mismatch
  1. Topics
  2. Logic Synthesis
  3. Flows and Debugging
  4. Simulation-Synthesis Mismatch
  5. Blocking and Non-Blocking Assignments

Part 8 · Flows and Debugging · Intermediate

Blocking and Non-Blocking Assignments

Blocking for combinational logic and non-blocking for sequential logic, with a worked trace.

On this page

    Blocking is immediate

    A blocking assignment (=) updates the variable at once, so later lines in the same block see the new value. Combinational code uses it because each line is a wire continuing to the next.

    In simulation, chaining three stages with = in one block collapses them. The input runs through every stage in the same evaluation.

    Synthesis infers registers from the clocked structure, not from = against <=. The mismatch is that blocking assignments in a clocked block simulate as one collapsed stage while the inferred registers shift.

    Non-blocking is a shift

    A non-blocking assignment (<=) samples the right-hand side now and applies it at the clock edge. Every register in the block therefore samples the pre-edge values together.

    In simulation, the same three stages with <= form a real pipeline. Each stage hands its old value forward once per clock.

    A worked shift trace

    A three-stage register takes din = 1, 0, 1, 1 over cycles 1 to 4 from reset 0, 0, 0. The calc block traces both simulation behaviours exactly.

    Diagram
    3-stage shift, din sequence 1, 0, 1, 1, reset q1 = q2 = q3 = 0
    nonblocking (<=): each stage takes the pre-edge value
    cycle 1: q1 = 1, q2 = 0, q3 = 0
    cycle 2: q1 = 0, q2 = 1, q3 = 0
    cycle 3: q1 = 1, q2 = 0, q3 = 1
    cycle 4: q1 = 1, q2 = 1, q3 = 0
    blocking (=) in one block: each line sees the new value above it
    cycle 1: q1 = 1, q2 = 1, q3 = 1 (din jumps through all three stages at once)

    Style

    Update

    Use for

    Breaks when

    Blocking `=`

    Immediate, in order

    Combinational blocks

    Used for clocked state: simulates as one collapsed stage while inferred registers shift

    Non-blocking `<=`

    Sampled now, applied at the edge

    Clocked blocks

    Used for combinational logic: simulates as deferred, staged updates and can disagree with the combinational gates; use = for combinational and <= for clocked blocks

    Mixing the two

    Reading after a blocking write sees the new value, while reading after a non-blocking write sees the old one. Mixing both styles on one variable makes simulation order visible in the result.

    Common pitfall

    Driving one variable with = in one block and <= in another is a race with two drivers. Simulation picks an order and synthesis builds one driver; neither choice is the intended register.

    Interview

    Likely probe: trace a three-stage shift for one input bit. Answer with the pre-edge rule: each <= carries the value from before the edge, one stage per clock.

    Check yourself One block writes q1 = din; q2 = q1; q3 = q2; with blocking assignments. How many clocks does din take to reach q3?

    None in simulation. Every line sees the update above it, so the trace shows 1, 1, 1 in cycle 1, while the inferred registers still shift one stage per clock.

    Check yourself The same three lines use <= and din is 1 only in cycle 1. When does q3 first read 1?

    Cycle 3. Each edge shifts one stage, so q3 reads 0, 0, 1 across cycles 1 to 3.

    Related topics

    • Previous: Sensitivity lists and races

    • Next: X pessimism, optimism, and init

    • Flops, resets and enables

    Previous

    125 / 139

    Next: X Pessimism, Optimism, and Init

    Up next

    Up nextX Pessimism, Optimism, and Init

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Case Priority and Wildcards
    • Directives, Widths, and Gate Simulation