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
    • Constraint Solving Order Puzzles
    • Distribution Puzzles (`dist`, `:=` vs `:/`)
      • Case A vs Case B vs Trap Variant
      • Small Range with := vs Large Range with :/
      • Loaded Die with Mixed Granularity
      • dist After Hard Pruning
      • Boolean dist Cascading into Value dist
      • Zero Weight Means Never Chosen
    • solve...before Bias Puzzles
    • randomize() with Puzzles
    • Randomization & Constraint Puzzles: Tricky Q&A
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Distribution Puzzles (`dist`, `:=` vs `:/`)
  1. Topics
  2. DV Interview Puzzles
  3. Randomization & Constraint Puzzles
  4. Distribution Puzzles (`dist`, `:=` vs `:/`)
  5. dist After Hard Pruning

VLSI DV Interview Puzzles · All levels

dist After Hard Pruning

After intersecting c_dist with c_clip, compute P(x==3) and P(x==6).

On this page

    Puzzle

    Difficulty: Hard · Puzzle 4 of 6 · Topic: Distribution Puzzles (`dist`, `:=` vs `:/`)

    After intersecting c_dist with c_clip, compute P(x==3) and P(x==6).

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    class pruned_dist;
      rand int unsigned x;
      constraint c_dist {
        x dist { [0:4] := 1, [5:9] := 3 };
      }
      constraint c_clip { x inside {[3:7]}; }
    endclass

    Hint

    Remove disallowed values first, then renormalize surviving weights.

    Step-by-step solution

    Diagram
    1) Base per-value weights: 0..4 ->1 each, 5..9 ->3 each.
    2) c_clip keeps only values 3,4,5,6,7 with weights 1,1,3,3,3.
    3) Total surviving weight = 11.
    4) P(3)=1/11.
    5) P(6)=3/11.

    Answer

    Answer: P(x==3)=1/11 (~9.09%) and P(x==6)=3/11 (~27.27%).

    Why candidates get it wrong

    People frequently normalize using original full-domain weight instead of the clipped legal domain.

    Interviewer follow-up

    What if c_clip changes to x inside {[0:4]} only?

    Related topics

    • Back to Distribution Puzzles (`dist`, `:=` vs `:/`)

    • Randomization & Constraint Puzzles section

    Previous

    89 / 210

    Next: Boolean dist Cascading into Value dist

    Up next

    Up nextBoolean dist Cascading into Value dist

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Case A vs Case B vs Trap Variant
    • Small Range with := vs Large Range with :/
    • Zero Weight Means Never Chosen