LFSR pseudo random generator (PRNG)
virtuPIC
Posts: 193
The last recent days I participated in technical, philosophical, funny discussion on random numbers, pseudo random numbers, one time pads and how to generate them. Here I've got an LFSR as a pseudo random generator.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
- It handles one word. Up to 32 bit SR length.
- You have to configure it with the feedback tap sequence.
- Period depends on the feedback tap sequence and can be up to 2n-1.
- LFSR sequences have good properties for simulation.
- LFSR sequences are very good test data for random tests.
- LFSR sequences have a very flat frequency spectrum.
- LFSR are extremely weak in cryptography.
- LFSR state gives a pseudo random number from 1 to 2n - 1. But do not use the bits generated for more than one generated number since this would introduce statistical correlation.
- several Mbits size
- reproducible
- unsorted
- uncorrelated
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Airspace V - international hangar flying!
www.airspace-v.com/ggadgets for tools & toys
Comments
Well I just used this in a RAM test for Bill's VMCog. No idea how well it works as a PRNG but it the output looks messy enough[noparse]:)[/noparse] Another test to the battery.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Post Edited (pullmoll) : 6/8/2010 2:43:23 PM GMT
There is always diehard and dieharder tests www.phy.duke.edu/~rgb/General/dieharder.php
Never heard of ent before though.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Cheers,
Istvan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Intentionally Left Blank
Istvan,
I'm getting a "File not found" message when I click on that link.
As virtuPIC, I am also interested on PRNGs, these days, particularly on LFSRs.
As reminder I 'll add that every sequence on an LFSR is outputted depending on an inner state and a characteristic polynomial (primitive) of the form Xn + Xk + 1. (n is the length of the LFSR, as described earlier)
I see in some documentations that there is a probability for each generated bit of the sequence that depends on the characteristic polynomial or a group of chracteristic polynomials used with a fixed inner state
Have someone an idea about how knowing that information or calculating this probability?
looking forward to hear from you
Spin has an in built LFSR as it's random operator.
However I have found that if you run a sequence of a million or so of it's output through a test of randomness program like ENT, mentioned above, it fails miserably.
Fot this reason I implemented rather better pseudo random number generators in Spin. Have a search for recent threads on MWC256 for example.
I cannot fathom what it is you are trying to do with LFSR.