Random: Overview

Overview

From this overview it is clear there are better choices for the random function in Tiny Core.  Even the Xorshift-16 generator is a good choice for some applications (like a Blinky).

Algorithm Code Data Speed Quality Notes
Park-Miller 498  4 1.947 – 6
Xorshift 126  4 0.323 – 4 primary choice, normal quality
JKISS32 356 20 0.433 +1 high quality
CRC32 104  4 0.610 – 1 secondary choice, better quality
Xorshift-16  34  2 0.044 low use for ’13, maybe ‘2n

The Plan

The current plan is to use Xorshift as the default generator.  Of the generators evaluated, it isn’t the smallest nor the fastest nor the best quality.  It is small, fast, andgood quality so it is a very nice compromise.

The CRC32 generator will be an available option as a better quality smaller generator.

The JKISS32 generator will be an available option as a very high quality generator on all but the processors with the least memory (probably only excluding the ATtiny13).

The Xorshift-16 generator will be the default for the ATtiny13 processor and possibly the ATtiny25 and ATtiny24 processors.

Leave a Reply