Skip to main content
Garnett.Robert
Senior III
February 9, 2022
Solved

STM32H7 random number generator is it uniform

  • February 9, 2022
  • 4 replies
  • 2163 views

Hi

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

Is this correct?

Best regards

Rob

This topic has been closed for replies.
Best answer by Peter BENSCH

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

4 replies

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
February 9, 2022

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
February 9, 2022

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
Visitor II
February 9, 2022

It can generate true random 32bit numbers,

Garnett.Robert
Senior III
February 9, 2022

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.