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. When solve-before Is Mostly Redundant

VLSI DV Interview Puzzles · All levels

When solve-before Is Mostly Redundant

Does solve a before b significantly change distribution here? Explain with legal-set and weighting logic.

On this page

    Puzzle

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

    Does solve a before b significantly change distribution here? Explain with legal-set and weighting logic.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    class sb_redundant;
      rand bit a;
      rand bit [3:0] b;
      constraint c {
        a dist {0 := 1, 1 := 1};
        (a == 0) -> (b == 0);
        (a == 1) -> (b inside {[0:15]});
      }
      // Variant: solve a before b;
    endclass

    Hint

    Separate legality from weighting intent.

    Step-by-step solution

    Diagram
    1) Legal tuples are still 17 total (same as classic puzzle).
    2) Explicit dist already requests balanced a selection (0 and 1 equal weight intent).
    3) Adding solve a before b does not change legal tuples and often has limited extra effect because a is already explicitly weighted.
    4) Any remaining differences are solver-implementation details, not legality changes.

    Answer

    Answer: Legal set is unchanged (17 tuples), and both variants typically target near 50/50 on a due to explicit dist; solve-before is mostly redundant here.

    Why candidates get it wrong

    Using solve-before as a substitute for missing dist intent is fragile across tools/seeds.

    Interviewer follow-up

    If dist on a is removed, how do distributions change between variants?

    Related topics

    • Back to solve...before Bias Puzzles

    • Randomization & Constraint Puzzles section

    Previous

    97 / 210

    Next: randomize() with Puzzles

    Up next

    Up nextrandomize() with Puzzles

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Classic a->b Bias Shift
    • Three-Branch Kind Selection
    • Reverse Bias with solve b before a