[comp.lang.vhdl] VHDL Math packages

carpent@SRC.Honeywell.COM (Todd Carpenter) (02/07/91)

Has anyone established an anonymous ftp'able VHDL repository yet?  Does anyone
use simtel(sp?) ?  Does anyone even remember where simtel is?

I could use a statistics package and a random number package, and a math
package.  I would expect that these functions should be real VHDL, and not
some kludge hack interface to another language.  Of course, you do lose a
significant amount of performance that way, but I need portability at this
point.

Note that this code is by no means expected to be synthesizeable.  (But if it
were...)


STATISTIC_pack.VHDL
  -- Obvious functions:
  --   mean, median, variance, histogramming, min, max

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.

MATH_pack.VHDL
  -- Obvious functions:
  --   exp  nat_log  log  com_log  bin_log  sqrt  exp  "abs"  floor
  --   ceil  round, sin  cos  tan  arcsin  arccos  arctan
  --   
  -- Extras:
  --   + hyperbolic, bessel, and all the other functions you'd want.
  --
  --   Gee, complex functions would also be really handy.  That would
  --   lead to libraries of complex functions, such as FFTs and filters.



For many of these functions, multiple implementations will surely exist.  It
might be worthwhile to have people submit their algorithms for say, generating
a square root.  These can be specialized routines (such as generating an
integer approximation to the square root of an integer (or bit vector)), or as
generic as one wishes.  The tradeoffs are, of course, accuracy, applicability,
and performance.  It shouldn't be too horribly difficult to catagorize the
different sets of functions in some reasonable fashion.

  Finally, *test* programs for all this stuff would be useful.  How many of you
have used (or written) random number generator without building an adequate
tester to demonstrate that your generator produces something that at least
appears random?  Eyeballing the results is *not* a good yardstick!  Round off
error is also something which should be tested.




Please email me, and I will summarize and post results to comp.lang.vhdl as
interest indicates.  


Todd P. Carpenter              Honeywell Systems and Research Center
(612)782-7229      3660 Technology Drive, Minneapolis, MN 55418-1006
carpent@src.honeywell.com      or       Arkon%kryl@src.honeywell.com
<any-smart-host>!srcsip!carpent      Citadel: US 612 699 3106 (Kryl)
User Manual, p34, line 5:  I am not authorized to have any opinions.
 

Maybe we could even get the IEEE to standardize a set of these functions?
(HA-Ha-ha!  <snort!>)

Professors!  Looking for nasty programming assignments for your students?
Hint-hint...