VLSI DV Interview Puzzles · All levels
Classic a->b Bias Shift
For this class, compare no-solve-before vs solve a before b. What is the legal set, and how does P(a==0) usually move?
Puzzle
Difficulty: Medium · Puzzle 1 of 6 · Topic: solve...before Bias Puzzles
For this class, compare no-solve-before vs solve a before b. What is the legal set, and how does P(a==0) usually move?
Code
class sb_puzzle;
rand bit a;
rand bit [3:0] b;
constraint c_rel { (a == 0) -> (b == 0); }
// Variant 1: no solve-before
// Variant 2: solve a before b;
endclassHint
Count legal tuples first, then reason about order-induced bias.
Step-by-step solution
1) Legal tuples: (a=0,b=0) is 1 tuple; (a=1,b=0..15) is 16 tuples; total=17.
2) Legal set is identical with or without solve-before.
3) Tuple-count baseline gives P(a=0)=1/17 without explicit balancing.
4) With solve a before b, many solvers pick a near 50/50 first, then solve b in that branch, so observed P(a=0) often moves toward 1/2.Answer
Answer: Legal tuples stay the same (17 total), but solve a before b typically shifts a from heavily 1-biased (~16/17 tuple pressure) toward near 50/50.
Why candidates get it wrong
Calling solve-before a legality constraint is incorrect; it is mainly a distribution steering hint.
Interviewer follow-up
How can you force exact 50/50 on a without relying on solver heuristics?