Efficient Random Number Generation

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
shawn
XCore Addict
Posts: 238
Joined: Thu Dec 17, 2009 5:15 am

Post by shawn »

You could use if to seed a boat load of other sic's.


User avatar
oar_some
Member
Posts: 8
Joined: Thu Feb 11, 2010 7:46 pm

Post by oar_some »

use the provided functions?!
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm

Post by jonathan »

oar_some wrote:use the provided functions?!
What provided functions, where?

Not helpful.
Image
User avatar
that_awesome_guy
Member
Posts: 10
Joined: Mon Dec 14, 2009 7:06 pm

Post by that_awesome_guy »

um...

Code: Select all

#include <xs1.h>
#include <math.h>
#include <print.h>
#include <stdlib.h>

int main()
{
	printuintln(rand());
	return 0;
}
:?: :?: :?: :?: :?: :?: :?: :?:
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm

Post by jonathan »

Thanks, but the sarcasm wasn't needed. Where are these documented?

Don't you work for XMOS? I thought XMOS staff were supposed to be helpful! It feels like you are trying to make me out to be an idiot. That isn't what this site is about. Or so I thought?
Image
User avatar
that_awesome_guy
Member
Posts: 10
Joined: Mon Dec 14, 2009 7:06 pm

Post by that_awesome_guy »

I thought it was a helpful pointer, sorry you didn't feel that way.

These are standard C functions, they are not xmos specific. If XMOS supports standard C then I would personally expect it to support standard library functions such as these. Standard library documentation can be found here - http://en.wikipedia.org/wiki/Stdlib.h
User avatar
jonathan
Respected Member
Posts: 377
Joined: Thu Dec 10, 2009 6:07 pm

Post by jonathan »

Thank you. Much more helpful and not in the least bit patronizing. :-)
Image
User avatar
dan
Experienced Member
Posts: 102
Joined: Mon Feb 22, 2010 2:30 pm

Post by dan »

The L1 series has some ring oscillators which were put in for our characterisation purposes. They are free running counters that have no relationship with any other clocks and oscillate with a PVT dependant frequency between 300 and 700 mhz, if you enable them.

They can be read in software with a GETPS, but are not documented AFAIK.

Would these be of any use?
User avatar
otitov
XCore Addict
Posts: 207
Joined: Thu Dec 10, 2009 11:00 pm
Location: Mexico

Post by otitov »

anyway it would be very interesting to try them!
User avatar
shawn
XCore Addict
Posts: 238
Joined: Thu Dec 17, 2009 5:15 am

Post by shawn »

dan wrote:The L1 series has some ring oscillators which were put in for our characterisation purposes. They are free running counters that have no relationship with any other clocks and oscillate with a PVT dependant frequency between 300 and 700 mhz, if you enable them.

They can be read in software with a GETPS, but are not documented AFAI?
This is interesting, I wonder what other eggs we may find. perhaps useful for simulation.