cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 random number generator is it uniform

Garnett.Robert
Senior III

Hi

I am assuming the random numbers generated by the RNG have a uniform distribution.

Is this correct?

Best regards

Rob

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

The STM32H7 has a so-called TRNG (True RNG), which is based on an analogue noise source and has also been certified by NIST (see AN4230). So you can safely assume that the distribution of the generated 32-bit values is highly uniform.

Good luck!

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Peter BENSCH
ST Employee

The STM32H7 has a so-called TRNG (True RNG), which is based on an analogue noise source and has also been certified by NIST (see AN4230). So you can safely assume that the distribution of the generated 32-bit values is highly uniform.

Good luck!

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Garnett.Robert
Senior III

Thanks Peter,

I will move forward on that basis.

I need a normally distributed random noise source so I will take two numbers from the RNG normalise them and produce a normally distributed float using the Box-Muller Transform.

I have attached a copy of the normal distribution code as a zip in case someone else requires a normal distribution. I have a double version and float version.

Best regards

Rob

ssipa.1
Associate II

It can generate true random 32bit numbers,

Garnett.Robert
Senior III

Additional:

Using the true random number of the RNG should avoid the problems the Box-Muller Transform has when using pseudo-random numbers. This problem results in poor number generation in the "tails" of the generated normal distribution and is known as the "Neave Effect" after the person who studied it.