RNG — Random number generator

The Random number generator (RNG) generates true non-deterministic random numbers based on internal thermal noise that are suitable for cryptographic purposes. The RNG does not require a seed value.

Figure 1. Random number generator

The RNG is started by triggering the START task and stopped by triggering the STOP task. When started, new random numbers are generated continuously and written to the VALUE register when ready. A VALRDY event is generated for every new random number that is written to the VALUE register. This means that after a VALRDY event is generated the CPU has the time until the next VALRDY event to read out the random number from the VALUE register before it is overwritten by a new random number.

Bias correction

A bias correction algorithm is employed on the internal bit stream to remove any bias toward '1' or '0'. The bits are then queued into an eight-bit register for parallel readout from the VALUE register.

It is possible to enable bias correction in the CONFIG register. This will result in slower value generation, but will ensure a statistically uniform distribution of the random values.

Speed

The time needed to generate one random byte of data is unpredictable, and may vary from one byte to the next. This is especially true when bias correction is enabled.

Registers

Table 1. Instances
Base addressPeripheralInstanceDescriptionConfiguration
0x4000D000RNGRNG

Random number generator

  
Table 2. Register Overview
RegisterOffsetDescription
TASKS_START0x000

Task starting the random number generator

 
TASKS_STOP0x004

Task stopping the random number generator

 
EVENTS_VALRDY0x100

Event being generated for every new random number written to the VALUE register

 
SHORTS0x200

Shortcut register

 
INTENSET0x304

Enable interrupt

 
INTENCLR0x308

Disable interrupt

 
CONFIG0x504

Configuration register

 
VALUE0x508

Output random number

 

SHORTS

Address offset: 0x200

Shortcut register

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

VALRDY_STOP

  

Shortcut between VALRDY event and STOP task

See EVENTS_VALRDY and TASKS_STOP

   

Disabled

0

Disable shortcut

   

Enabled

1

Enable shortcut

 

INTENSET

Address offset: 0x304

Enable interrupt

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

VALRDY

  

Write '1' to Enable interrupt for VALRDY event

See EVENTS_VALRDY

   

Set

1

Enable

   

Disabled

0

Read: Disabled

   

Enabled

1

Read: Enabled

 

INTENCLR

Address offset: 0x308

Disable interrupt

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

VALRDY

  

Write '1' to Disable interrupt for VALRDY event

See EVENTS_VALRDY

   

Clear

1

Disable

   

Disabled

0

Read: Disabled

   

Enabled

1

Read: Enabled

 

CONFIG

Address offset: 0x504

Configuration register

Bit number313029282726252423222120191817161514131211109876543210
Id                               A
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
ARW

DERCEN

  

Bias correction

   

Disabled

0

Disabled

   

Enabled

1

Enabled

 

VALUE

Address offset: 0x508

Output random number

Bit number313029282726252423222120191817161514131211109876543210
Id                        AAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IdRWFieldValue IdValueDescription
AR

VALUE

 

[0..255]

Generated random number

 

Electrical specification

RNG Electrical Specification

SymbolDescriptionMin.Typ.Max.Units
IRNG

Run current, CPU sleeping.

500µA
tRNG,START

Time from setting the START task to generation begins. This is a one-time delay on START signal and does not apply between samples.

128µs
tRNG,RAW

Run time per byte without bias correction. Uniform distribution of 0 and 1 is not guaranteed.

30µs
tRNG,BC

Run time per byte with bias correction. Uniform distribution of 0 and 1 is guaranteed. Time to generate a byte cannot be guaranteed.

120µs