way to simplify repeated xor operations?



I am trying to implement a 24 bit random bit shift register in a small
microcontroller. The output will be used as white noise and fed into an
IIR pink noise filter also implemented on the MCU (see other posts, yes
its possible). I need an 8 bit random number, so I am shifting the
register 8 bits at a time and XORing the two high bits. This will
probably not be a maximal length register. But 24 bits is huge so I am
guessing it will be long enough (at least 5 seconds worth, which needs
to be 40000 samples times 8 bits * 5 seconds 1.6million clock cycles)
This seems like a very good way to generate lots of random numbers
without repeating for a few seconds.

So, of the 24 bits, the high BYTE, the output byte, is A, the middle
byte is B, and the low byte (with bit 0, the input bit) is C. So the
steps are:

Take A as output, i.e. use it as the random number.
Move B to A
Move C to B
Loop the following 8 times:
XOR high bits of A and put result into first bit of C
Shift C left one bit
Shift A left one bit
Repeat

Problem is, I this takes too many cycles. Is there some clever way to
accomplish the XORing of each bit pair in a byte and put the output in
another byte in say 5 or 6 cycles? The way I have outlined above will
probably take about 40 cycles just for the loop.

.



Relevant Pages

  • Re: way to simplify repeated xor operations?
    ... back the xor of the top two bits, ... out with the new MS byte to get the feedback (which, if the register is ... Shift C left one bit ... I this takes too many cycles. ...
    (sci.electronics.design)
  • Re: Multiplexing - how to speed up
    ... Currently I'm testing with 5 cascaded shift registers (serial in, ... After adding the 5th shift register the image started flickering. ... void shift_byte ... internal buffer but not to the output pins of that register. ...
    (sci.electronics.design)
  • Re: Multiplexing - how to speed up
    ... Currently I'm testing with 5 cascaded shift registers (serial in, ... After adding the 5th shift register the image started flickering. ... void shift_byte ...
    (sci.electronics.design)
  • Re: device for converting binary strings into states for switches
    ... For 8 switches I think that I got the idea, ... into a register). ... you need a serial-to-parallel shift ... register clock and the latch clock. ...
    (sci.electronics.basics)
  • Re: device for converting binary strings into states for switches
    ... I also have 5 switches which must be set by my device as follows: ... you need a serial-to-parallel shift ... register with data latch output. ... register clock and the latch clock. ...
    (sci.electronics.basics)