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. Loaded Die with Mixed Granularity

VLSI DV Interview Puzzles · All levels

Loaded Die with Mixed Granularity

What is P(face==6) and P(face==3)?

On this page

    Puzzle

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

    What is P(face==6) and P(face==3)?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    class loaded_die;
      rand int unsigned face;
      constraint c_dom { face inside {[1:6]}; }
      constraint c_dist {
        face dist { 6 := 5, [1:5] :/ 5 };
      }
    endclass

    Hint

    The [1:5] bucket gets total weight 5 split over five values.

    Step-by-step solution

    Diagram
    1) face=6 has weight 5.
    2) face 1..5 each has weight 5/5=1.
    3) Total weight = 5 + 5*1 = 10.
    4) P(6)=5/10=1/2.
    5) P(3)=1/10.

    Answer

    Answer: P(face==6)=50% and each of 1..5 has 10%.

    Why candidates get it wrong

    A common error is treating [1:5] :/ 5 as each value weight 5 instead of total range weight 5.

    Interviewer follow-up

    How would you set constraints so P(6)=2x P(any single value from 1..5)?

    Related topics

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

    • Randomization & Constraint Puzzles section

    Previous

    88 / 210

    Next: dist After Hard Pruning

    Up next

    Up nextdist After Hard Pruning

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Case A vs Case B vs Trap Variant
    • Boolean dist Cascading into Value dist
    • Zero Weight Means Never Chosen