Re: 8 Bit Random Numbers
- From: nospam@xxxxxxxxxx
- Date: Sun, 01 Feb 2009 14:35:55 +0000
Bill Bowden wrote:
That's interesting John. I changed your tap sequence to what I had
from the other program so the xor sequence is:
tap1 = q5 XOR q6
tap2 = q4 XOR tap1
tap3 = tap2 XOR q8
srin = nor XOR tap3
This seems to represent what I had earlier with bits 5,6 exored, and
that result xored with bit 3, and that result xored with bit 8.
Worked well and produced the expected results with the addition of the
zero lockup state on count 25.
Not sure how the zero gets eliminated, but the sequence continued with
the correct values after the zero state.
I'll give it some more though and maybe figure it out.
Nice job. Some people say it's impossible to eliminate the zero lockup
state, but looks like that's not the case.
IIRC, you can eliminate the zero lockup state, but only by introducing
some other state that locks up. What you cannot do is make an XOR-based
PRNG that pseudorandomly cycles through all values from 0 to 255.
If you are using a PC or microcontroller rather than logic gates,
the RC4/ARCFOUR algorithm is a good alternative to an XOR-based
PRNG, is far, far more difficult to predict, and does not cycle
unless you are willing to wait many millions of years.
.
- Follow-Ups:
- Re: 8 Bit Random Numbers
- From: John Fields
- Re: 8 Bit Random Numbers
- References:
- Re: 8 Bit Random Numbers
- From: Bill Bowden
- Re: 8 Bit Random Numbers
- Prev by Date: Re: What passes as Pulse Width Modulation in DC Motor Control?
- Next by Date: Re: 8 Bit Random Numbers
- Previous by thread: Re: 8 Bit Random Numbers
- Next by thread: Re: 8 Bit Random Numbers
- Index(es):
Loading