Page 1 of 1

Random number question

Posted: Fri Feb 21, 2014 11:10 am
by JLS
Hi all

Is possible make random number generator with random first state ? (like true random)

I´m testing random routine from StartKit example projects (app_noughts_and_crosses) but not working - first value when ON StartKit is same value like before previous ON !

Second question - c++ function rand() or random() not implement in compiller ?

Thanks info

Kamil

Re: Random number question

Posted: Fri Feb 21, 2014 11:43 am
by infiniteimprobability
Yep - should be possible, depending on your definition of random!

There's a free running ring oscillator in each tile which varies based on PVT which can be used as a seed, so pretty difficult to predict without detailed knowledge of you power supply rail, die temperature and batch code of the chip. Should be random enough for gaming ;-)

https://github.com/xcore/sc_util/tree/m ... ule_random

Re: Random number question

Posted: Fri Feb 21, 2014 1:10 pm
by JLS
Thanks reply

nice module - this weekend test it :-)

Re: Random number question

Posted: Fri Feb 21, 2014 1:34 pm
by Ross
JLS wrote: Second question - c++ function rand() or random() not implement in compiller ?

FYI, rand() etc are in stdlib.h