Random number question

All technical discussions and projects around startKIT
JLS
Member++
Posts: 18
Joined: Fri Feb 14, 2014 11:21 am

Random number question

Postby JLS » Fri Feb 21, 2014 11:10 am

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
User avatar
infiniteimprobability
XCore Legend
Posts: 1124
Joined: Thu May 27, 2010 10:08 am

Postby infiniteimprobability » Fri Feb 21, 2014 11:43 am

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
JLS
Member++
Posts: 18
Joined: Fri Feb 14, 2014 11:21 am

Postby JLS » Fri Feb 21, 2014 1:10 pm

Thanks reply

nice module - this weekend test it :-)
User avatar
Ross
XCore Expert
Posts: 768
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Fri Feb 21, 2014 1:34 pm

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

FYI, rand() etc are in stdlib.h

Who is online

Users browsing this forum: No registered users and 1 guest