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
      • Implication vs Partitioned Branches
      • Bidirectional Solving of x+y==10
      • if-else with Overlap on One Value
      • Three-Variable Implication Chain
      • Relational Pair Counting
      • Array Size Coupled to Content
    • Distribution Puzzles (`dist`, `:=` vs `:/`)
    • 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

‹Constraint Solving Order Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Randomization & Constraint Puzzles
  4. Constraint Solving Order Puzzles
  5. Three-Variable Implication Chain

VLSI DV Interview Puzzles · All levels

Three-Variable Implication Chain

How many legal tuples exist, and what is P(c==1)? Explain why c can still be 1 when b==0.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 4 of 6 · Topic: Constraint Solving Order Puzzles

    How many legal tuples exist, and what is P(c==1)? Explain why c can still be 1 when b==0.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    class chain_imp;
      rand bit a;
      rand bit b;
      rand bit c;
      constraint rel {
        (a == 1) -> (b == 1);
        (b == 1) -> (c == 1);
      }
    endclass

    Hint

    Split on b first; implication only constrains when antecedent is true.

    Step-by-step solution

    Diagram
    1) If b=0: second implication imposes no requirement on c; first implication forces a=0. Tuples: (0,0,0),(0,0,1).
    2) If b=1: second implication forces c=1; first implication allows a=0 or 1. Tuples: (0,1,1),(1,1,1).
    3) Total legal tuples=4.
    4) c==1 appears in 3 tuples -> P(c==1)=3/4.

    Answer

    Answer: There are 4 legal tuples and P(c==1)=3/4 (75%).

    Why candidates get it wrong

    A common wrong claim is that b==0 implies c==0; implication does not force the consequent when antecedent is false.

    Interviewer follow-up

    Add one constraint that makes P(c==1)=1/2 without changing legality too much.

    Related topics

    • Back to Constraint Solving Order Puzzles

    • Randomization & Constraint Puzzles section

    Previous

    83 / 210

    Next: Relational Pair Counting

    Up next

    Up nextRelational Pair Counting

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Implication vs Partitioned Branches
    • Bidirectional Solving of x+y==10
    • Array Size Coupled to Content