Question:

How do you generate random numbers in a digital circuit?

by  |  earlier

0 LIKES UnLike

I need to know the cheapest and easiest way to create random bits. I am designing a game that requires randomness. Is there some sort of IC out there that would do this for me?

 Tags:

   Report

3 ANSWERS


  1. You can get pseudo-random sequences using a long shift-register and EORing certain bits with each other to create the input.  This can also be done in software, if you are using a microprocessor.

    The only way to get *genuinely* random sequences is to use some genuinely random phenomenon such as radioactive decay, chemical reaction or -- probably the easiest -- white noise.

    If you reverse-bias an LED or the base-emitter junction of a transistor, it will enter a zener-like "constant voltage" state at somewhere between 5 and 6 volts.  However, when you look with an oscilloscope, it won't look very constant at all, but will have a lot of noise superimposed on it!  You can just capacitively couple this to an op-amp.  Add a simple open-collector transistor on the op-amp output, with a suitable pull-up resistor to get logic levels.


  2. I would try the lower end PIC processors. They are low cost and very versatile.  

  3. Be aware that true random numbers are difficult to get. All random number generators require a starting value, and various operations are applied to that number to generate each succeeding number.

    One way to improve the operation is to supply a different starting value each time. Sometimes you can do this with a clock chip, or the time of day in a computer. Use the time in seconds. Others make use of a noise generator.

    search for "random number generator" and you will find a few.

    here is one:

    http://www.cryogenius.com/hardware/rng/

    http://robseward.com/itp/adv_tech/random...

    .

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.