We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I would like to know on which method Keil rand() function generates the random values.Are they using LCM or Linear Feedback shift register or any other method? Please help me in this. Thanks Gopi
If you're really dead serious about the randomness of your RNG (say, you're building a slot machine), you won't use a software function at all, but will design some dedicated hardware that generates truly random numbers, say by amplifying noise If a button press or other human interaction tahes place for each need of a random number, the read of a free running timer will do just fine for true randomness. Erik
The sequence of numbers produced by an algorithm (especially the common ones like LCG and LFSR) have some statistical correlation. They all involve state that ties them to previous results. The button press / timer is a reasonable way to get a seed for most purposes. But, as I said, if you're really concerned about producing an uncorrelated stream of numbers, you'll need some hardware support. There are relatively few applications that need to obsess over the randomness of their numbers in this detail, though. Do you really need to go to this much trouble (http://www.fourmilab.ch/hotbits/)? Well, maybe if you're doing cryptography, or generating lotto numbers, or doing some heavy duty Monte Carlo simulation. A nice summary of the topic: http://www.faqs.org/rfcs/rfc1750.html