RM0440 Rev 4 833/2126
RM0440 True random number generator (RNG)
843
Post processing
The sample values obtained from a true random noise source consist of 2-bit bitstrings. 
Because this noise source output is biased, the RNG implements a post-processing 
component that reduces that bias to a tolerable level.
More specifically, for each of the two noise source bits the RNG takes half of the bits from 
the sampled noise source, and half of the bits from inverted sampled noise source. Thus, if 
the source generates more ‘1’ than ‘0’ (or the opposite), it is filtered
Conditioning
The conditioning component in the RNG is a deterministic function that increases the 
entropy rate of the resulting fixed-length bitstrings output (128-bit).
Also note that post-processing computations are triggered when at least 32 bits of raw data 
has been received and when output FIFO needs a refill. Thus the RNG output entropy is 
maximum when the RNG 128-bit FIFO is emptied by application after 64 RNG clock cycles.
The times required between two random number generations, and between the RNG 
initialization and availability of first sample are described in Section 26.5: RNG processing 
time.
The conditioning component is clocked by the faster AHB clock.
Output buffer
A data output buffer can store up to four 32-bit words which have been output from the 
conditioning component. When four words have been read from the output FIFO through 
the RNG_DR register, the content of the 128-bit conditioning output register is pushed into 
the output FIFO, and a new conditioning round is automatically started. Four new words are 
added to the conditioning output register 213 AHB clock cycles later.
Whenever a random number is available through the RNG_DR register the DRDY flag 
transitions from “0” to “1”. This flag remains high until output buffer becomes empty after 
reading four words from the RNG_DR register.
Note: When interrupts are enabled an interrupt is generated when this data ready flag transitions 
from “0” to “1”. Interrupt is then cleared automatically by the RNG as explained above.