Feb 27, 2014 #1 B BartlebyScrivener Member level 5 Joined Feb 8, 2012 Messages 90 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 2,081 I would like to make weighted random numbers. I am using $urandom_range(1) to create random 1's and 0's. But I would like to be able to, say, produce 1's 10% of the time, or perhaps, 80% of the time etc. Many thanks for any ideas!
I would like to make weighted random numbers. I am using $urandom_range(1) to create random 1's and 0's. But I would like to be able to, say, produce 1's 10% of the time, or perhaps, 80% of the time etc. Many thanks for any ideas!
Feb 27, 2014 #2 ads-ee Super Moderator Staff member Joined Sep 10, 2013 Messages 7,944 Helped 1,822 Reputation 3,654 Reaction score 1,808 Trophy points 1,393 Location USA Activity points 60,207 Take a look at this... https://stackoverflow.com/questions/20139455/verilog-generate-weighted-random-numbers If you are using systemverilog you should download the free LRM while it's still free.
Take a look at this... https://stackoverflow.com/questions/20139455/verilog-generate-weighted-random-numbers If you are using systemverilog you should download the free LRM while it's still free.