title: Generate random number - seed changes only once
body: <p>I generate a number in verilog between 0 to 10000 inside a loop like this:</p>
  
  <pre><code>wire rand;
  integer i, seed;
  initial 
     begin
        i=1;
        seed=0;
        while (i&lt;10)
          begin
          force rand = $random(seed) % 10000;
        end
     end
  </code></pre>
  
  <p>the problem that seed changes only once and in the rest of the iterations stays the same. (I see the values in ModelSim).  </p>