View Single Post
  #1   Report Post  
Posted to alt.binaries.schematics.electronic
John Fields John Fields is offline
external usenet poster
 
Posts: 2,022
Default 8 bit PRSG for John Larkin - 8BITPRSG.EXE

'8 bit pseudo-random sequence generator with no lockup state.
'Microsoft QuickBASIC 4.0
'07 September 2007
'John Fields


SCREEN 0
COLOR 0, 7
CLS

q1 = 0
q2 = 0
q3 = 0
q4 = 0
q5 = 0
q6 = 0
q7 = 0
q8 = 0
clk = 0
new$ = "0"
s = 4500000


PRINT " Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 CLOCK"

VIEW PRINT 42 TO 43

PRINT "Press " + CHR$(34) + "f" + CHR$(34) + " to increase
display speed, " + CHR$(34) + "s" + CHR$(34) + " to decrease it, or
" + CHR$(34) + "q" + CHR$(34) + " to quit."

VIEW PRINT 3 TO 40

shift: PRINT q1; q2; q3; q4; q5; q6; q7; q8; " "; clk

nor = q1 OR q2 OR q3 OR q4 OR q5 OR q6 OR q7
IF nor = 0 THEN nor = 1 ELSE nor = 0

tap1 = q3 XOR q5
tap2 = q6 XOR q8
tap3 = tap1 XOR tap2
srin = nor XOR tap3

q8 = q7
q7 = q6
q6 = q5
q5 = q4
q4 = q3
q3 = q2
q2 = q1
q1 = srin

clk = clk + 1
IF clk = 256 THEN clk = 0

FOR t = 1 TO s: NEXT t

a$ = INKEY$
IF a$ = "f" THEN s = s - 100000
IF a$ = "s" THEN s = s + 100000
IF a$ = "q" THEN END

GOTO shift
END


I'm running XP and the executable won't run unless it's invoked from
the command prompt in a DOS window.

YMMV.


--
JF