In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Coriolis wrote: [quote="jgjonola"] Please let me know if you find a solution for true random numbers, as i have an application that could be using in a gaming device, but the specs require true RN. When programming in C on a pc, i have used the "mersenne twister" (google it) method, and it passed all of the tests, but i cant replicate that on the SX. Thanks! John Gjonola[/quote]Sorry to tell you but mersenne twister is a psuedo-random number generator. Granted it repeats only after 2[sup]19937[/sup] ? 1 iterations, but it still isn't a random generator. The only way to generate truely random numbers is by sampling a physical process which is inherently random, such as nuclear decay, or my favorite, [url=http://patimg1.uspto.gov/.piw?Docid=05732138&homeurl=http%3A%2F%2Fpatft.uspto.gov%2Fnetacgi%2Fnph-Parser%3FSect1%3DPTO1%2526Sect2%3DHITOFF%2526d%3DPALL%2526p%3D1%2526u%3D%2Fnetahtml%2Fsrchnum.htm%2526r%3D1%2526f%3DG%2526l%3D50%2526s1%3D5732138.WKU.%2526OS%3DPN%2F5732138%2526RS%3DPN%2F5732138&PageNum=&Rtype=&SectionNum=&idkey=6BC89C23A147][u][color=green>a][/u][/url] (though it is technically used as a random number seed generator since there is a strong correlation of numbers between two closely sampled images, though a hash can take care of that (and also add a level of complexity and computational time)). If you are interested in other psuedo random number generators look [url=http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators][u]here[/color][/u][/url]. If you want strong random numbers, it is both memory and computationaly intensive, and you will likely need a dedicated SX as a co-processor generating them. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=90112#m90443 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)