Anonymous user
Random Number Generator: Difference between revisions
m
→Linear feedback shift register
[unchecked revision] | [unchecked revision] |
(→Pseudorandom number generators: Linear Feedback Shift Registers) |
|||
Line 67:
=== Linear feedback shift register ===
A Linear Feedback Shift Register (LFSR) is a simple way to generate a very long sequence of random numbers, given a non-zero seed. The idea is as follows: an ''n''-bit LFSR has ''n'' 'registers', each containing one bit (either 0 or 1). Initially, all the registers are filled with the bits from an ''n
The sequence of bits that an LFSR can produce will eventually repeat, but by choosing the XOR'ed bits carefully the period of the LFSR can be increased to up to 2<sup>n</sup> - 1 bits. This means that after a sequence of 2<sup>n</sup> - 1 bits, the same sequence will be returned. However, this is a property that all pseudo-random number generators have: without changing the seed, they will eventually repeat themselves.
|