Erlang RNG
|
08-07-2014, 03:19 PM
Post: #1
|
|||
|
|||
Erlang RNG
This programs generates random numbers that are from teh Erlang PDF. The program uses the following algorithm:
Given parameters k (integer) and theta S=0 For i = 1 to k Generate u=U(0,1) X = -1/Theta*ln(u) S = S + X End Return S Memory Map and Flags R A = Theta R B = k (integer) R E = random number seed R 0 = used R 1 = S R 2 = k counter R I = loop counter F 0 = When manually set, the program stops after calculating each exponenitally distributed number, after pressing [C]. When cleared, the program proceed in full speed after pressing [C] or after resuming the program by pressing [R/S]. Listing Code:
Usage 1. Enter initial/new random number seed and press [f][E]. 2. Enter integer value for k, press [ENTER], enter value for theta, and press [f][A]. 3. Enter the number of iterations and press [C]. The program will stop and display the averages for two sample sets. If flag 0 is set, the program will stop after calculating each random number. You must then press [R/S] to resume. You can clear flag 0 and then press [R/S] to resume the program at full speed. 4. Press [R/S] to view the standard deviations for the same two sample sets. 5. (optional) Press [E] to generate a uniform random number. 6. (optional) Press [A] to generate an Erlang random number. 7. (optional) Press [f][C] to generate a sample of 20 Exponenaially distributed random numbers that are store in registers R0 to R9 and Rs0 through Rs9. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)