Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can I generate random numbers using combo/sequential logic?

Status
Not open for further replies.

tronix

Advanced Member level 4
Joined
Jul 6, 2006
Messages
116
Helped
8
Reputation
16
Reaction score
1
Trophy points
1,298
Activity points
1,967
Hi
How can I generate random Nos using combo/sequential logic
 

Re: Random No. generator

Hi, Look for LFSR at google !.

regards,

Paul.
 

    tronix

    Points: 2
    Helpful Answer Positive Rating
Re: Random No. generator

Use F/F and Xor gates.
 

    tronix

    Points: 2
    Helpful Answer Positive Rating
Re: Random No. generator

Hi
This ckt is frm Wiki but still can't make out how will it generate random Nos
 

Random No. generator

Hi..this is a Linear Feedback Shift Register...which gives you a PSEUDO Random output usually called a PN code. The register has a feedback (the next bit to be loaded into the register) that is an XORED combination of bit number 10, 12, 13 and 15. Thus the output will repeat after [(2^16)-1] bits. So for the period of [(2^16)-1] bit period it is a random generator
 

    tronix

    Points: 2
    Helpful Answer Positive Rating
Re: Random No. generator

Yes, you're right, the circuit is indeed NOT random enough since it is 16-bit long. Unfortunately, ture random number generator is not easy to build. If your task is to build really good RNG, there are some comp. arith. book like Knuth's available.
 

Re: Random No. generator

i have done this work recently


i recommended u to use clock contronlled generator(a type of nonlinear feedback shift registers)to get you random no.
 

Random No. generator

is there any standard for this ? okie, we use LFSR with some polynomial, lets say. is there any criteria for choosing this polynomial ? or the initial seed value ?

is there any difference between this and CRC ?
 

Re: Random No. generator

sree205 said:
is there any standard for this ? okie, we use LFSR with some polynomial, lets say. is there any criteria for choosing this polynomial ? or the initial seed value ?

is there any difference between this and CRC ?

I also want to know it, need the initial seed value should be choosen to be the middle of the random number range, or has it another standard choice?
 

Random No. generator

Using clock jitters from PLL's VCO can generate nearly true random numbers.
 

Random No. generator

Xilinx has a nice app note that lists feedback equations for LFSR lengths from 3 to 168:
https://www.xilinx.com/bvdocs/appnotes/xapp210.pdf

The initial seed value can be any number, except for all-zeros or all-ones (depending on your feedback polarity) because that state will lock-up the LFSR.
 

Random No. generator

to understand it better, you cannot make a perfect random number generator. Thats why you could always see Pseudo random projects from the internet. You could make it more random like but introducing some factors, like special gates, shift registers, and some has a clock so that the program will base the seed of the shift register from the clock value.
 

Random No. generator

It is prefarable to have the initial seed a prime number to get better results
 

Re: Random No. generator

Hi, If you look at random number papers they usually are also giving a formula for calculating the perfect starting (seed) value. I know of a paper from TI. Not any number is a perfect seed to start. If you use a shift register XOR based generator you should NEVER use 0 as seed since it will not give any change !.

regards,

Paul.
 

Random No. generator

Some random number generates are sensitive to seed value, but an LFSR repeats the exact same sequence no matter what seed value you use (excluding that one lock-up value). The seed simply changes the sequence starting point. However, an LFSR is still very useful because it is easy to build one with an extremely long sequence.

It's true that you can't generate truly random numbers by using only digital logic. You need need to include some fundamentally random factor such as thermal noise. That's the basis behind adsl's suggestion.
 

Random No. generator

quite easy to implement hw rng is here
**broken link removed**
one of the testing method can be found here:
**broken link removed**
 

Re: Random No. generator

To echo47: "an LFSR repeats the exact same sequence no" Not true. LFSR is sensitive to zero and polynomial value that is the same as LFSR. Try something before you make a statement !. The path you select on a LFSR is different depending on the seed value.

ALL pseudo random generators have this problem, no matter what. I do not remember the TI paper but it was very good and explained also the math behind it.

Paul.

Some LINKS for people who know better:
"
Since each starting state produces a different (we are considering shifts as different) sequence, there are 2n elements in (f) since there are that many starting states. The sum of two sequences in (f) is again in (f) since the sum will satisfy the same recursion relationship (i.e., the sum corresponds to a different starting state).

We can characterize the elements of (f) in terms of the reciprocal polynomial of f.
"
From: **broken link removed**
 

Re: Random No. generator

hi
the random nos can be generated using LFSRs.various configurations of LFSRs and their advantages very clearly spec in the book DFT-Abromovicci.better u refer this.
 

Re: Random No. generator

To vinodkumar:

Your ref. is also good but do not know if its available to all in pdf format :)..

Paul.
 

Re: Random No. generator

hope this will also be useful.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top