Michael Rigby-Jones 18/04/2000 09:46 Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: (bcc: Dan Lloyd/GBPTD/ABB) Subject: Re: [OT] Software Random function Security Level:? Internal > -----Original Message----- > From: D Lloyd [SMTP:dan.lloyd@GB.ABB.COM] > Sent: Tuesday, April 18, 2000 9:02 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [OT] Software Random function > > Marc > 17/04/2000 17:51 > > > Please respond to pic microcontroller discussion list > > > To: PICLIST@MITVMA.MIT.EDU > cc: (bcc: Dan Lloyd/GBPTD/ABB) > Subject: Re: [OT] Software Random function > > Security Level:? Internal > > > > > LFSR: RLF RANDOM,W > > RLF RANDOM,W > > BTFSC RANDOM,4 > > XORLW 1 > > BTFSC RANDOM,5 > > XORLW 1 > > BTFSC RANDOM,3 > > XORLW 1 > > MOVWF RANDOM > > RETLW 0 > > Pretty predictable (short-term), isn't it? > > * That's what I was thinkning. I imagine you have to be pretty careful how > you > use this. > > Dan > It's utterly predicatble. It is after all, a PSEUDO random number generator. It produces a repeating pattern of a very limited length. Not sure if its 127 or 255 for this arrangement. You could use a 24 bit (or more) register to get longer patterns though, using the same principle. The Art of Electronics has a good section on maximal length PRBS generators. Mike * There seems to be a pretty good random number algorithm at http://burtleburtle.net/bob/ [+C source files]. I cant remember if the link came from the PICLIST or not; it describes the ISSAC random (pseudo ; ) number generator, anyway. Dan Content-type: text/html; name="att1.htm" Content-Disposition: attachment; filename="att1.htm" Content-Description: Internet HTML Attachment converted: definition:att1.htm (TEXT/MSIE) (0000FD4C)