At 08:26 AM 8/20/01 -0500, Don Hyde wrote: >The following code implements a linear feedback register type of >pseudo-random number generator. This algorithm is frequently implemented in >hardware for spread-spectrum radio applications. > >It will generate all possible bit combinations EXCEPT all zeroes, for >various lengths, if the value is Poly is chosen correctly, and Variable is >initialized with any non-zero number. You're right, but as long as you use less than the full length of the shift register, you can get all states. In one app, I use 8 bits from the 19 bit version, picked more or less at random, with some bit inversions and anding. But the initial byte that I grab can have any state. -- Dave's Engineering Page: http://www.dvanhorn.org I would have a link to http://www.findu.com/cgi-bin/find.cgi?KC6ETE-9 here in my signature line, but due to the inability of sysadmins at TELOCITY to differentiate a signature line from the text of an email, I am forbidden to have it. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads