Content deleted Content added
Eric Rowland (talk | contribs) →Description of algorithm: update link |
|||
Line 141:
The following is the Berlekamp–Massey algorithm specialized for the binary [[finite field]] F<sub>2</sub> (also written GF(2)). The field elements are '0' and '1'. The field operations '+' and '−' are identical and are equivalent to the 'exclusive or' operation, XOR. The multiplication operator '*' becomes the logical AND operation. The division operator reduces to the identity operation (i.e., field division is only defined for dividing by 1, and x/1 = x).
#Let <math>s_0, s_1, s_2 \cdots s_{
#Initialise two arrays <math>b</math> and <math>c</math> each of length <math>
#[[Assignment (computer science)|assign]] <math>L \leftarrow 0, m \leftarrow -1</math>.
#'''For''' <math>
#*Let discrepancy <math>d</math> be <math>
#*'''if''' <math>d = 0</math>, '''then''' <math>c</math> is already a polynomial which annihilates the portion of the stream from <math>
#*'''else''':
#** Let <math>t</math> be a copy of <math>c</math>.
#** Set <math>c_{
#** If <math>L \le \frac{
At the end of the algorithm, <math>L</math> is the length of the minimal LFSR for the stream, and we have <math>c_Ls_a \oplus c_{L-1}s_{a+1} \oplus c_{L-2}s_{a+2} \oplus \cdots = 0</math> for all <math>a</math>.<!-- this expression is in the FIELD -->
|