Randomness

From Maze

(Difference between revisions)
Jump to: navigation, search
(→The SID: Sound as a second stochastic source: deleted old draft text, still to revise section)
(→The SID: Sound as a second stochastic source: added header note)
Line 165:Line 165:
==== The SID: Sound as a second stochastic source ====
==== The SID: Sound as a second stochastic source ====
 +
[Jeremy: On review, I'm not totally convinced of the value of working through complex textbook examples of using the SID with BASIC peek-poke (as below) -- particularly because use of the SID is already quite removed from the RND(1) method of how 10 Print does randomness, with RND(-x) and RND(0) / RND(TI) being closer. I'm more inclined to tersely summarize this material as one or two examples maximum, perhaps with direct reference to "Random Numbers In Machine Language For Commodore 64" (Neil Boyle)
 +
http://www.atarimagazines.com/compute/issue72/random_numbers.php
 +
]
 +
Finally, it is possible to generate random number on the Commodore 64 without using either RND function, relying instead upon the Sound Interface Device (SID) chip to produce random "noise." Reading the SID from register 27 (in decimal format) returns the current value of oscillator 3. If it's set to noise, the SID doubles as a random number generator. [IT'S UNCLEAR HOW THIS WORKS...MORE EXPLANATION NEEDED FOR NON-PROGRAMMING READERS]
Finally, it is possible to generate random number on the Commodore 64 without using either RND function, relying instead upon the Sound Interface Device (SID) chip to produce random "noise." Reading the SID from register 27 (in decimal format) returns the current value of oscillator 3. If it's set to noise, the SID doubles as a random number generator. [IT'S UNCLEAR HOW THIS WORKS...MORE EXPLANATION NEEDED FOR NON-PROGRAMMING READERS]

Revision as of 00:58, 12 July 2011

View this revision of Randomness.

Personal tools