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 `:/`)
    • solve...before Bias Puzzles
      • Classic a->b Bias Shift
      • Three-Branch Kind Selection
      • Reverse Bias with solve b before a
      • m<n Cardinality Bias
      • Mode Branch Collapse Under Extra Relation
      • When solve-before Is Mostly Redundant
    • 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

‹solve...before Bias Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Randomization & Constraint Puzzles
  4. solve...before Bias Puzzles
  5. Reverse Bias with solve b before a

VLSI DV Interview Puzzles · All levels

Reverse Bias with solve b before a

What is P(a==1) by tuple counting, and how can solve b before a push it even higher?

On this page

    Puzzle

    Difficulty: Hard · Puzzle 3 of 6 · Topic: solve...before Bias Puzzles

    What is P(a==1) by tuple counting, and how can solve b before a push it even higher?

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    class sb_reverse;
      rand bit a;
      rand bit [1:0] b;
      constraint c_rel { (a == 0) -> (b == 0); }
      // Variant: solve b before a;
    endclass

    Hint

    Compare tuple-count baseline with a b-first thought experiment.

    Step-by-step solution

    Diagram
    1) Legal tuples are (a=0,b=0) plus (a=1,b=0..3) -> total 5 tuples.
    2) Tuple baseline gives P(a==1)=4/5.
    3) If b is chosen first near-uniform over {0,1,2,3}, then for b!=0, a must be 1; only b=0 allows both a values.
    4) Under that b-first heuristic, P(a==1) becomes (3/4)*1 + (1/4)*(1/2) = 7/8.
    5) Legal tuples are still identical either way.

    Answer

    Answer: Baseline P(a==1)=4/5, and solve b before a can push observed P(a==1) toward 7/8 in many solvers, with no legal-set change.

    Why candidates get it wrong

    People often expect reverse solve-before to be irrelevant; it can materially change frequencies.

    Interviewer follow-up

    Which explicit dist on a would neutralize this order-induced skew?

    Related topics

    • Back to solve...before Bias Puzzles

    • Randomization & Constraint Puzzles section

    Previous

    94 / 210

    Next: m<n Cardinality Bias

    Up next

    Up nextm<n Cardinality Bias

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Classic a->b Bias Shift
    • Mode Branch Collapse Under Extra Relation
    • When solve-before Is Mostly Redundant