TriOS-alt/zubehör/game boulderdash/sourcen/Bellatrix-Code/RealRandom.spin

1 line
19 KiB
Plaintext
Raw Normal View History

2010-04-16 00:25:58 +02:00
<EFBFBD><EFBFBD>{{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%,%%%%%%%%%%%%%%%%%,%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%,%%%%%%%%%%%%%%%%% % Real Random v1.2 % by Chip Gracey % Copyright (c) 2007 Parallax, Inc. % 23 March 2007 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4%%%%%%%%%%%%%%%%%4%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4%%%%%%%%%%%%%%%%$% % % % This object generates real random numbers by stimulating and tracking CTR PLL jitter. It requires one cog and % % at least 20MHz. % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%$% % Background and Detail: % % % % A real random number is impossible to generate within a closed digital system. This is because there are no % % reliably-random states within such a system at power-up, and after power-up, it behaves deterministically. % % Random values can only be 'earned' by measuring something outside of the digital system. % % % % In your programming, you might have used 'var?' to generate a pseudo-random sequence, but found the same % % pattern playing every time you ran your program. You might have then used 'cnt' to 'randomly' seed the 'var'. % % As long as you kept downloading to RAM, you saw consistently 'random' results. At some point, you probably % % do