Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Random Number Generation in VHDL

Reply
Thread Tools

Random Number Generation in VHDL

 
 
FPGA
Guest
Posts: n/a
 
      01-24-2008
Hello members,

I would like to know if VHDL already has functions defined to generate
Random Numbers.

If not, which would be the best algorithm for generating random
numbers for implementation on an FPGA.

Thank you
 
Reply With Quote
 
 
 
 
jens
Guest
Posts: n/a
 
      01-24-2008
Good luck with the random numbers, but if you want pseudo-random:
http://en.wikipedia.org/wiki/LFSR.

Xilinx also has an excellent document on LFSRs with polynomials up to
about 1000 bits or so.
 
Reply With Quote
 
 
 
 
Kris Vorwerk
Guest
Posts: n/a
 
      01-24-2008
> I would like to know if VHDL already has functions defined to generate
> Random Numbers.


google is your friend

http://www.velocityreviews.com/forum...generator.html


> If not, which would be the best algorithm for generating random
> numbers for implementation on an FPGA.


The answer to this question will depend on the FPGA architecture that
you're using, as well as your needs for cryptographic security. This
is because, when it comes to pseudo-random number generation, "best"
can be subjective. e.g., "best" speed? "best" area? "best" power
consumption? "best" random numbers (cryptographically secure)?

This is a well-studied area; I recommend that you do some reading to
see what suits you ...

http://en.wikipedia.org/wiki/Random_number_generator


Kris
 
Reply With Quote
 
ed
Guest
Posts: n/a
 
      01-24-2008
On 24 Jan., 18:54, FPGA <(E-Mail Removed)> wrote:
> Hello members,
>
> I would like to know if VHDL already has functions defined to generate
> Random Numbers.
>
> If not, which would be the best algorithm for generating random
> numbers for implementation on an FPGA.
>
> Thank you


Hello FPGA,

Maybe it's off-topic for you, because you want to implement in FPGA
rather than simulating your design,
but have you seen this package :
http://www.janick.bergeron.com/wtb/packages/random1.vhd ?


Ed
 
Reply With Quote
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      01-25-2008
FPGA wrote:

> I would like to know if VHDL already has functions defined to generate
> Random Numbers.


> If not, which would be the best algorithm for generating random
> numbers for implementation on an FPGA.


LFSR are pretty popular for random numbers, and very easy to
implement in an FPGA.

-- glen

 
Reply With Quote
 
Ann
Guest
Posts: n/a
 
      01-25-2008
On Jan 25, 1:01*am, glen herrmannsfeldt <(E-Mail Removed)> wrote:
> FPGA wrote:
> > I would like to know if VHDL already has functions defined to generate
> > Random Numbers.
> > If not, which would be the best algorithm for generating random
> > numbers for implementation on an FPGA.

>
> LFSR are pretty popular for random numbers, and very easy to
> implement in an FPGA.
>
> -- glen


I just found out that I need random number generator just for
simulation. I do not need to synthesize it. Some feedback on this
would be helpful. I am having a look at some of the links posted here.

Thanks
 
Reply With Quote
 
Dwayne Dilbeck
Guest
Posts: n/a
 
      01-25-2008
I usually use a maximal LFSR to obtain psuedo random numbers.

The following link will give you some good information.
http://www.xilinx.com/ipcenter/catal.../docs/lfsr.pdf

I like Appendix B wich lists the tap points up to 168bits for a maximal
length LFSR.

The following would generate psudeo random 64 bit numbers starting with seed
value 1.

entity generator is
port (
clk:in bit;
aut bit_vector(63 downto 0));
end;


achitecture processflow of generator is
begin
CLKEDrocess
variable temp:bit_vector(63 downto 0) :=
X"0000_0000_0000_0001";
begin
temp := temp(63 downto 0 ) & (temp(63) xor temp(62) );
a <= temp;
wait until (clk = '0');
end process
end

"glen herrmannsfeldt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). ..
> FPGA wrote:
>
>> I would like to know if VHDL already has functions defined to generate
>> Random Numbers.

>
>> If not, which would be the best algorithm for generating random
>> numbers for implementation on an FPGA.

>
> LFSR are pretty popular for random numbers, and very easy to
> implement in an FPGA.
>
> -- glen
>



 
Reply With Quote
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      01-25-2008
Ann wrote:
(snip)

> I just found out that I need random number generator just for
> simulation. I do not need to synthesize it. Some feedback on this
> would be helpful. I am having a look at some of the links posted here.


LFSR are fairly popular now for software implementations, though
linear congruential generators are also still popular.

Linear congruential is probably easy for simulation, not quite
as easy as LFSR for synthesis.

The favorite reference is Knuth, "The Art of Computer Programming",
volume 2. Worth having for anyone working with computers.

-- glen

 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      01-25-2008
some typos:

> achitecture processflow of generator is


architecture

> temp := temp(63 downto 0 ) & (temp(63) xor temp(62) );

1
> end process

;
> end

;
 
Reply With Quote
 
sly
Guest
Posts: n/a
 
      01-25-2008
Mike Treseler a écrit :
> some typos:
>
>> achitecture processflow of generator is

>
> architecture
>
>> temp := temp(63 downto 0 ) & (temp(63) xor temp(62) );

> 1
>> end process

> ;
>> end

> ;


temp := temp(62 downto 0) & (temp(63) xor temp(62) );

(shift register)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
Random Number Generation dpi VHDL 4 03-26-2010 10:31 AM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
Need Help With Random Number Generation Between Upper and Lower Bound ANM Java 2 03-07-2004 07:18 AM
random number generation and Monte Carlo simulation in C++ mescaline C++ 4 09-10-2003 09:01 PM



Advertisments