Which algorythm you choose also depends upon what the resulting number will be used for. If it is for noise generation, it probably doesn't need to be all that random. If it is for a random delay in a communications system, likewise, I don't think it would need to be really very random, just enough that the system won't get locked into a cetain repetitive state. However, if it is for security or for picking lottery numbers,bingo, etc, it better be pretty random. Sean At 07:39 PM 1/31/99 -0700, you wrote: >In "PIC your personal introductory course" John Morton suggests >simply adding h'27' repetitively. I think that the result won't be quite >random, but it does cycle through a long cycle without repeats. > >Most Pseudo Random numbers require multiplication (or iterative addition) >to accomplish. The main requirement is to find a "magic number" that not >only maximizes runtimes without repeats but also avoids easy analysis as a >"SERIES" so that it is easier to avoid prediction. This might be harder on >a "LOW END PIC" than some of the other options. One way of further >confusing the issue, is to use a "RANDOM SEED" such as a random number >created by a different pseudo random number generator, to generate the >base that you multiply/add to etc, every so often. > > GREY > > >GRAEME SMITH email: grysmith@freenet.edmonton.ab.ca >YMCA Edmonton > >Address has changed with little warning! >(I moved across the hall! :) ) > >Email will remain constant... at least for now. > > >On Sun, 31 Jan 1999, David Sprenkle wrote: > >> I need some code or a algorithm for generating a 8 bit random number on >> a PIC. Does anyone have any code or an algorithm to accomplish this? >> >> P.S. I need working code or a working algorithm, not theory. Thanks. >> I been off the list for a while so I apologize if I am reposting >> anything. >> >> -- >> David Sprenkle >> > +---------------*----------------+ | Sean Breheny | | Amateur Radio Callsign: KA3YXM | | Electrical Engineering Student | +---------------*----------------+ Save lives, please look at http://www.all.org Personal page: http://www.people.cornell.edu/pages/shb7 mailto:shb7@cornell.edu Phone(USA): (607) 253-0315 ICQ #: 3329174