floating point random number generation in verilog.

Is there a way to generate random floating point numbers in either verilog or system verilog? More specifically through some hardware implementation?

1 answer

  • answered 2018-04-14 17:40 Oldfart

    A floating point number is just a number of bits. As such generating a random floating point number can be done by generating random bits and then interpreting them as a float (Or real as they are called in both VHDL and Verilog).

    A standard way of generating a series of random bits in hardware is using a PRBS generator (Pseudo Random Bit Sequence generator): A linear feedback shift register with special feedback to get the maximum sequence. There are various polynomial depending on how long a PRBS you want to have.

    For exact implementation I suggest you search for PRBS.