Hardware interview practice
Rand_mode
What are ok and x after the call?
Starting point
Question code
class C; rand int x; endclass
C c = new; int ok;
initial begin
c.x = 7;
c.x.rand_mode(0);
ok = c.randomize() with { x == 9; };
$display("%0d %0d", ok, c.x);
endChoose one
Answer choices
- A. 1 9
- B. 1 7
- C. 0 7
- D. 0 9
