Re: 8 Bit Random Numbers



On Feb 3, 9:59 am, nos...@xxxxxxxxxx wrote:
Bill Bowden wrote:

Nobody wrote:

John Fields wrote:

Well, we could argue forever about what constitutes "[E]XOR-based", but
it's not an LFSR, and I thought it was clear that's what "nospam" was
referring to by "XOR-based PRNG".

He was, and you're both wrong.

What you're saying, in effect, is that if an 8 cylinder ICE fitted with
a 7 cylinder ignition system was fitted with a system winch allowed all
8 cylinders to work it would no longer be an ICE, which is total
nonsense.

No, I'm saying that if you modify an LFSR so that its input is no longer
an N-input XOR of (some of) its outputs, it's no longer an LFSR.

I don't think that anyone would contest that there exist *other* circuits
which will cycle through all 256 8-bit values, or at least don't have the
lock-up state.

There are circuits which don't have the lockup state, but an LFSR isn't
one of them.

The output of the 8 bit LFSR that Fields did is exactly the same as
the standard version using 4 taps. The only addition is the zero state
appears between the values hex 80 and 01. The new sequence goes
80,00,01.....

What part of

"A linear feedback shift register (LFSR) is a shift
register whose input bit is a linear function of its
previous state. The only linear functions of single
bits are xor and inverse-xor..."

are you having trouble understanding?


I'm having trouble with the linear part. Linear suggests to me an
equal amount of "1s" and "0s" over a long period, which should be 1024
of each for an 8 bit counter. The LFSR without Fields mod produces
1024 "1s" and only 1023 zeros which is slightly non-linear.

Using Fields approach produces equal amounts of "1" and "0"
or 1024 of each, which seems closer to linear.

What am I missing?

-Bill

What Fields posted was *NOT* an 8 bit LFSR. It was *NOT* XOR based.
(BTW, why does Fields keep calling XOR "EXOR?" Does he have some
sort of problem using standard terminology?) Simply saying "you
are both wrong" does not change reality. If the two of you would
simply stop calling whatever his circuit is a "LFSR" or a "XOR
Based PRNG", then everyone here could agree. There is nothing
wrong with his design. You are simply calling it by the wrong
name. Just because someone is an engineer, that doesn't mean that
he has to be stubborn and refuse to admit any error. The world
will not end if you admit to using the wrong terminology.

BTW, for most applications a standard Galois LFSR is superior
to what Fields posted. When implemented using logic gates,
The XOR gates are run in parallel rather than in serial,
reducing propagation delay and allowing for faster cycling.
When implemented in software, it is is more efficient
because the XOR can computed a word at a time. Code it or
breadboard it and see.

Yes, I know about that, but haven't figured out the 8 bit number to
xor with the random register to get the desired result.

Maybe you know what it is?

-Bill
.



Relevant Pages

  • Re: Pseudorandom Hashing
    ... > IIRC you XOR and feed back on the input, and just XOR on the output. ... Let me return to the topic of the LFSR. ... zeroes provided that the data going over the wire are random. ...
    (sci.electronics.design)
  • Re: 8 Bit Random Numbers
    ... If you run the LTspice circuit list or the BASIC program I posted ... Your LTspice circuit isn't an "XOR-based PRNG" (i.e. LFSR), ... "A linear feedback shift register is a shift register whose ...
    (sci.electronics.basics)
  • Re: 8 Bit Random Numbers
    ... I'm saying that if you modify an LFSR so that its input is no longer ... an N-input XOR of its outputs, ... simply stop calling whatever his circuit is a "LFSR" or a "XOR ... Based PRNG", ...
    (sci.electronics.basics)
  • The Linux /dev/random LFSR
    ... The Linux /dev/random code uses an LFSR as a stirring function. ... bits and XORs them against the current pool, ... this simple XOR is not cryptographically strong. ...
    (sci.crypt)
  • Re: Simple balanced pair-wise function
    ... You know the xor of two bits of the LFSR state. ... LFSR cipher is secure. ...
    (sci.crypt)