//real 5 random number between 2-5 with 3 point precision
module randreal();
parameter P=1000.0;
integer rand1;
real r;
initial
begin
repeat(5)
begin
rand1=(({$random})%3)+2;
r=rand1/P;
$display($time,"rand1=%d,r=%g",rand1,r);
end
end
endmodule
0 Comments