OpenCores
URL https://opencores.org/ocsvn/reed_solomon_codec_generator/reed_solomon_codec_generator/trunk

Subversion Repositories reed_solomon_codec_generator

[/] [reed_solomon_codec_generator/] [trunk/] [source/] [RsDecodeMakeData.cpp] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 issei
//===================================================================
2
// Module Name : RsDecodeMakeData
3
// File Name   : RsDecodeMakeData.cpp
4
// Function    : RS Decoder data maker
5
// 
6
// Revision History:
7
// Date          By           Version    Change Description
8
//===================================================================
9
// 2009/02/03  Gael Sapience     1.0       Original
10
//
11
//===================================================================
12
// (C) COPYRIGHT 2009 SYSTEM LSI CO., Ltd.
13
//
14
#include <stdio.h>
15
#include <stdlib.h>
16
#include <iostream>
17
#include <time.h>
18
#include <string.h>
19
 
20
 
21
FILE  *OutFileRsDecIn;
22
FILE  *OutFileRsDecOut;
23
 
24
void RsGfMultiplier( int*, int*,int*, int, int);
25
void RsDecodeEmulator(int*, int*, int*, int*, int, int, int, int, int*, int*, int*, int*, int*);
26
 
27
 
28
void RsDecodeMakeData(int DataSize, int TotalSize, int PrimPoly, int bitSymbol, int ErasureOption, int delayDataIn, int BlockAmount, int ErrorRate, int PowerErrorRate, int ErasureRate, int PowerErasureRate, int *coeffTab, int *MrefTab, int *PrefTab, int errorStats, int passFailFlag, int encDecMode, int encBlockAmount, int pathFlag, int lengthPath, char *rootFolderPath) {
29
 
30
 
31
   //---------------------------------------------------------------
32
   // syndrome length calculation
33
   //---------------------------------------------------------------
34
   int syndromeLength;
35
   syndromeLength = TotalSize - DataSize;
36
 
37
 
38
   //---------------------------------------------------------------
39
   // C++ variables
40
   //---------------------------------------------------------------
41
   int ii,jj, kk,loop;
42
   int maxValue;
43
   int bbb;
44
   int sync_flag;
45
   int mmTabSize = (bitSymbol*2) -1;
46
   int bidonTabSize;
47
   int symbolMax;
48
   int LoopSize;
49
   int Pidx;
50
   int init;
51
   int idx2;
52
   int idx1;
53
   int tempNum;
54
   int feedback;
55
   int zz;
56
   int rsLoop;
57
   int errCount;
58
   int errError;
59
   int errErasure;
60
   int errData;
61
   int chanceError;
62
   int chanceErasure;
63
   int paddingLength;
64
   int delay;
65
   int ErrorNumBKP;
66
   int ErasureNumBKP;
67
   int RTLfailFlagBKP;
68
   int ThErrorNumBKP;
69
   int ThErasureNumBKP;
70
   int ThSyndromeBKP;
71
   int *ErasureTab;
72
   int *dataEncoded;
73
   int *dataPure;
74
   int *powerTab;
75
   int *feedbackTab;
76
   int *productTab;
77
   int *genCoeffTab;
78
   int *syndromeRegTab;
79
   int *redundancySymbols;
80
   int *dataIn;
81
   int *euclideTab;
82
   int *ttTab;
83
   int *bbTab;
84
   int *ppTab;
85
   int *bidon;
86
   int *bidonTab0;
87
   int *bidonTab1;
88
   int *bidonTab2;
89
   int *bidonTab3;
90
   int *bidonTab4;
91
   int *bidonTab5;
92
   int *bidonTab6;
93
   int *bidonTab7;
94
   int *bidonTab8;
95
   int *bidonTab9;
96
   int *bidonTab10;
97
   int *bidonTab11;
98
   int *ErrorNum;
99
   int *ErasureNum;
100
   int *RTLDataOut;
101
   int *RTLfailFlag;
102
   char *strRsDecIn;
103
   char *strRsDecOut;
104
 
105
 
106
  //---------------------------------------------------------------
107
  // maxValue
108
  //---------------------------------------------------------------
109
   maxValue = 1;
110
   for(ii=0; ii<(bitSymbol); ii++){
111
      maxValue = maxValue*2;
112
   }
113
 
114
 
115
   bidonTabSize = 1;
116
   for (ii=0;ii<(bitSymbol);ii++){
117
      bidonTabSize= 2* bidonTabSize;
118
   }
119
   symbolMax = bidonTabSize;
120
   bidonTabSize= bitSymbol* bidonTabSize;
121
 
122
 
123
   dataIn            = new int[DataSize];
124
   euclideTab        = new int[(syndromeLength+1)];
125
   ttTab             = new int[bitSymbol];
126
   bbTab             = new int[bitSymbol];
127
   ppTab             = new int[bitSymbol];
128
   bidon             = new int[bitSymbol];
129
   bidonTab0         = new int[bidonTabSize];
130
   bidonTab1         = new int[bidonTabSize];
131
   bidonTab2         = new int[bidonTabSize];
132
   bidonTab3         = new int[bidonTabSize];
133
   bidonTab4         = new int[bidonTabSize];
134
   bidonTab5         = new int[bidonTabSize];
135
   bidonTab6         = new int[bidonTabSize];
136
   bidonTab7         = new int[bidonTabSize];
137
   bidonTab8         = new int[bidonTabSize];
138
   bidonTab9         = new int[bidonTabSize];
139
   bidonTab10        = new int[bidonTabSize];
140
   bidonTab11        = new int[bidonTabSize];
141
   feedbackTab       = new int[bitSymbol];
142
   productTab        = new int[bitSymbol];
143
   genCoeffTab       = new int[bitSymbol];
144
   syndromeRegTab    = new int[symbolMax*bitSymbol];
145
   redundancySymbols = new int[symbolMax];
146
   powerTab          = new int[bitSymbol];
147
   ErasureTab        = new int[TotalSize];
148
   dataEncoded       = new int[TotalSize];
149
   dataPure          = new int[TotalSize];
150
   ErrorNum          = new int[bitSymbol];
151
   ErasureNum        = new int[bitSymbol];
152
   RTLDataOut        = new int[TotalSize];
153
   RTLfailFlag       = new int[bitSymbol];
154
 
155
 
156
   ErrorNumBKP     = 0;
157
   ErasureNumBKP   = 0;
158
   RTLfailFlagBKP  = 0;
159
   ThErrorNumBKP   = 0;
160
   ThErasureNumBKP = 0;
161
   ThSyndromeBKP   = 0;
162
 
163
 
164
   //---------------------------------------------------------------
165
   // open file
166
   //---------------------------------------------------------------
167
//   strRsDecIn = (char *)calloc(lengthPath + 15,  sizeof(char));
168
   strRsDecIn = (char *)calloc(lengthPath + 17,  sizeof(char));
169
   if (pathFlag == 0) {
170
        strRsDecIn[0] = '.';
171
   }else{
172
      for(ii=0; ii<lengthPath; ii++){
173
         strRsDecIn[ii] = rootFolderPath[ii];
174
      }
175
   }
176
//   strcat(strRsDecIn, "/sim/RsDecIn.v");
177
   strcat(strRsDecIn, "/sim/RsDecIn.hex");
178
 
179
   OutFileRsDecIn = fopen(strRsDecIn,"w");
180
 
181
 
182
//   strRsDecOut = (char *)calloc(lengthPath + 16,  sizeof(char));
183
   strRsDecOut = (char *)calloc(lengthPath + 18,  sizeof(char));
184
   if (pathFlag == 0) {
185
        strRsDecOut[0] = '.';
186
   }else{
187
      for(ii=0; ii<lengthPath; ii++){
188
         strRsDecOut[ii] = rootFolderPath[ii];
189
      }
190
   }
191
//   strcat(strRsDecOut, "/sim/RsDecOut.v");
192
   strcat(strRsDecOut, "/sim/RsDecOut.hex");
193
 
194
   OutFileRsDecOut = fopen(strRsDecOut,"w");
195
 
196
 
197
 
198
   //---------------------------------------------------------------
199
   // random generator
200
   //---------------------------------------------------------------
201
   srand (time (NULL));
202
 
203
 
204
   //---------------------------------------------------------------
205
   // write Headers
206
   //---------------------------------------------------------------
207
   fprintf(OutFileRsDecIn, "// SYNC, ENABLE, ERASURE_IN, DATA[7:0]\n");
208
   fprintf(OutFileRsDecOut, "// Error Amount, Erasure Amount, DATA[7:0]\n");
209
 
210
 
211
   //------------------------------------------------------------------------
212
   //- Euclide Length calculation
213
   //------------------------------------------------------------------------
214
   euclideTab [syndromeLength] = 3;
215
   euclideTab [syndromeLength-1] = 3;
216
 
217
   for(ii=(syndromeLength-2); ii>0; ii=ii-2){
218
      euclideTab [ii] = euclideTab   [ii+2] + 6;
219
      euclideTab [ii-1] = euclideTab [ii+1] + 6;
220
   }
221
 
222
   euclideTab [0] = euclideTab [2] + 6;
223
 
224
 
225
   //------------------------------------------------------------------------
226
   // initialize LoopSize
227
   //------------------------------------------------------------------------
228
   LoopSize = 2;
229
   for(ii=0; ii<(bitSymbol-1); ii++){
230
      LoopSize = LoopSize*2;
231
   }
232
 
233
 
234
   //------------------------------------------------------------------------
235
   //initialize ttTab
236
   //------------------------------------------------------------------------
237
   ttTab[0] = 1;
238
 
239
   for (ii=1;ii<bitSymbol;ii++){
240
      ttTab[ii] = 0;
241
   }
242
 
243
 
244
   //------------------------------------------------------------------------
245
   // initialize bbTab
246
   //------------------------------------------------------------------------
247
   bbTab[0] = 0;
248
   bbTab[1] = 1;
249
   for (ii=2;ii<bitSymbol;ii++){
250
      bbTab[ii] = 0;
251
   }
252
 
253
 
254
   //------------------------------------------------------------------------
255
   //------------------------------------------------------------------------
256
   for(ii=0; ii<(LoopSize-1); ii++){
257
 
258
      //------------------------------------------------------------------------
259
      // Galois Field Multiplier
260
      //------------------------------------------------------------------------
261
      RsGfMultiplier(ppTab, ttTab, bbTab, PrimPoly, bitSymbol);
262
 
263
 
264
      //------------------------------------------------------------------------
265
      // assign multiplier results
266
      //------------------------------------------------------------------------
267
      for (jj=0;jj<bitSymbol;jj++){
268
         ttTab[jj] = ppTab[jj];
269
      }
270
 
271
 
272
      //------------------------------------------------------------------------
273
      // write P_OUT[0]
274
      //------------------------------------------------------------------------
275
      for (Pidx=0; Pidx<bitSymbol; Pidx++){
276
         init = 0;
277
 
278
         for (idx2=0; idx2<bitSymbol;idx2++){
279
            bidon [idx2] = 0;
280
         }
281
         for (idx1=0; idx1<mmTabSize;idx1++){
282
            tempNum = PrefTab [Pidx*mmTabSize+idx1];
283
            if (tempNum == 1) {
284
               //------------------------------------------------------------------------
285
               // search
286
               //------------------------------------------------------------------------
287
               for (idx2=0; idx2<bitSymbol;idx2++){
288
                  tempNum = MrefTab[idx1*bitSymbol+idx2];
289
                  if ((tempNum > 0) && (ttTab[tempNum-1] == 1)) {
290
                     if  (bidon [idx2] == 0) {
291
                        bidon [idx2] = 1;
292
                     }
293
                     else {
294
                        bidon [idx2] = 0;
295
                     }
296
                  }
297
               }
298
            }
299
         }
300
         if (Pidx==0) {
301
            for (jj=0;jj<bitSymbol;jj++){
302
               bidonTab0[ii*bitSymbol+jj] = bidon[jj];
303
            }
304
         }
305
         if (Pidx==1) {
306
            for (jj=0;jj<bitSymbol;jj++){
307
               bidonTab1[ii*bitSymbol+jj] = bidon[jj];
308
            }
309
         }
310
         if (Pidx==2) {
311
            for (jj=0;jj<bitSymbol;jj++){
312
               bidonTab2[ii*bitSymbol+jj] = bidon[jj];
313
            }
314
         }
315
         if (Pidx==3) {
316
            for (jj=0;jj<bitSymbol;jj++){
317
               bidonTab3[ii*bitSymbol+jj] = bidon[jj];
318
            }
319
         }
320
         if (Pidx==4) {
321
            for (jj=0;jj<bitSymbol;jj++){
322
               bidonTab4[ii*bitSymbol+jj] = bidon[jj];
323
            }
324
         }
325
         if (Pidx==5) {
326
            for (jj=0;jj<bitSymbol;jj++){
327
               bidonTab5[ii*bitSymbol+jj] = bidon[jj];
328
            }
329
         }
330
         if (Pidx==6) {
331
            for (jj=0;jj<bitSymbol;jj++){
332
               bidonTab6[ii*bitSymbol+jj] = bidon[jj];
333
            }
334
         }
335
         if (Pidx==7) {
336
            for (jj=0;jj<bitSymbol;jj++){
337
               bidonTab7[ii*bitSymbol+jj] = bidon[jj];
338
            }
339
         }
340
 
341
         if (Pidx==8) {
342
            for (jj=0;jj<bitSymbol;jj++){
343
               bidonTab8[ii*bitSymbol+jj] = bidon[jj];
344
            }
345
         }
346
         if (Pidx==9) {
347
            for (jj=0;jj<bitSymbol;jj++){
348
               bidonTab9[ii*bitSymbol+jj] = bidon[jj];
349
            }
350
         }
351
         if (Pidx==10) {
352
            for (jj=0;jj<bitSymbol;jj++){
353
               bidonTab10[ii*bitSymbol+jj] = bidon[jj];
354
            }
355
         }
356
         if (Pidx==11) {
357
            for (jj=0;jj<bitSymbol;jj++){
358
               bidonTab11[ii*bitSymbol+jj] = bidon[jj];
359
            }
360
         }
361
         //------------------------------------------------------------------------
362
         // printf
363
         //------------------------------------------------------------------------
364
      }
365
   }
366
 
367
 
368
   //------------------------------------------------------------------------
369
   // initialize feedbackTab, productTab, genCoeffTab
370
   //------------------------------------------------------------------------
371
   for (ii=0;ii<(bitSymbol);ii++){
372
      feedbackTab [ii] = 0;
373
      productTab [ii] = 0;
374
      genCoeffTab [ii] = 0;
375
   }
376
 
377
 
378
   //---------------------------------------------------------------
379
   // initialize powerTab
380
   //---------------------------------------------------------------
381
   powerTab[0] = 1;
382
   for (ii=1; ii<bitSymbol;ii++){
383
      powerTab[ii] = 2*powerTab[ii-1];
384
   }
385
 
386
 
387
   //---------------------------------------------------------------
388
   // RSDecode codewords construction
389
   //---------------------------------------------------------------
390
   for (loop=0; loop<BlockAmount;loop++){
391
 
392
      //---------------------------------------------------------------
393
      // Input data generation
394
      //---------------------------------------------------------------
395
      for (ii=0; ii<DataSize;ii++){
396
         bbb = rand () & ((1 << bitSymbol) - 1);
397
         if (bbb == symbolMax) {
398
            bbb = symbolMax-1;
399
         }
400
         dataIn [ii] = bbb;
401
      }
402
 
403
 
404
 
405
      //---------------------------------------------------------------
406
      // Rs Encoder Data calculation
407
      //---------------------------------------------------------------
408
      for (rsLoop=0;rsLoop<DataSize; rsLoop++) {
409
         //---------------------------------------------------------------
410
         // assign feedback
411
         //---------------------------------------------------------------
412
         feedback = dataIn [rsLoop];
413
         // convert feedback to binary
414
         for (zz =bitSymbol-1; zz>=0;zz--) {
415
            if (feedback >= powerTab[zz]) {
416
               feedback = feedback -powerTab[zz];
417
               feedbackTab[zz] = 1;
418
            }else{
419
               feedbackTab[zz] = 0;
420
            }
421
         }
422
 
423
         if (rsLoop > 0) {
424
            for (zz=0;zz<bitSymbol;zz++){
425
               feedbackTab[zz] = feedbackTab[zz] ^ syndromeRegTab[(syndromeLength-1)*bitSymbol+zz];
426
            }
427
         }
428
 
429
 
430
         //---------------------------------------------------------------
431
         // multiply feedback by genCoeffTab
432
         //---------------------------------------------------------------
433
         for (zz =syndromeLength-1; zz>=0;zz--) {
434
            if (coeffTab[zz] > 0) {
435
               tempNum =coeffTab[zz]-1;
436
 
437
 
438
               switch(bitSymbol)
439
                  {
440
                     case (3):
441
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]);
442
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]);
443
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]);
444
                     break;
445
                     case (4):
446
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3]);
447
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3]);
448
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3]);
449
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3]);
450
                     break;
451
                     case (5):
452
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]);
453
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]);
454
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]);
455
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]);
456
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]);
457
                     break;
458
                     case (6):
459
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0[tempNum*bitSymbol+5] & feedbackTab[5]);
460
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1[tempNum*bitSymbol+5] & feedbackTab[5]);
461
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2[tempNum*bitSymbol+5] & feedbackTab[5]);
462
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3[tempNum*bitSymbol+5] & feedbackTab[5]);
463
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4[tempNum*bitSymbol+5] & feedbackTab[5]);
464
                        productTab[5] = (bidonTab5[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5[tempNum*bitSymbol+5] & feedbackTab[5]);
465
                     break;
466
                     case (7):
467
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0[tempNum*bitSymbol+6] & feedbackTab[6]);
468
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1[tempNum*bitSymbol+6] & feedbackTab[6]);
469
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2[tempNum*bitSymbol+6] & feedbackTab[6]);
470
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3[tempNum*bitSymbol+6] & feedbackTab[6]);
471
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4[tempNum*bitSymbol+6] & feedbackTab[6]);
472
                        productTab[5] = (bidonTab5[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5[tempNum*bitSymbol+6] & feedbackTab[6]);
473
                        productTab[6] = (bidonTab6[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6[tempNum*bitSymbol+6] & feedbackTab[6]);
474
                     break;
475
                     case (8):
476
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab0[tempNum*bitSymbol+7] & feedbackTab[7]);
477
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab1[tempNum*bitSymbol+7] & feedbackTab[7]);
478
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab2[tempNum*bitSymbol+7] & feedbackTab[7]);
479
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab3[tempNum*bitSymbol+7] & feedbackTab[7]);
480
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab4[tempNum*bitSymbol+7] & feedbackTab[7]);
481
                        productTab[5] = (bidonTab5[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab5[tempNum*bitSymbol+7] & feedbackTab[7]);
482
                        productTab[6] = (bidonTab6[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab6[tempNum*bitSymbol+7] & feedbackTab[7]);
483
                        productTab[7] = (bidonTab7[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab7[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab7[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab7[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab7[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab7[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab7[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab7[tempNum*bitSymbol+7] & feedbackTab[7]);
484
                     break;
485
                     case  (9):
486
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab0[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab0[tempNum*bitSymbol+8] & feedbackTab[8]);
487
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab1[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab1[tempNum*bitSymbol+8] & feedbackTab[8]);
488
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab2[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab2[tempNum*bitSymbol+8] & feedbackTab[8]);
489
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab3[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab3[tempNum*bitSymbol+8] & feedbackTab[8]);
490
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab4[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab4[tempNum*bitSymbol+8] & feedbackTab[8]);
491
                        productTab[5] = (bidonTab5[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab5[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab5[tempNum*bitSymbol+8] & feedbackTab[8]);
492
                        productTab[6] = (bidonTab6[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab6[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab6[tempNum*bitSymbol+8] & feedbackTab[8]);
493
                        productTab[7] = (bidonTab7[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab7[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab7[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab7[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab7[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab7[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab7[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab7[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab7[tempNum*bitSymbol+8] & feedbackTab[8]);
494
                        productTab[8] = (bidonTab8[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab8[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab8[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab8[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab8[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab8[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab8[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab8[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab8[tempNum*bitSymbol+8] & feedbackTab[8]);
495
                     break;
496
                     case(10):
497
                        productTab[0] = (bidonTab0[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab0[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab0[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab0[tempNum*bitSymbol+9] & feedbackTab[9]);
498
                        productTab[1] = (bidonTab1[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab1[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab1[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab1[tempNum*bitSymbol+9] & feedbackTab[9]);
499
                        productTab[2] = (bidonTab2[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab2[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab2[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab2[tempNum*bitSymbol+9] & feedbackTab[9]);
500
                        productTab[3] = (bidonTab3[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab3[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab3[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab3[tempNum*bitSymbol+9] & feedbackTab[9]);
501
                        productTab[4] = (bidonTab4[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab4[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab4[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab4[tempNum*bitSymbol+9] & feedbackTab[9]);
502
                        productTab[5] = (bidonTab5[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab5[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab5[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab5[tempNum*bitSymbol+9] & feedbackTab[9]);
503
                        productTab[6] = (bidonTab6[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab6[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab6[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab6[tempNum*bitSymbol+9] & feedbackTab[9]);
504
                        productTab[7] = (bidonTab7[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab7[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab7[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab7[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab7[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab7[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab7[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab7[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab7[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab7[tempNum*bitSymbol+9] & feedbackTab[9]);
505
                        productTab[8] = (bidonTab8[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab8[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab8[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab8[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab8[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab8[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab8[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab8[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab8[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab8[tempNum*bitSymbol+9] & feedbackTab[9]);
506
                        productTab[9] = (bidonTab9[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab9[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab9[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab9[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab9[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab9[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab9[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab9[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab9[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab9[tempNum*bitSymbol+9] & feedbackTab[9]);
507
                     break;
508
 
509
                     case(11):
510
                        productTab[0]  = (bidonTab0 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab0 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab0 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab0 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab0 [tempNum*bitSymbol+10] & feedbackTab[10]);
511
                        productTab[1]  = (bidonTab1 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab1 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab1 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab1 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab1 [tempNum*bitSymbol+10] & feedbackTab[10]);
512
                        productTab[2]  = (bidonTab2 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab2 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab2 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab2 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab2 [tempNum*bitSymbol+10] & feedbackTab[10]);
513
                        productTab[3]  = (bidonTab3 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab3 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab3 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab3 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab3 [tempNum*bitSymbol+10] & feedbackTab[10]);
514
                        productTab[4]  = (bidonTab4 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab4 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab4 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab4 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab4 [tempNum*bitSymbol+10] & feedbackTab[10]);
515
                        productTab[5]  = (bidonTab5 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab5 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab5 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab5 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab5 [tempNum*bitSymbol+10] & feedbackTab[10]);
516
                        productTab[6]  = (bidonTab6 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab6 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab6 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab6 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab6 [tempNum*bitSymbol+10] & feedbackTab[10]);
517
                        productTab[7]  = (bidonTab7 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab7 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab7 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab7 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab7 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab7 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab7 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab7 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab7 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab7 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab7 [tempNum*bitSymbol+10] & feedbackTab[10]);
518
                        productTab[8]  = (bidonTab8 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab8 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab8 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab8 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab8 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab8 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab8 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab8 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab8 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab8 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab8 [tempNum*bitSymbol+10] & feedbackTab[10]);
519
                        productTab[9]  = (bidonTab9 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab9 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab9 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab9 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab9 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab9 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab9 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab9 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab9 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab9 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab9 [tempNum*bitSymbol+10] & feedbackTab[10]);
520
                        productTab[10] = (bidonTab10[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab10[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab10[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab10[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab10[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab10[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab10[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab10[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab10[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab10[tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab10[tempNum*bitSymbol+10] & feedbackTab[10]);
521
                     break;
522
 
523
                     case(12):
524
                        productTab[0]  = (bidonTab0 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab0 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab0 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab0 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab0 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab0 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab0 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab0 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab0 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab0 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab0 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab0 [tempNum*bitSymbol+11] & feedbackTab[11]);
525
                        productTab[1]  = (bidonTab1 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab1 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab1 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab1 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab1 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab1 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab1 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab1 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab1 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab1 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab1 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab1 [tempNum*bitSymbol+11] & feedbackTab[11]);
526
                        productTab[2]  = (bidonTab2 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab2 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab2 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab2 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab2 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab2 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab2 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab2 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab2 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab2 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab2 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab2 [tempNum*bitSymbol+11] & feedbackTab[11]);
527
                        productTab[3]  = (bidonTab3 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab3 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab3 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab3 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab3 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab3 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab3 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab3 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab3 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab3 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab3 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab3 [tempNum*bitSymbol+11] & feedbackTab[11]);
528
                        productTab[4]  = (bidonTab4 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab4 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab4 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab4 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab4 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab4 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab4 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab4 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab4 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab4 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab4 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab4 [tempNum*bitSymbol+11] & feedbackTab[11]);
529
                        productTab[5]  = (bidonTab5 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab5 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab5 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab5 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab5 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab5 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab5 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab5 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab5 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab5 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab5 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab5 [tempNum*bitSymbol+11] & feedbackTab[11]);
530
                        productTab[6]  = (bidonTab6 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab6 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab6 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab6 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab6 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab6 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab6 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab6 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab6 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab6 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab6 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab6 [tempNum*bitSymbol+11] & feedbackTab[11]);
531
                        productTab[7]  = (bidonTab7 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab7 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab7 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab7 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab7 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab7 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab7 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab7 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab7 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab7 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab7 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab7 [tempNum*bitSymbol+11] & feedbackTab[11]);
532
                        productTab[8]  = (bidonTab8 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab8 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab8 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab8 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab8 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab8 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab8 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab8 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab8 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab8 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab8 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab8 [tempNum*bitSymbol+11] & feedbackTab[11]);
533
                        productTab[9]  = (bidonTab9 [tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab9 [tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab9 [tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab9 [tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab9 [tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab9 [tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab9 [tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab9 [tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab9 [tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab9 [tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab9 [tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab9 [tempNum*bitSymbol+11] & feedbackTab[11]);
534
                        productTab[10] = (bidonTab10[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab10[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab10[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab10[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab10[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab10[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab10[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab10[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab10[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab10[tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab10[tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab10[tempNum*bitSymbol+11] & feedbackTab[11]);
535
                        productTab[11] = (bidonTab11[tempNum*bitSymbol+0] & feedbackTab[0]) ^ (bidonTab11[tempNum*bitSymbol+1] & feedbackTab[1]) ^ (bidonTab11[tempNum*bitSymbol+2] & feedbackTab[2]) ^ (bidonTab11[tempNum*bitSymbol+3] & feedbackTab[3])  ^ (bidonTab11[tempNum*bitSymbol+4] & feedbackTab[4]) ^ (bidonTab11[tempNum*bitSymbol+5] & feedbackTab[5]) ^ (bidonTab11[tempNum*bitSymbol+6] & feedbackTab[6]) ^ (bidonTab11[tempNum*bitSymbol+7] & feedbackTab[7]) ^ (bidonTab11[tempNum*bitSymbol+8] & feedbackTab[8]) ^ (bidonTab11[tempNum*bitSymbol+9] & feedbackTab[9]) ^ (bidonTab11[tempNum*bitSymbol+10] & feedbackTab[10]) ^ (bidonTab11[tempNum*bitSymbol+11] & feedbackTab[11]);
536
                     break;
537
 
538
                     default:
539
                        productTab[0] = 0;
540
                     break;
541
                  }
542
            }else{
543
 
544
               switch(bitSymbol)
545
                  {
546
                     case (3):
547
                        productTab[0] = feedbackTab[0];
548
                        productTab[1] = feedbackTab[1];
549
                        productTab[2] = feedbackTab[2];
550
                     break;
551
                     case (4):
552
                        productTab[0] = feedbackTab[0];
553
                        productTab[1] = feedbackTab[1];
554
                        productTab[2] = feedbackTab[2];
555
                        productTab[3] = feedbackTab[3];
556
                     break;
557
                     case (5):
558
                        productTab[0] = feedbackTab[0];
559
                        productTab[1] = feedbackTab[1];
560
                        productTab[2] = feedbackTab[2];
561
                        productTab[3] = feedbackTab[3];
562
                        productTab[4] = feedbackTab[4];
563
                     break;
564
                     case (6):
565
                        productTab[0] = feedbackTab[0];
566
                        productTab[1] = feedbackTab[1];
567
                        productTab[2] = feedbackTab[2];
568
                        productTab[3] = feedbackTab[3];
569
                        productTab[4] = feedbackTab[4];
570
                        productTab[5] = feedbackTab[5];
571
                     break;
572
                     case (7):
573
                        productTab[0] = feedbackTab[0];
574
                        productTab[1] = feedbackTab[1];
575
                        productTab[2] = feedbackTab[2];
576
                        productTab[3] = feedbackTab[3];
577
                        productTab[4] = feedbackTab[4];
578
                        productTab[5] = feedbackTab[5];
579
                        productTab[6] = feedbackTab[6];
580
                     break;
581
                     case (8):
582
                        productTab[0] = feedbackTab[0];
583
                        productTab[1] = feedbackTab[1];
584
                        productTab[2] = feedbackTab[2];
585
                        productTab[3] = feedbackTab[3];
586
                        productTab[4] = feedbackTab[4];
587
                        productTab[5] = feedbackTab[5];
588
                        productTab[6] = feedbackTab[6];
589
                        productTab[7] = feedbackTab[7];
590
                     break;
591
                     case (9):
592
                        productTab[0] = feedbackTab[0];
593
                        productTab[1] = feedbackTab[1];
594
                        productTab[2] = feedbackTab[2];
595
                        productTab[3] = feedbackTab[3];
596
                        productTab[4] = feedbackTab[4];
597
                        productTab[5] = feedbackTab[5];
598
                        productTab[6] = feedbackTab[6];
599
                        productTab[7] = feedbackTab[7];
600
                        productTab[8] = feedbackTab[8];
601
                     break;
602
                     case (10):
603
                        productTab[0] = feedbackTab[0];
604
                        productTab[1] = feedbackTab[1];
605
                        productTab[2] = feedbackTab[2];
606
                        productTab[3] = feedbackTab[3];
607
                        productTab[4] = feedbackTab[4];
608
                        productTab[5] = feedbackTab[5];
609
                        productTab[6] = feedbackTab[6];
610
                        productTab[7] = feedbackTab[7];
611
                        productTab[8] = feedbackTab[8];
612
                        productTab[9] = feedbackTab[9];
613
                     break;
614
                     case (11):
615
                        productTab[0] = feedbackTab[0];
616
                        productTab[1] = feedbackTab[1];
617
                        productTab[2] = feedbackTab[2];
618
                        productTab[3] = feedbackTab[3];
619
                        productTab[4] = feedbackTab[4];
620
                        productTab[5] = feedbackTab[5];
621
                        productTab[6] = feedbackTab[6];
622
                        productTab[7] = feedbackTab[7];
623
                        productTab[8] = feedbackTab[8];
624
                        productTab[9] = feedbackTab[9];
625
                        productTab[10]= feedbackTab[10];
626
                     break;
627
                     case (12):
628
                        productTab[0] = feedbackTab[0];
629
                        productTab[1] = feedbackTab[1];
630
                        productTab[2] = feedbackTab[2];
631
                        productTab[3] = feedbackTab[3];
632
                        productTab[4] = feedbackTab[4];
633
                        productTab[5] = feedbackTab[5];
634
                        productTab[6] = feedbackTab[6];
635
                        productTab[7] = feedbackTab[7];
636
                        productTab[8] = feedbackTab[8];
637
                        productTab[9] = feedbackTab[9];
638
                        productTab[10]= feedbackTab[10];
639
                        productTab[11]= feedbackTab[11];
640
                     break;
641
                     default:
642
                     break;
643
                  }
644
            }
645
 
646
 
647
            //---------------------------------------------------------------
648
            // assign syndromes registers
649
            //---------------------------------------------------------------
650
            if (rsLoop == 0) {
651
               for (kk=0; kk< bitSymbol; kk++){
652
                  syndromeRegTab [zz*bitSymbol+kk] = productTab[kk];
653
               }
654
            }else{
655
               if (zz==0){
656
                  for (kk=0; kk< bitSymbol; kk++){
657
                     syndromeRegTab [kk] = productTab[kk];
658
                  }
659
               } else{
660
                  for (kk=0; kk< bitSymbol; kk++){
661
                     syndromeRegTab [zz*bitSymbol+kk] = syndromeRegTab [(zz-1)*bitSymbol+kk] ^ productTab[kk];
662
                  }
663
               }
664
            }
665
         }
666
      }
667
 
668
 
669
      //---------------------------------------------------------------
670
      // build redundancy symbols
671
      //---------------------------------------------------------------
672
      for (zz =0; zz<syndromeLength;zz++) {
673
         redundancySymbols [zz] = 0;
674
      }
675
      for (zz =0; zz<syndromeLength;zz++) {
676
         for (kk=0;kk<bitSymbol;kk++){
677
            redundancySymbols [syndromeLength-1-zz] = redundancySymbols [syndromeLength-1-zz] + syndromeRegTab[(zz*bitSymbol)+kk] * powerTab[kk];
678
         }
679
      }
680
 
681
 
682
      //---------------------------------------------------------------
683
      // build codeword Encoded
684
      //---------------------------------------------------------------
685
      for (zz =0; zz<DataSize;zz++) {
686
         dataEncoded[zz] = dataIn[zz];
687
         dataPure[zz] = dataIn[zz];
688
      }
689
 
690
 
691
      //---------------------------------------------------------------
692
      //---------------------------------------------------------------
693
 
694
      for (zz =0; zz<syndromeLength;zz++) {
695
         dataEncoded[zz+DataSize] = redundancySymbols[zz];
696
         dataPure[zz+DataSize] = redundancySymbols[zz];
697
      }
698
 
699
      //---------------------------------------------------------------
700
      // Make some noise !!!!!
701
      //---------------------------------------------------------------
702
      errCount = 0;
703
      errError = 0;
704
      errErasure = 0;
705
      for (ii = 0;ii<TotalSize;ii++){
706
        ErasureTab [ii] = 0;
707
      }
708
 
709
 
710
      for (ii=0;ii<TotalSize;ii++){
711
 
712
 
713
        switch(PowerErrorRate)
714
        {
715
         case (0):
716
            chanceError = (rand () % 100);
717
         break;
718
         case (1):
719
            chanceError = (rand () % 1000);
720
         break;
721
         case (2):
722
            chanceError = (rand () % 10000);
723
         break;
724
         case (3):
725
            chanceError = (rand () % 100000);
726
         break;
727
         case (4):
728
            chanceError = (rand () % 1000000);
729
         break;
730
         default:
731
            chanceError = 0;
732
         break;
733
        }
734
 
735
 
736
        switch(PowerErasureRate)
737
        {
738
         case (0):
739
            chanceErasure = (rand () % 100);
740
         break;
741
         case (1):
742
            chanceErasure = (rand () % 1000);
743
         break;
744
         case (2):
745
            chanceErasure = (rand () % 10000);
746
         break;
747
         case (3):
748
            chanceErasure = (rand () % 100000);
749
         break;
750
         case (4):
751
            chanceErasure = (rand () % 1000000);
752
         break;
753
         default:
754
            chanceErasure = 0;
755
         break;
756
        }
757
 
758
 
759
 
760
        if (chanceError < ErrorRate) {
761
           errData = rand () & ((1 << bitSymbol) - 1);
762
           if (errData == symbolMax){
763
              errData = symbolMax-1;
764
           }
765
           if (errData == dataEncoded[ii]) {
766
              if (errData == symbolMax-1){
767
                 errData = symbolMax-2;
768
              }else{
769
                 errData = errData+1;
770
              }
771
           }
772
           errCount = errCount+2;
773
           errError = errError +1;
774
           dataEncoded[ii] = errData;
775
        }else{
776
           if (ErasureOption == 1) {
777
              if (chanceErasure < ErasureRate) {
778
                 ErasureTab [ii] = 1;
779
                 errCount = errCount+1;
780
                 errErasure = errErasure + 1;
781
                 dataEncoded[ii] = 0;
782
              }
783
           }
784
        }
785
    }
786
 
787
 
788
      //---------------------------------------------------------------
789
      // RS decoder RTL emulator
790
      //---------------------------------------------------------------
791
      RsDecodeEmulator(ErrorNum, ErasureNum, RTLfailFlag, RTLDataOut, DataSize, TotalSize, PrimPoly, bitSymbol, MrefTab, PrefTab, coeffTab, dataEncoded, ErasureTab);
792
//      ErrorNum [0] = 0;
793
//      ErasureNum[0] = 0;
794
//      RTLfailFlag[0] = 0;
795
 
796
 
797
      //---------------------------------------------------------------
798
      // Write Data Decoder In
799
      //---------------------------------------------------------------
800
      fprintf(OutFileRsDecIn, "// WORD Number: %d\n", loop);
801
      fprintf(OutFileRsDecOut, "// WORD Number: %d\n", loop);
802
 
803
      sync_flag = 0;
804
      for (ii=0;ii<TotalSize;ii++){
805
         if (ii == 0) {
806
            sync_flag = 1;
807
         }else{
808
            sync_flag = 0;
809
         }
810
 
811
         fprintf(OutFileRsDecIn, "%d_%d_%d_%03X\n", sync_flag, 1, ErasureTab[ii], dataEncoded[ii]);
812
         fprintf(OutFileRsDecOut, "%03X_%03X_%03X_%d_%03X_%03X_%03X_%03X\n", ThSyndromeBKP , ThErrorNumBKP, ThErasureNumBKP, RTLfailFlagBKP, ErrorNumBKP, ErasureNumBKP, dataEncoded[ii],  RTLDataOut[ii]);
813
//         fprintf(OutFileRsDecOut, "%03X_%03X_%03X_%d_%03X_%03X_%03X_%03X\n", ThSyndromeBKP , ThErrorNumBKP, ThErasureNumBKP, RTLfailFlagBKP, ErrorNumBKP, ErasureNumBKP, dataEncoded[ii],  dataEncoded[ii]);
814
      }
815
 
816
      ThErrorNumBKP   = errError;
817
      ThErasureNumBKP = errErasure;
818
      ThSyndromeBKP   = syndromeLength;
819
      ErrorNumBKP     = ErrorNum[0];
820
      ErasureNumBKP   = ErasureNum[0];
821
      RTLfailFlagBKP  = RTLfailFlag[0];
822
 
823
 
824
      //---------------------------------------------------------------
825
      // padding if EUCLIDE ALGO is HUGE 
826
      //---------------------------------------------------------------
827
      if (euclideTab[0] > TotalSize) {
828
         paddingLength = euclideTab[0] - TotalSize;
829
         for (ii = 0;ii<paddingLength;ii++) {
830
                fprintf(OutFileRsDecIn, "0_1_0_000\n");
831
         }
832
      }
833
  }
834
 
835
 
836
  //---------------------------------------------------------------
837
  // padding for enable signal
838
  //---------------------------------------------------------------
839
   if (ErasureOption == 1) {
840
      delay = TotalSize + syndromeLength + 1 + euclideTab [0] + 5;
841
   }else{
842
      delay = TotalSize + euclideTab [0] + 5;
843
   }
844
   for (ii = 0;ii<(delay+1);ii++) {
845
         fprintf(OutFileRsDecIn, "0_1_0_000\n");
846
   }
847
 
848
 
849
  //---------------------------------------------------------------
850
  // close file
851
  //---------------------------------------------------------------
852
  fclose(OutFileRsDecIn);
853
  fclose(OutFileRsDecOut);
854
 
855
 
856
  //---------------------------------------------------------------
857
  // Free memory
858
  //---------------------------------------------------------------
859
   delete[] ErasureTab;
860
   delete[] dataEncoded;
861
   delete[] dataPure;
862
   delete[] powerTab;
863
   delete[] feedbackTab;
864
   delete[] productTab;
865
   delete[] genCoeffTab;
866
   delete[] syndromeRegTab;
867
   delete[] redundancySymbols;
868
   delete[] dataIn;
869
   delete[] euclideTab;
870
   delete[] ttTab;
871
   delete[] bbTab;
872
   delete[] ppTab;
873
   delete[] bidon;
874
   delete[] bidonTab0;
875
   delete[] bidonTab1;
876
   delete[] bidonTab2;
877
   delete[] bidonTab3;
878
   delete[] bidonTab4;
879
   delete[] bidonTab5;
880
   delete[] bidonTab6;
881
   delete[] bidonTab7;
882
   delete[] bidonTab8;
883
   delete[] bidonTab9;
884
   delete[] bidonTab10;
885
   delete[] bidonTab11;
886
   delete[] ErrorNum;
887
   delete[] ErasureNum;
888
   delete[] RTLDataOut;
889
   delete[] RTLfailFlag;
890
 
891
 
892
   //---------------------------------------------------------------
893
   // clean string
894
   //---------------------------------------------------------------
895
   free(strRsDecIn);
896
   free(strRsDecOut);
897
 
898
 
899
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.