User Tools

Site Tools


base:32bit_galois_lfsr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:32bit_galois_lfsr [2015-04-17 04:30] (current)
Line 1: Line 1:
 +====== 32 bit Galois LFSR random generator ======
 +
 +A fast random generator based on the CRC32 algorythm.
 +
 +It uses the CRC32 IEEE 802.3 polynom $04C11DB7 which produces a random number period of 2^32-1 (4.3 billion) numbers.
 +
 +<​code>​
 +rnd:
 +        ASL random
 +        ROL random+1
 +        ROL random+2
 +        ROL random+3
 +        BCC .nofeedback
 +        LDA random
 +        EOR #$B7
 +        STA random
 +        LDA random+1
 +        EOR #$1D
 +        STA random+1
 +        LDA random+2
 +        EOR #$C1
 +        STA random+2
 +        LDA random+3
 +        EOR #$04
 +        STA random+3
 +.nofeedback:​
 +        RTS
 +
 +random: .BYTE $FF,​$FF,​$FF,​$FF
 +</​code>​
  
base/32bit_galois_lfsr.txt ยท Last modified: 2015-04-17 04:30 (external edit)