> From: Andrew Warren > > Tjaart van der Walt wrote: > > > Here's the easiest way. You can do it in hardware or software. > > Although it is not *truly* random, it is quite good indeed : > > > > Take a shift register (the longer the better), and tap two or three > > of the stages. Add the taps (discard the carry - it is the same as > > XORing) and feed back into the input of the shift register. > > Tjaart: > > This only works well if you pick the CORRECT two or three taps... > Just choosing an arbitrary pair is unlikely to give a reasonably-long > sequence. > > There are a couple of linear-feedback shift-register routines on my > web page... This is true, but getting off-track from the original request, which was a way to determine a 'really random' seed value on power up. With a deterministic machine such as a PIC, one must refer to some 'random' external event to initialise a shift register etc. otherwise the machine will repeat the same sequence each time. Regards, SJH Canberra, Australia