'Chaos/Random generator ?'
does anyone have a pointer to a piece of code which would generate a
chaotic or random output ?
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.
More... (looser matching)
- Last day of these posts
- In 1995
, 1996 only
- New search...