mardi 16 février 2016

How good are VHDL's random numbers?

I'm using VHDL's random numbers from IEEE.math_real, but how good are these generated numbers?

.... let's say compared to rand(...) from C.

Have there been statistical tests?


Here is a histogram of a Gaussian distribution. Parameters:

  • Random source: 2 uniform distributed REAL values generated by math_real.Uniform(...)
  • Box-Muller transformation
  • calculated using REAL
  • Output rang: 0..4095 INTEGER
  • 102.400 iterations

Classic histogram view:
NormalDistributedRandomValue 100Ki iterations; range 0..4095

As a point cloud:
NormalDistributedRandomValue 100Ki iterations; range 0..4095


Here is a histogram of a uniform distribution. Parameters:

  • Random source: uniform distributed REAL values generated by math_real.Uniform(...)
  • calculated using REAL
  • Output rang: 0..4095 INTEGER
  • 102.400 iterations

Classic histogram view:
NormalDistributedRandomValue 100Ki iterations; range 0..4095

As a point cloud:
NormalDistributedRandomValue 100Ki iterations; range 0..4095

Gnuplot fitting results for f(x)=m*x+b:

m = -0.0000343906
b = 25.0704

In my opinion, both histograms have a high jitter.




Aucun commentaire:

Enregistrer un commentaire