Archive forSeptember, 2008

Changing the seed for a class and generting different patterent for randc

Here is the example. How you can change the seed for a class and generate different pattern with randc.
If you comment the line "obj.srandom(seed)" it will generate the same pattern again after the cycle.
Try compiling it again with commenting above line.

class randctest;
randc bit [1:0] randbit;
task print;
$display("Rand C = %d", randbit);
endtask
endclass

program main;

randctest obj;

initial begin
obj = new();
for (int i=0; i<12; i++) begin
if (i % 4 == 0) begin
obj.srandom(236+i);
$display("==============");
end
if (obj.randomize()) begin
obj.print();
end
else begin
$display("Randomization failed \n");
end
end
end
endprogram : main

Output :
==============
Rand C = 0
Rand C = 1
Rand C = 2
Rand C = 3
==============
Rand C = 2
Rand C = 1
Rand C = 3
Rand C = 0
==============
Rand C = 1
Rand C = 0
Rand C = 2
Rand C = 3

Comments

Smart Person Vs Wise Person

A good thought :

The difference between a smart person and a wise person is that a wise
person knows how not to get into situations that a smart person knows
how to get out of.

Reference Page :

http://simeons.wordpress.com/2008/09/04/smart-entrepreneurs-vs-wise-entrepreneurs/

Page has few more thoughts out of which the last one i don't agree :

  • Be different, not best
  • Do less, not more
  • Go around a wall, not through it
  • It is better to figure out how not to have to solve a problem as opposed to having to solve the problem.

Comments

"Quote of the Day"