Contents of the READ.ME file
I was fooling around with pseudorandom number generators the
other night and worked out these routines. I guess when it comes
right down to it, NOTHING is truly random. What we really mean to
say is "real mixed up - but representative". Along those lines,
I checked into some of the algorithms to generate pseudorandom
sequences and came across the "shift register" model. For me, this
has been described best by Lancaster (1974, 1989) although I have
seen implementations elsewhere. If you are interested in this
procedure, I urge you to consult the two references I include.
These files illustrate implementation of a 31-bit shift
register. The method is easy to understand, relatively quick, and
is reported to produce 2,147,483,647 non-repeating bits, although
I have not counted 🙂 . As far as the code that I have written,
feel free to use and distribute it in any productive (and legal) way
you want. I do ask that if you distribute the files, especially to
other BBSs, that you keep all the files together and unmodified!
Please direct any comments to:
11160 Veirs Mill Road
Wheaton, MD 20902
FILES AND DESCRIPTIONS:
PRNG31A.ASM-TASM code to print out pseudorandom sequences
a screen at a time (8-bit decimals).
PRNG31A.COM-Executable code of PRNG31A.ASM
TSTRND31.C-TC 2.0 program that gives you a visual
indication of the number sequences.
TSTRNDC.ASM - The C function in TASM for the generator.
TSTRNDC.OBJ - (from above)
TSTRND31.PRJ-TC project file used to compile TSTRND31.EXE
TSTRND31.COM-Executable file (from above).
TSTRNDTC.C-For Comparison, this code is nearly identical
to TSTRND31.C except that TC's generator is
TSTRNDTC.COM-Executable file (from above).
NOISE31.COM - A silly little application of the generator as
suggested by Lancaster (1989). We generate the
sequence and spit the bits out the speaker.
The resulting "white noise" is harmless and can
be stopped by any key press. Run this AFTER you
have examined the other files so you will know
what's "going on". The noise starts as soon as
you press 'enter'!
Lancaster, D. (1974). The TTL Cookbook. Howard W. Sams & Co.,
Indianapolis, Indiana (in the 1982 printing check p 258-291).
Lancaster, D. (1989). Hardware Hacker, in Radio Electronics,
February, p 78-82.