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?
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
systemverilog
class sb_reverse;
rand bit a;
rand bit [1:0] b;
constraint c_rel { (a == 0) -> (b == 0); }
// Variant: solve b before a;
endclassHint
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?