FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5990 Discussions

Simple RNG for the DE2 board

Altera_Forum
Honored Contributor II
906 Views

I need a process to produce a seemingly random integer, is it possible to use the rand function and if so, what library do i need to use? 

 

Thanks for any help
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
97 Views

What kind of statistics? Uniform distribution, or normal distribution? A uniform distribution is fairly easy to generate using a linear feedback shift register. A normal (Gaussian) distribution can be generated by summing multiple LFSRs, or LFSR samples, or by filtering an LFSR. It depends on the rate at which you want to generate the random data. 

 

Alternatively, you can always write a block of data to RAM, and then process that data. This method is nice for testing identical data in MATLAB, Modelsim, and in hardware. 

 

Cheers, 

Dave
Altera_Forum
Honored Contributor II
97 Views

Fixed it by using a 8 bit counter at 50 MHz and taking out the bit code when my state machine resets

Reply