> > Look carefully, and I think you'll figure out that the functions on > > the page referenced ARE implementations of Galois LFSRs. > > Particularly clever implementations thereof that don't look > like they > > contain nearly enough instructions do so ... > > The page also contains a few others that look a bit dodgy. I > was mainly aiming at the one at the top, that claims to > rotate with carry and to output that as random (AFAICT). The problem with the rotate & carry routines is they repeat, eg after 65k operations (16 bit register). Not that you'd notice in most cases. Also think about how to seed the routine, a way to cause the routine to jump to a different spot in the sequence. In other words, start the register at a number, not 0. Like in old BASIC games, where RANDOMIZE TIMER was used to seed the routine. (And it always gave the same sequence too for the same seed.) A typical method is that the routine always runs, and when the user presses a button it outputs the current value in the sequence. Ok for a dice rolling app, not so good for something that doesn't have any inputs. Tony -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist