为提高对高斯分布概率密度函数的近似精度,提出一种基于Ziggurat算法的新的高斯分布随机数生成算法。新算法将高斯分布概率密度函数分成顶部、中部、尾部3个子区域分别进行矩形嵌套分层分割,分割后以正比于矩形面积的概率随机选择一个矩形区域,生成概率密度函数为对应矩形的随机数点(x,y),其横坐标x为输出的高斯分布随机数。针对仿真中出现的极值情况,进一步对尾部区域进行了优化处理。此外,基于Xilinx Virtex 4完成了改进后算法的硬件设计。仿真结果表明,新算法结构简单,易于FPGA硬件实现,生成的随机数能通过高斯分布特性和随机性统计检验。
In order to improve the approximation precision of the Gaussian probability density function (PDF),a new generation algorithm of Gaussian random number is proposed based on the Ziggurat algorithm.In this algo-rithm,the Gaussian PDF is divided into three subareas including the top,the middle and the tail regions,and the subareas are further partitioned into rectangles via nested segmentation.After that,one of the rectangles is random-ly chosen with the probability being in direct proportion to the rectangle area,and the random points (x,y),whose PDF is identical to the rectangle,are generated,with x being the output as a Gaussian random number.Moreover, the tail region is treated separately to take into consideration the extreme values occurring in the simulation.The new algorithm is implemented on Xilinx Virtex 4,and the simulated results indicate that the proposed algorithm with simple structure is easy to implement on FPGA,and that the generated random numbers can successfully pass the statistical tests of Gaussian distribution and randomness.