Atmel ARM-Based Evaluation Kit AT91SAM9N12-EK AT91SAM9N12-EK Data Sheet

Product codes
AT91SAM9N12-EK
Page of 1104
340
SAM9N12/SAM9CN11/SAM9CN12 [DATASHEET]
11063K–ATARM–05-Nov-13
{
/* galois inverse */
sro[k] = gf_antilog[(gf_log[dmu[i]] + (NB_FIELD_ELEMENTS-
gf_log[dmu[ro]]) + gf_log[sro[k]]) % NB_FIELD_ELEMENTS];
}
}
/* multiply by dmu * dmu[ro]^-1 */
for (k = 0; k < 2*NB_ERROR_MAX+1; k++)
{
smu[i+1][k] = smu[i][k] ^ sro[k];
if (smu[i+1][k])
{
/* find the order of the polynom */
lmu[i+1] = k << 1; 
}
}
}
/*                                               */
/*                                               */
/*      End Compute Sigma (Mu+1)                 */
/*      And L(mu)                                */
/*************************************************/
/* In either case compute delta */
delta[i+1]  = (mu[i+1] * 2 - lmu[i+1]) >> 1;
/* In either case compute the discrepancy */
for (k = 0 ; k <= (lmu[i+1]>>1); k++)
{
if (k == 0)
dmu[i+1] = si[2*(i-1)+3];
/* check if one operand of the multiplier is null, its index is -1 */
else if (smu[i+1][k] && si[2*(i-1)+3-k])
dmu[i+1] = gf_antilog[(gf_log[smu[i+1][k]] + gf_log[si[2*(i-1)+3-k]])%nn] 
^ dmu[i+1];
}
}
return 0;
}
28.5.3  Find the Error Position
The output of the get_sigma() procedure is a polynomial stored in the smu[NB_ERROR+1][] table. The error position is
the roots of that polynomial. The degree of this polynomial is very important information, as it gives the number of errors.
The PMERRLOC module provides a hardware accelerator for this step.