i have one doubt regarding randomizing real numbers in system verilog. for example i have a real input_voltage which has the value defined in the range from 0.0V to 1.9V. can i randomize the real input_voltage using $urandom_range in my System verilog Testbench enviornment?
In reply to dave_59:
In reply to ravishekhar0004:
$urandom_range(19)/10.0
Hi Dave,
i have tried with the below code .But display addr_range is not coming
module abc();
int addr_range;
initial begin
addr_range = $urandom_range(19)/10.0;
$display(“the value of the addr_range is %f”,addr_range);
end
endmodule
Tried with this option also
real addr_range;
$display(“the value of the addr_range is %d”,addr_range);
In reply to Manikanta Kopparapu:
To display a real value, you need to store it’s value in a real type variable and display it with a floating point format like %g.