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

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
    • Event Scheduling Puzzles
      • Observed Assertion Sees Previous Cycle
      • Does #0 Beat NBA?
      • Chained #0 Delays vs Single NBA
      • Program Reactive Drive Lag
      • Last NBA in a Process Wins
      • Assertion Action Block Cannot Rewind Edge
    • Race Condition Puzzles
    • Clocking Block Puzzles
    • Semaphore & Mailbox Puzzles
    • Concurrency & Timing Puzzles: Tricky Q&A
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Event Scheduling Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Concurrency & Timing Puzzles
  4. Event Scheduling Puzzles
  5. Does #0 Beat NBA?

VLSI DV Interview Puzzles · All levels

Does #0 Beat NBA?

Predict both prints at time 0 and explain why they differ even though there is no real time advance.

On this page

    Puzzle

    Difficulty: Easy · Puzzle 2 of 6 · Topic: Event Scheduling Puzzles

    Predict both prints at time 0 and explain why they differ even though there is no real time advance.

    Code

    tb.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    module tb;
      int x;
      initial begin
        x = 0;
        x <= 1;
        #0 x = 2;
        $display("[%0t INACTIVE] x=%0d", $time, x);
        $strobe("[%0t POSTPONED] x=%0d", $time, x);
      end
    endmodule

    Hint

    #0 lands in inactive; NBA updates happen after inactive.

    Step-by-step solution

    Diagram
    1) Active region schedules x<=1 for NBA.
    2) #0 resumes in inactive and assigns x=2.
    3) $display in inactive prints x=2 at t=0.
    4) NBA region then updates x to 1.
    5) $strobe runs in postponed and prints x=1 at t=0.

    Answer

    Answer: Inactive print is [0] x=2, postponed print is [0] x=1. #0 executes before NBA in the same time slot.

    Why candidates get it wrong

    Many engineers think #0 moves after NBA because it 'feels later'. It does not.

    Interviewer follow-up

    If you replace #0 with #1, what changes in ordering and printed time?

    Related topics

    • Back to Event Scheduling Puzzles

    • Concurrency & Timing Puzzles section

    Previous

    56 / 210

    Next: Chained #0 Delays vs Single NBA

    Up next

    Up nextChained #0 Delays vs Single NBA

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Program Reactive Drive Lag
    • Last NBA in a Process Wins
    • Assertion Action Block Cannot Rewind Edge