אהלן, אני צריך קצת עזרה עם קוד ב C #include <math.h> #include <stdio.h> #define mm 4 /* RS code over GF(2**4) - change to suit */ #define nn 15 /* nn=2**mm -1 length of codeword */ #define tt 3 /* number of errors that can be corrected */ #define kk 9 /* kk = nn-2*tt */int pp = { 1, 1, 0, 0, 1} ; /* specify irreducible polynomial coeffts */ int alpha_to , index_of , gg ; int recd , data , bb ; void generate_gf() /* generate GF(2**mm) from the irreducible polynomial p(X) in pp..pp lookup tables: index->polynomial form alpha_to contains j=alpha**i; polynomial form -> index form index_of = i alpha=2 is the primitive element of GF(2**mm) */ { register int i, mask ;
mask = 1 ; alpha_to = 0 ; for (i=0; i<mm; i++) { alpha_to = mask ; index_of] = i ; if (pp!=0) alpha_to ^= mask ; mask <<= 1 ; } index_of] = mm ; mask >>= 1 ; for (i=mm+1; i<nn; i++) { if (alpha_to >= mask) alpha_to = alpha_to ^ ((alpha_to^mask)<<1) ; else alpha_to = alpha_to<<1 ; index_of] = i ; } index_of = -1 ; }
|
מה זה
alpha_to ^= mask ;
mask <<= 1
mask >>= 1
alpha_to = alpha_to ^ ((alpha_to^mask)<<1)
רק תגידי לי מה האופרטורים האלה עושים <<= >>= ^=
תודה.