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
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
    • Classic Brain Teasers
    • Probability Puzzles
    • Digital Logic Puzzles
    • Debugging Riddles
      • Scoreboard Sees Previous-Cycle Data
      • Reset Release Causes Occasional X State
      • always_comb with NBA and Missing Else
      • UVM Analysis Port Handle Reuse
      • join_any Timeout Ghost Thread
      • Randomization Always Fails: Hidden Unsat
    • Logic & Aptitude Puzzles: Tricky Q&A
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Debugging Riddles
  1. Topics
  2. DV Interview Puzzles
  3. Logic & Aptitude Puzzles
  4. Debugging Riddles
  5. always_comb with NBA and Missing Else

VLSI DV Interview Puzzles · All levels

always_comb with NBA and Missing Else

Find the functional bug in this combinational block that sporadically latches stale values.

On this page

    Puzzle

    Difficulty: Medium · Puzzle 3 of 6 · Topic: Debugging Riddles

    Find the functional bug in this combinational block that sporadically latches stale values.

    Code

    design.sv
    1
    2
    3
    4
    always_comb begin
      if (en)
        y <= a & b;
    end

    Hint

    Two independent issues exist.

    Step-by-step solution

    Diagram
    1) In combinational logic, missing else means y is not assigned when en=0, inferring latch behavior.
    2) Using nonblocking assignment in combinational block adds avoidable delta-cycle behavior and can confuse debug.
    3) Correct form assigns y in all paths with blocking assignment.
    4) Example fix: always_comb begin if (en) y = a & b; else y = 1'b0; end.

    Answer

    Answer: Bug is inferred latch plus NBA misuse in combinational logic; assign all paths with blocking assignment.

    Why candidates get it wrong

    Blaming simulator when issue is pure coding-style semantic mismatch.

    Interviewer follow-up

    Would `always_latch` be appropriate if latch was actually intended?

    Related topics

    • Back to Debugging Riddles

    • Logic & Aptitude Puzzles section

    Previous

    175 / 210

    Next: UVM Analysis Port Handle Reuse

    Up next

    Up nextUVM Analysis Port Handle Reuse

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Scoreboard Sees Previous-Cycle Data
    • join_any Timeout Ghost Thread
    • Randomization Always Fails: Hidden Unsat