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. Randomization Always Fails: Hidden Unsat

VLSI DV Interview Puzzles · All levels

Randomization Always Fails: Hidden Unsat

A constraint block fails every randomize call. Find the logical contradiction.

On this page

    Puzzle

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

    A constraint block fails every randomize call. Find the logical contradiction.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    class pkt;
      rand bit [3:0] addr;
      constraint c {
        addr inside {[0:15]};
        addr[0] == 1'b1;   // odd
        addr % 4 == 0;     // multiple of 4
      }
    endclass

    Hint

    Check parity implied by modulo condition.

    Step-by-step solution

    Diagram
    1) addr % 4 == 0 implies addr is divisible by 4, therefore LSB addr[0] must be 0.
    2) Another constraint requires addr[0] == 1.
    3) These cannot both hold, so solver has no legal solution.
    4) Fix by relaxing one condition, e.g., use addr % 4 == 1 for odd values with fixed stride.

    Answer

    Answer: Constraint set is unsatisfiable: odd-number requirement conflicts with multiple-of-4 requirement.

    Why candidates get it wrong

    Debugging seed/tool settings before checking satisfiability algebraically.

    Interviewer follow-up

    How would you encode legal addresses as a weighted distribution instead?

    Related topics

    • Back to Debugging Riddles

    • Logic & Aptitude Puzzles section

    Previous

    178 / 210

    Next: Logic & Aptitude Puzzles: Tricky Q&A

    Up next

    Up nextLogic & Aptitude Puzzles: Tricky Q&A

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Scoreboard Sees Previous-Cycle Data
    • Reset Release Causes Occasional X State
    • always_comb with NBA and Missing Else