More playing with the 41-bit linear feedback shift register because I can't leave the thing alone 🙂

By Julian

Youtuber, shed dweller, solar charge controller aficionado

15 thoughts on “Update: lfsr pattern predictions and randomlessness”
  1. Avataaar/Circle Created with python_avatars RoboticusMusic says:

    Does it need robust ECC ideally? Can cosmic rays suddenly change a bit making it predictable?

  2. Avataaar/Circle Created with python_avatars Raymond Jerome says:

    can you show us the general circuit diagram

  3. Avataaar/Circle Created with python_avatars Greg Ewing says:

    The phenomenon of patterns with few ones not looking very random happens in a big way with the Mersenne Twister PRNG. If you start it in a state that's mostly zeroes, it takes thousands of cycles before it starts producing decently distributed outputs. Typically one uses another small PRNG to seed it.

  4. Avataaar/Circle Created with python_avatars foxtrot151000 says:

    At 2MHz the cycle would repeat every 305.42 hours, or 12.72 days

  5. Avataaar/Circle Created with python_avatars ffejrxx says:

    is that kinda how random seeding worked in basic?
    populate with a random seed and let randomize go from there in its psudo random order

  6. Avataaar/Circle Created with python_avatars KlockworXMusic says:

    I figured out last video at 1Hz it would take almost 70000 years before it would start to repeat, and at about 1MHz it would take a little over 25 days before it would start the pattern again, so at 2MHz, I am guessing about 12.5 days? A shockingly long time considering how fast its running. Even at 1GHz, its going to be longer then a half hour. Although it helps put into perspective the amount of 1's and 0's a computer can wrangle.

  7. Avataaar/Circle Created with python_avatars Philip Hampton says:

    Very cool =)

  8. Avataaar/Circle Created with python_avatars RWBHere says:

    About 12.75 days.

  9. Avataaar/Circle Created with python_avatars Unclerojelio says:

    I don't suppose you'd care to post a circuit diagram?

  10. Avataaar/Circle Created with python_avatars Hrnek Bezucha says:

    I'm looking this a lot. I'll make a board of that. With jumpers from the XORs. Yes, I like that a lot.

  11. Avataaar/Circle Created with python_avatars JasonMasters says:

    Just repeating what I said on the earlier video, you can get a near-enough-to-random number from a scientific calculator by entering a decimal point followed by some random digits, then taking the natural antilogarithm followed by the reciprocal.

    You will get a decimal number which, unless you're a mathematical savant or you've cheated, will be effectively random.

    I notice some people have compared the output to The Game Of Life.

    In case anyone doesn't know The Game Of Life, it's a game where you use a grid of dots, where each dot can be lit (alive) or unlit (dead).

    Each generation, you check how many "living" (lit) neighbours the pixel has. If it has less than 2 living neighbours, it dies of loneliness for the next generation. If it has 2 living neighbours, it remains unchanged in the next generation. If it has 3 living neighbours, it is alive in the next generation. Any more than 3 living neighbours and it dies of overcrowding for the next generation.

  12. Avataaar/Circle Created with python_avatars Alex C says:

    I think if you print out the initial pattern in rows with the right alignment you'll get a Sierpinski triangle. Try it!

  13. Avataaar/Circle Created with python_avatars Peter D Morrison says:

    Let's just put this to rest. A LFSR does not generate random numbers. Arguably, it does not even produce pseudo-random numbers, because the pattern repeats, identically, after 2n − 1 states. Knowing the current state, you also know the next state.

  14. Avataaar/Circle Created with python_avatars Wobblycogs Workshop says:

    There are interesting similarities here to Conways game of life, the patterns even appear similar. Not surprising I suppose as they both use XOR to generate the next state based on the current state.

  15. Avataaar/Circle Created with python_avatars Darth Vader says:

    Counting sheep is for amateurs!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.