Mersenne Twister, MT32

Pseudo Random Number Generator for Xilinx FPGA

web: www.ht-lab.com
Last updated
: 7th January 2007  

Mersenne Twister MT32 is a pseudo Random Number Generator (RNG) with a uniform distribution and a large prime period of 219937-1. The large period results in long pseudo-random sequences with no repetition. The Mersenne Twister described on this page is based on the MT19937 algorithm by Makoto Matsumoto and Takuji Nishimura.

The MT19937 implementation requires no multiplications or division and hence simplifies FPGA implementation. This page describes a 32bits version of the MT19937 algorithm  implemented on a Xilinx FPGA. The generator is low on resources and can generate a new 32-bits sequence every clockcycle. The seed is pre-calculated as a memory image.

The design is released under the GNU General Public License, for feedback, bug reports comments etc use the feedback form.

Download VHDL source files

How to use it

1) Generate the required seed as a memory image using the supplied mt2coe.exe DOSbox/Cygwin utility.

2) Generate 3 Dual Port Memories using the Xilinx CORE Generator.

3) Confirm the correct operation using simulation.

4) Synthesize and Place&Route

Pin Out

Pin
resetn
clk
ena
random

Description
Active low Reset
Clock
Active high Enable signal
Output 32 bits Random Number

 

Block Diagram
 


Top level diagram from HDL Designer, click to enlarge

General Info

Other links