(Billy) writes:
>I'm looking for a program to generate different PRBS in order to do a
>new equipment test. the program should get as input a range and gives
>as output a bit sequence with the length precised.
>I need that to generate PRBS 2^9-1, 2^11-1, 2^15-1, 2^23-1, 2^31-1
A little google searching will find you many examples of this.
Or the books "Numerical Recipes in X", where X is C, FORTRAN,...
has a section "Generation of Random Bits" that includes tables
of the taps to use for shift registers up to 100 bits long, has
several example programs and a description of the ideas behind
all this.
Here is their example for an 18 bit generator with taps 18,5,2,1
#define IB1 1
#define IB2 2
#define IB5 16
#define IB18 131072
#define MASK IB1+IB2+IB5
int irbit2(iseed)
unsigned long *iseed;
{
if (*iseed & IB18) {
*iseed=((*iseed ^ MASK) << 1) | IB1;
return 1;
} else {
*iseed <<=1;
return 0;
}
}
taps for 9,11,15,23,31 are
9,4
11,2
15,1
23,5
31,3
but if you dig into the math behind this there are many equivalent
sets of taps for most register lengths.