[sdiy] Non maximal-length LFSR
mskala at ansuz.sooke.bc.ca
mskala at ansuz.sooke.bc.ca
Thu Mar 3 16:25:59 CET 2016
On Thu, 3 Mar 2016, Richie Burnett wrote:
> only using two taps in the LFSR, hence asking.) The pseudo-code looks like
> this:
>
> mov [pointer+1],accumulator
> xor [pointer],accumulator,[pointer++]
I'm not convinced that this entire design is the right way to do what
you're trying to achieve, but I don't think you're forced to use 48-bit
registers; if you play with the indices, you should be able to make each
bit depend on the bits you generated 47 and 42 ticks ago (that is, use a
maximal-length 47-bit sequence), while still running in a 48-tick buffer
and recording the last 48 bits generated. You just don't have to look
quite all the way back in the buffer.
The basic operation is:
z[i] <- z[i-47] XOR z[i-42]
(repeat for each z[i] in the buffer, any buffer size >=47, modulo indexing)
I don't know if that's going to cost you a third instruction, but I doubt
you can do better without more significant changes to your goals.
--
Matthew Skala
mskala at ansuz.sooke.bc.ca People before principles.
http://ansuz.sooke.bc.ca/
More information about the Synth-diy
mailing list