[comp.lang.vhdl] Random Number generator in VHDL

janick@bcrkd13.bnr.ca (Janick Bergeron) (02/26/91)

In article <1991Feb7.152251.29436@src.honeywell.com>,
carpent@SRC.Honeywell.COM (Todd Carpenter) writes:
> 
> RANDOM_pack.VHDL
>   -- This has some interesting problems.  Namely, saving a seed.
>   -- You can do that with a global signal in a package, but it gets ugly
>   -- when you want to have multiple threads for uncorrelated
>   -- sequences.  Anyone have some good ideas for a solution?
>   --
>   -- Another route is to have the calling routine track the seed value,
>   -- as is the case in ZyCad's "distributions.vhd" random number package.
>   --
>   -- Obvious functions:
>   --   uniform, normal, exponential.

Look in the proceedings of the 1989 Canadian Conference on VLSI, pp 91-98
"Some Elements for High-Level Modelling in VHDL" by E. Cerny, M. Aboulhamid
and S. Curry. It describes (amongst other things) a mechanism for random
number generation and mutual exclusion.

All three authors read this newsgroup so you might reach them directly...

--
Janick Bergeron     Bell-Northern Research, Ltd       Ph.: (613) 763-5457
VHDL Tools            P.O. Box 3511, Station C        Fax: (613) 763-7241
                  Ottawa, Ontario, Canada, K1Y 4H7  Flame: 1-800-DEV-NULL
janick@bnr.ca                     library disclaimer; use disclaimer.all;

drc@coelho (David R. Coelho) (03/01/91)

>In article <1991Feb7.152251.29436@src.honeywell.com>,
>carpent@SRC.Honeywell.COM (Todd Carpenter) writes:
>> 
>> RANDOM_pack.VHDL
>>   -- This has some interesting problems.  Namely, saving a seed.

An alternative approach I have taken to generating random numbers in
VHDL is to create a simple VHDL function which reads random numbers as
needed from an ascii text file using VHDL text I/O. I then wrote a simple
C program which creates the ascii text file. This keeps the VHDL package
tight and simple, and offers much greater flexibility in generating the
random data.