Truncated match.
PICList
Thread
'Chaos/Random generator ?'
1995\08\22@040950
by
Markus Imhof
Hello,
does anyone have a pointer to a piece of code which would generate a
chaotic or random output ?
Bye
Markus
1995\08\25@073736
by
BobbyD
Regarding a random number generator for a pic you may wish to try
the following algorithm. It is not truely random but it will produce
what at least looks random.
Take an 8 bit array with bit 7=msb and bit 0=lsb.
1) Assign a variable bit1=array(0) .xor. array(1)
2) Assign a variable bit2=array(6) .xor. array(7)
3) Assign a variable bit3=bit1 .xor. bit2
4) Rotate the array one to the right.
5) Assign array(7)=bit3
6) Goto 1
This algorithm requires an initial seed located in array. The
output of the random number generator will be in array.
Bob
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- Today
- New search...