Random Bit Generator
On Thu, 21 Oct 2010 15:01:42 -0700, Jim Thompson
wrote:
I'm only getting 52 before a repeat :-(
(I'm looking at the serial stream.)
...Jim Thompson
Aaargh!
Sorry about that...
Normally the counter jumps over the all-zeroes lockup state and runs
at a length of 2^n - 1.
The error here (egg on face) was that by forcing the counter into the
all-zeroes state, once every cycle, a lot (all?) of the states which
would have existed on the other side of the jump are killed off.
The right way, if starting up in (or accidentally falling into) the
all zeroes state is a concern, is to NOR all the Q's and feed the NOR
output to the XOR, as shown.
That way, the counter runs at maximal length normally, but forces a 1
into the shift register's serial input if its outputs all go to 0, for
whatever reason.
---
JF
|