# Scrambler generator polynomial with initial state

A length-$127$ frame scramble uses the following generator polynomial

$$G(D)= D^7+D^4+1$$

• If the all-ones initial state is used, how can one obtain the $127$ bit sequence? I am not interested in the sequence itself or computer algorithm but an understanding of how to obtain in.

• My understanding is that $G(D)$ is the $\mathcal Z$-transform of the impulse response $\textrm{1001001}$. Is this convolved with the initial state $\textrm{1111111}$?

This generating (check if it's a primitive polynomial - those are usually used) polynomial representing a simple Linear Feedback Shift Register (LFSR). The circuit is given below, the gate is a XOR gate (an addition over GF(2) ). You can follow the output of this shift register very easily boolean mls;
unsigned D = 0x7F;
for (i=0; i<127; i++)
{
mls[i] = D&1;
D = D>>1;
if (mls[i])
{
D = D^0x48;
}
}


or it might be

boolean mls;
unsigned D = 0x7F;
for (i=0; i<127; i++)
{
mls[i] = (D & 0x40)>>6;
D = D<<1;
if (mls[i])
{
D = D^0x11;
}
}


all depends on if we're shifting left or right.

• Thank you very much, can you please explain in words what does it mean i.e how is G(D) generating the bits. And how did you use the fact that the inital state is all ones in this program? – Tyrone May 14 '15 at 23:07
• "please explain in words what does it mean i.e how is G(D) generating the bits." if you're shifting right, the $D^0$ in $G(D)$ is not used. if you're shifting left, the $D^7$ is not used. so examine the bits of either 0x48 or 0x11. see what you get. "how did you use the fact that the inital state is all ones in this program?" D = 0x7F; – robert bristow-johnson May 14 '15 at 23:11
• take a look at A Little MLS Tutorial if you want to. – robert bristow-johnson May 14 '15 at 23:16
• thanks, is D a binary number 0 or 1? @robert bristow-johnson – Tyrone May 14 '15 at 23:17
• no D is a 7 bit number. in the left-shifting example, i don't bother to mask off the bits that "fall offa the edge" on the left. but i don't use those bits either, so it doesn't matter if i mask them or not. perhaps the line of code should be D = (D<<1) & 0x7F; to make it more clear. for any i (that is 0 ≤ i < 127), mls[i] is a binary value. that is your sequence of bits. – robert bristow-johnson May 14 '15 at 23:20