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/] [RsMrefTab.cpp] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 issei
//===================================================================
2
// Module Name : RsMrefTab
3
// File Name   : RsMrefTab.cpp
4
// Function    : RS Mreference Table
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
 
15
#include <stdio.h>
16
#include <stdlib.h>
17
 
18
#include <ctime>
19
 
20
 
21
 
22
void RsMrefTab(int *MrefTab, int bitSymbol)
23
{
24
 
25
   //---------------------------------------------------------------
26
   //- c++ variables
27
   //---------------------------------------------------------------
28
   int mmTabSize = (bitSymbol*2) -1;
29
   int ii;
30
 
31
 
32
   //------------------------------------------------------------------------
33
   // initialize MrefTab
34
   //------------------------------------------------------------------------
35
    for(ii=0; ii<mmTabSize*bitSymbol; ii++){
36
       MrefTab [ii] = 0;
37
    }
38
 
39
 
40
 
41
   //------------------------------------------------------------------------
42
   // MrefTab construction
43
   //------------------------------------------------------------------------
44
   switch (bitSymbol) {
45
 
46
      //------------------------------------------------------------------------
47
      // bitSymbol = 3
48
      //------------------------------------------------------------------------
49
      case (3):
50
         // M[0] class
51
         MrefTab [0] = 1;
52
         // M[1] class
53
         MrefTab [1*bitSymbol+0] = 2;
54
         MrefTab [1*bitSymbol+1] = 1;
55
         // M[2] class
56
         MrefTab [2*bitSymbol+0] = 3;
57
         MrefTab [2*bitSymbol+1] = 2;
58
         MrefTab [2*bitSymbol+2] = 1;
59
         // M[3] class
60
         MrefTab [3*bitSymbol+1] = 3;
61
         MrefTab [3*bitSymbol+2] = 2;
62
         // M[4] class
63
         MrefTab [4*bitSymbol+2] = 3;
64
      break;
65
      //------------------------------------------------------------------------
66
      // bitSymbol = 4
67
      //------------------------------------------------------------------------
68
      case (4):
69
         // M[0] class
70
         MrefTab [0] = 1;
71
         // M[1] class
72
         MrefTab [1*bitSymbol+0] = 2;
73
         MrefTab [1*bitSymbol+1] = 1;
74
         // M[2] class
75
         MrefTab [2*bitSymbol+0] = 3;
76
         MrefTab [2*bitSymbol+1] = 2;
77
         MrefTab [2*bitSymbol+2] = 1;
78
         // M[3] class
79
         MrefTab [3*bitSymbol+0] = 4;
80
         MrefTab [3*bitSymbol+1] = 3;
81
         MrefTab [3*bitSymbol+2] = 2;
82
         MrefTab [3*bitSymbol+3] = 1;
83
         // M[4] class
84
         MrefTab [4*bitSymbol+1] = 4;
85
         MrefTab [4*bitSymbol+2] = 3;
86
         MrefTab [4*bitSymbol+3] = 2;
87
         // M[5] class
88
         MrefTab [5*bitSymbol+2] = 4;
89
         MrefTab [5*bitSymbol+3] = 3;
90
         // M[6] class
91
         MrefTab [6*bitSymbol+3] = 4;
92
      break;
93
      //------------------------------------------------------------------------
94
      // bitSymbol = 5
95
      //------------------------------------------------------------------------
96
      case (5):
97
         // M[0] class
98
         MrefTab [0] = 1;
99
         // M[1] class
100
         MrefTab [1*bitSymbol+0] = 2;
101
         MrefTab [1*bitSymbol+1] = 1;
102
         // M[2] class
103
         MrefTab [2*bitSymbol+0] = 3;
104
         MrefTab [2*bitSymbol+1] = 2;
105
         MrefTab [2*bitSymbol+2] = 1;
106
         // M[3] class
107
         MrefTab [3*bitSymbol+0] = 4;
108
         MrefTab [3*bitSymbol+1] = 3;
109
         MrefTab [3*bitSymbol+2] = 2;
110
         MrefTab [3*bitSymbol+3] = 1;
111
         // M[4] class
112
         MrefTab [4*bitSymbol+0] = 5;
113
         MrefTab [4*bitSymbol+1] = 4;
114
         MrefTab [4*bitSymbol+2] = 3;
115
         MrefTab [4*bitSymbol+3] = 2;
116
         MrefTab [4*bitSymbol+4] = 1;
117
         // M[5] class
118
         MrefTab [5*bitSymbol+1] = 5;
119
         MrefTab [5*bitSymbol+2] = 4;
120
         MrefTab [5*bitSymbol+3] = 3;
121
         MrefTab [5*bitSymbol+4] = 2;
122
         // M[6] class
123
         MrefTab [6*bitSymbol+2] = 5;
124
         MrefTab [6*bitSymbol+3] = 4;
125
         MrefTab [6*bitSymbol+4] = 3;
126
        // M[7] class
127
         MrefTab [7*bitSymbol+3] = 5;
128
         MrefTab [7*bitSymbol+4] = 4;
129
         // M[8] class
130
         MrefTab [8*bitSymbol+4] = 5;
131
      break;
132
      //------------------------------------------------------------------------
133
      // bitSymbol = 6
134
      //------------------------------------------------------------------------
135
      case (6):
136
         // M[0] class
137
         MrefTab [0] = 1;
138
         // M[1] class
139
         MrefTab [1*bitSymbol+0] = 2;
140
         MrefTab [1*bitSymbol+1] = 1;
141
         // M[2] class
142
         MrefTab [2*bitSymbol+0] = 3;
143
         MrefTab [2*bitSymbol+1] = 2;
144
         MrefTab [2*bitSymbol+2] = 1;
145
         // M[3] class
146
         MrefTab [3*bitSymbol+0] = 4;
147
         MrefTab [3*bitSymbol+1] = 3;
148
         MrefTab [3*bitSymbol+2] = 2;
149
         MrefTab [3*bitSymbol+3] = 1;
150
         // M[4] class
151
         MrefTab [4*bitSymbol+0] = 5;
152
         MrefTab [4*bitSymbol+1] = 4;
153
         MrefTab [4*bitSymbol+2] = 3;
154
         MrefTab [4*bitSymbol+3] = 2;
155
         MrefTab [4*bitSymbol+4] = 1;
156
         // M[5] class
157
         MrefTab [5*bitSymbol+0] = 6;
158
         MrefTab [5*bitSymbol+1] = 5;
159
         MrefTab [5*bitSymbol+2] = 4;
160
         MrefTab [5*bitSymbol+3] = 3;
161
         MrefTab [5*bitSymbol+4] = 2;
162
         MrefTab [5*bitSymbol+5] = 1;
163
         // M[6] class
164
         MrefTab [6*bitSymbol+1] = 6;
165
         MrefTab [6*bitSymbol+2] = 5;
166
         MrefTab [6*bitSymbol+3] = 4;
167
         MrefTab [6*bitSymbol+4] = 3;
168
         MrefTab [6*bitSymbol+5] = 2;
169
        // M[7] class
170
         MrefTab [7*bitSymbol+2] = 6;
171
         MrefTab [7*bitSymbol+3] = 5;
172
         MrefTab [7*bitSymbol+4] = 4;
173
         MrefTab [7*bitSymbol+5] = 3;
174
         // M[8] class
175
         MrefTab [8*bitSymbol+3] = 6;
176
         MrefTab [8*bitSymbol+4] = 5;
177
         MrefTab [8*bitSymbol+5] = 4;
178
         // M[9] class
179
         MrefTab [9*bitSymbol+4] = 6;
180
         MrefTab [9*bitSymbol+5] = 5;
181
         // M[10] class
182
         MrefTab [10*bitSymbol+5] = 6;
183
      break;
184
      //------------------------------------------------------------------------
185
      // bitSymbol = 7
186
      //------------------------------------------------------------------------
187
      case (7):
188
         // M[0] class
189
         MrefTab [0] = 1;
190
         // M[1] class
191
         MrefTab [1*bitSymbol+0] = 2;
192
         MrefTab [1*bitSymbol+1] = 1;
193
         // M[2] class
194
         MrefTab [2*bitSymbol+0] = 3;
195
         MrefTab [2*bitSymbol+1] = 2;
196
         MrefTab [2*bitSymbol+2] = 1;
197
         // M[3] class
198
         MrefTab [3*bitSymbol+0] = 4;
199
         MrefTab [3*bitSymbol+1] = 3;
200
         MrefTab [3*bitSymbol+2] = 2;
201
         MrefTab [3*bitSymbol+3] = 1;
202
         // M[4] class
203
         MrefTab [4*bitSymbol+0] = 5;
204
         MrefTab [4*bitSymbol+1] = 4;
205
         MrefTab [4*bitSymbol+2] = 3;
206
         MrefTab [4*bitSymbol+3] = 2;
207
         MrefTab [4*bitSymbol+4] = 1;
208
         // M[5] class
209
         MrefTab [5*bitSymbol+0] = 6;
210
         MrefTab [5*bitSymbol+1] = 5;
211
         MrefTab [5*bitSymbol+2] = 4;
212
         MrefTab [5*bitSymbol+3] = 3;
213
         MrefTab [5*bitSymbol+4] = 2;
214
         MrefTab [5*bitSymbol+5] = 1;
215
         // M[6] class
216
         MrefTab [6*bitSymbol+0] = 7;
217
         MrefTab [6*bitSymbol+1] = 6;
218
         MrefTab [6*bitSymbol+2] = 5;
219
         MrefTab [6*bitSymbol+3] = 4;
220
         MrefTab [6*bitSymbol+4] = 3;
221
         MrefTab [6*bitSymbol+5] = 2;
222
         MrefTab [6*bitSymbol+6] = 1;
223
        // M[7] class
224
         MrefTab [7*bitSymbol+1] = 7;
225
         MrefTab [7*bitSymbol+2] = 6;
226
         MrefTab [7*bitSymbol+3] = 5;
227
         MrefTab [7*bitSymbol+4] = 4;
228
         MrefTab [7*bitSymbol+5] = 3;
229
         MrefTab [7*bitSymbol+6] = 2;
230
         // M[8] class
231
         MrefTab [8*bitSymbol+2] = 7;
232
         MrefTab [8*bitSymbol+3] = 6;
233
         MrefTab [8*bitSymbol+4] = 5;
234
         MrefTab [8*bitSymbol+5] = 4;
235
         MrefTab [8*bitSymbol+6] = 3;
236
         // M[9] class
237
         MrefTab [9*bitSymbol+3] = 7;
238
         MrefTab [9*bitSymbol+4] = 6;
239
         MrefTab [9*bitSymbol+5] = 5;
240
         MrefTab [9*bitSymbol+6] = 4;
241
         // M[10] class
242
         MrefTab [10*bitSymbol+4] = 7;
243
         MrefTab [10*bitSymbol+5] = 6;
244
         MrefTab [10*bitSymbol+6] = 5;
245
         // M[11] class
246
         MrefTab [11*bitSymbol+5] = 7;
247
         MrefTab [11*bitSymbol+6] = 6;
248
         // M[12] class
249
         MrefTab [12*bitSymbol+6] = 7;
250
      break;
251
      //------------------------------------------------------------------------
252
      // bitSymbol = 8
253
      //------------------------------------------------------------------------
254
      case (8):
255
         // M[0] class
256
         MrefTab [0] = 1;
257
         // M[1] class
258
         MrefTab [1*bitSymbol+0] = 2;
259
         MrefTab [1*bitSymbol+1] = 1;
260
         // M[2] class
261
         MrefTab [2*bitSymbol+0] = 3;
262
         MrefTab [2*bitSymbol+1] = 2;
263
         MrefTab [2*bitSymbol+2] = 1;
264
         // M[3] class
265
         MrefTab [3*bitSymbol+0] = 4;
266
         MrefTab [3*bitSymbol+1] = 3;
267
         MrefTab [3*bitSymbol+2] = 2;
268
         MrefTab [3*bitSymbol+3] = 1;
269
         // M[4] class
270
         MrefTab [4*bitSymbol+0] = 5;
271
         MrefTab [4*bitSymbol+1] = 4;
272
         MrefTab [4*bitSymbol+2] = 3;
273
         MrefTab [4*bitSymbol+3] = 2;
274
         MrefTab [4*bitSymbol+4] = 1;
275
         // M[5] class
276
         MrefTab [5*bitSymbol+0] = 6;
277
         MrefTab [5*bitSymbol+1] = 5;
278
         MrefTab [5*bitSymbol+2] = 4;
279
         MrefTab [5*bitSymbol+3] = 3;
280
         MrefTab [5*bitSymbol+4] = 2;
281
         MrefTab [5*bitSymbol+5] = 1;
282
         // M[6] class
283
         MrefTab [6*bitSymbol+0] = 7;
284
         MrefTab [6*bitSymbol+1] = 6;
285
         MrefTab [6*bitSymbol+2] = 5;
286
         MrefTab [6*bitSymbol+3] = 4;
287
         MrefTab [6*bitSymbol+4] = 3;
288
         MrefTab [6*bitSymbol+5] = 2;
289
         MrefTab [6*bitSymbol+6] = 1;
290
        // M[7] class
291
         MrefTab [7*bitSymbol+0] = 8;
292
         MrefTab [7*bitSymbol+1] = 7;
293
         MrefTab [7*bitSymbol+2] = 6;
294
         MrefTab [7*bitSymbol+3] = 5;
295
         MrefTab [7*bitSymbol+4] = 4;
296
         MrefTab [7*bitSymbol+5] = 3;
297
         MrefTab [7*bitSymbol+6] = 2;
298
         MrefTab [7*bitSymbol+7] = 1;
299
         // M[8] class
300
         MrefTab [8*bitSymbol+1] = 8;
301
         MrefTab [8*bitSymbol+2] = 7;
302
         MrefTab [8*bitSymbol+3] = 6;
303
         MrefTab [8*bitSymbol+4] = 5;
304
         MrefTab [8*bitSymbol+5] = 4;
305
         MrefTab [8*bitSymbol+6] = 3;
306
         MrefTab [8*bitSymbol+7] = 2;
307
         // M[9] class
308
         MrefTab [9*bitSymbol+2] = 8;
309
         MrefTab [9*bitSymbol+3] = 7;
310
         MrefTab [9*bitSymbol+4] = 6;
311
         MrefTab [9*bitSymbol+5] = 5;
312
         MrefTab [9*bitSymbol+6] = 4;
313
         MrefTab [9*bitSymbol+7] = 3;
314
         // M[10] class
315
         MrefTab [10*bitSymbol+3] = 8;
316
         MrefTab [10*bitSymbol+4] = 7;
317
         MrefTab [10*bitSymbol+5] = 6;
318
         MrefTab [10*bitSymbol+6] = 5;
319
         MrefTab [10*bitSymbol+7] = 4;
320
         // M[11] class
321
         MrefTab [11*bitSymbol+4] = 8;
322
         MrefTab [11*bitSymbol+5] = 7;
323
         MrefTab [11*bitSymbol+6] = 6;
324
         MrefTab [11*bitSymbol+7] = 5;
325
         // M[12] class
326
         MrefTab [12*bitSymbol+5] = 8;
327
         MrefTab [12*bitSymbol+6] = 7;
328
         MrefTab [12*bitSymbol+7] = 6;
329
         // M[13] class
330
         MrefTab [13*bitSymbol+6] = 8;
331
         MrefTab [13*bitSymbol+7] = 7;
332
         // M[14] class
333
         MrefTab [14*bitSymbol+7] = 8;
334
      break;
335
      //------------------------------------------------------------------------
336
      // bitSymbol = 9
337
      //------------------------------------------------------------------------
338
      case (9):
339
         // M[0] class
340
         MrefTab [0] = 1;
341
         // M[1] class
342
         MrefTab [1*bitSymbol+0] = 2;
343
         MrefTab [1*bitSymbol+1] = 1;
344
         // M[2] class
345
         MrefTab [2*bitSymbol+0] = 3;
346
         MrefTab [2*bitSymbol+1] = 2;
347
         MrefTab [2*bitSymbol+2] = 1;
348
         // M[3] class
349
         MrefTab [3*bitSymbol+0] = 4;
350
         MrefTab [3*bitSymbol+1] = 3;
351
         MrefTab [3*bitSymbol+2] = 2;
352
         MrefTab [3*bitSymbol+3] = 1;
353
         // M[4] class
354
         MrefTab [4*bitSymbol+0] = 5;
355
         MrefTab [4*bitSymbol+1] = 4;
356
         MrefTab [4*bitSymbol+2] = 3;
357
         MrefTab [4*bitSymbol+3] = 2;
358
         MrefTab [4*bitSymbol+4] = 1;
359
         // M[5] class
360
         MrefTab [5*bitSymbol+0] = 6;
361
         MrefTab [5*bitSymbol+1] = 5;
362
         MrefTab [5*bitSymbol+2] = 4;
363
         MrefTab [5*bitSymbol+3] = 3;
364
         MrefTab [5*bitSymbol+4] = 2;
365
         MrefTab [5*bitSymbol+5] = 1;
366
         // M[6] class
367
         MrefTab [6*bitSymbol+0] = 7;
368
         MrefTab [6*bitSymbol+1] = 6;
369
         MrefTab [6*bitSymbol+2] = 5;
370
         MrefTab [6*bitSymbol+3] = 4;
371
         MrefTab [6*bitSymbol+4] = 3;
372
         MrefTab [6*bitSymbol+5] = 2;
373
         MrefTab [6*bitSymbol+6] = 1;
374
        // M[7] class
375
         MrefTab [7*bitSymbol+0] = 8;
376
         MrefTab [7*bitSymbol+1] = 7;
377
         MrefTab [7*bitSymbol+2] = 6;
378
         MrefTab [7*bitSymbol+3] = 5;
379
         MrefTab [7*bitSymbol+4] = 4;
380
         MrefTab [7*bitSymbol+5] = 3;
381
         MrefTab [7*bitSymbol+6] = 2;
382
         MrefTab [7*bitSymbol+7] = 1;
383
         // M[8] class
384
         MrefTab [8*bitSymbol+0] = 9;
385
         MrefTab [8*bitSymbol+1] = 8;
386
         MrefTab [8*bitSymbol+2] = 7;
387
         MrefTab [8*bitSymbol+3] = 6;
388
         MrefTab [8*bitSymbol+4] = 5;
389
         MrefTab [8*bitSymbol+5] = 4;
390
         MrefTab [8*bitSymbol+6] = 3;
391
         MrefTab [8*bitSymbol+7] = 2;
392
         MrefTab [8*bitSymbol+8] = 1;
393
         // M[9] class
394
         MrefTab [9*bitSymbol+1] = 9;
395
         MrefTab [9*bitSymbol+2] = 8;
396
         MrefTab [9*bitSymbol+3] = 7;
397
         MrefTab [9*bitSymbol+4] = 6;
398
         MrefTab [9*bitSymbol+5] = 5;
399
         MrefTab [9*bitSymbol+6] = 4;
400
         MrefTab [9*bitSymbol+7] = 3;
401
         MrefTab [9*bitSymbol+8] = 2;
402
         // M[10] class
403
         MrefTab [10*bitSymbol+2] = 9;
404
         MrefTab [10*bitSymbol+3] = 8;
405
         MrefTab [10*bitSymbol+4] = 7;
406
         MrefTab [10*bitSymbol+5] = 6;
407
         MrefTab [10*bitSymbol+6] = 5;
408
         MrefTab [10*bitSymbol+7] = 4;
409
         MrefTab [10*bitSymbol+8] = 3;
410
         // M[11] class
411
         MrefTab [11*bitSymbol+3] = 9;
412
         MrefTab [11*bitSymbol+4] = 8;
413
         MrefTab [11*bitSymbol+5] = 7;
414
         MrefTab [11*bitSymbol+6] = 6;
415
         MrefTab [11*bitSymbol+7] = 5;
416
         MrefTab [11*bitSymbol+8] = 4;
417
         // M[12] class
418
         MrefTab [12*bitSymbol+4] = 9;
419
         MrefTab [12*bitSymbol+5] = 8;
420
         MrefTab [12*bitSymbol+6] = 7;
421
         MrefTab [12*bitSymbol+7] = 6;
422
         MrefTab [12*bitSymbol+8] = 5;
423
         // M[13] class
424
         MrefTab [13*bitSymbol+5] = 9;
425
         MrefTab [13*bitSymbol+6] = 8;
426
         MrefTab [13*bitSymbol+7] = 7;
427
         MrefTab [13*bitSymbol+8] = 6;
428
         // M[14] class
429
         MrefTab [14*bitSymbol+6] = 9;
430
         MrefTab [14*bitSymbol+7] = 8;
431
         MrefTab [14*bitSymbol+8] = 7;
432
         // M[15] class
433
         MrefTab [15*bitSymbol+7] = 9;
434
         MrefTab [15*bitSymbol+8] = 8;
435
         // M[16] class
436
         MrefTab [16*bitSymbol+8] = 9;
437
      break;
438
      //------------------------------------------------------------------------
439
      // bitSymbol = 10
440
      //------------------------------------------------------------------------
441
      case (10):
442
         // M[0] class
443
         MrefTab [0] = 1;
444
         // M[1] class
445
         MrefTab [1*bitSymbol+0] = 2;
446
         MrefTab [1*bitSymbol+1] = 1;
447
         // M[2] class
448
         MrefTab [2*bitSymbol+0] = 3;
449
         MrefTab [2*bitSymbol+1] = 2;
450
         MrefTab [2*bitSymbol+2] = 1;
451
         // M[3] class
452
         MrefTab [3*bitSymbol+0] = 4;
453
         MrefTab [3*bitSymbol+1] = 3;
454
         MrefTab [3*bitSymbol+2] = 2;
455
         MrefTab [3*bitSymbol+3] = 1;
456
         // M[4] class
457
         MrefTab [4*bitSymbol+0] = 5;
458
         MrefTab [4*bitSymbol+1] = 4;
459
         MrefTab [4*bitSymbol+2] = 3;
460
         MrefTab [4*bitSymbol+3] = 2;
461
         MrefTab [4*bitSymbol+4] = 1;
462
         // M[5] class
463
         MrefTab [5*bitSymbol+0] = 6;
464
         MrefTab [5*bitSymbol+1] = 5;
465
         MrefTab [5*bitSymbol+2] = 4;
466
         MrefTab [5*bitSymbol+3] = 3;
467
         MrefTab [5*bitSymbol+4] = 2;
468
         MrefTab [5*bitSymbol+5] = 1;
469
         // M[6] class
470
         MrefTab [6*bitSymbol+0] = 7;
471
         MrefTab [6*bitSymbol+1] = 6;
472
         MrefTab [6*bitSymbol+2] = 5;
473
         MrefTab [6*bitSymbol+3] = 4;
474
         MrefTab [6*bitSymbol+4] = 3;
475
         MrefTab [6*bitSymbol+5] = 2;
476
         MrefTab [6*bitSymbol+6] = 1;
477
        // M[7] class
478
         MrefTab [7*bitSymbol+0] = 8;
479
         MrefTab [7*bitSymbol+1] = 7;
480
         MrefTab [7*bitSymbol+2] = 6;
481
         MrefTab [7*bitSymbol+3] = 5;
482
         MrefTab [7*bitSymbol+4] = 4;
483
         MrefTab [7*bitSymbol+5] = 3;
484
         MrefTab [7*bitSymbol+6] = 2;
485
         MrefTab [7*bitSymbol+7] = 1;
486
         // M[8] class
487
         MrefTab [8*bitSymbol+0] = 9;
488
         MrefTab [8*bitSymbol+1] = 8;
489
         MrefTab [8*bitSymbol+2] = 7;
490
         MrefTab [8*bitSymbol+3] = 6;
491
         MrefTab [8*bitSymbol+4] = 5;
492
         MrefTab [8*bitSymbol+5] = 4;
493
         MrefTab [8*bitSymbol+6] = 3;
494
         MrefTab [8*bitSymbol+7] = 2;
495
         MrefTab [8*bitSymbol+8] = 1;
496
         // M[9] class
497
         MrefTab [9*bitSymbol+0] = 10;
498
         MrefTab [9*bitSymbol+1] = 9;
499
         MrefTab [9*bitSymbol+2] = 8;
500
         MrefTab [9*bitSymbol+3] = 7;
501
         MrefTab [9*bitSymbol+4] = 6;
502
         MrefTab [9*bitSymbol+5] = 5;
503
         MrefTab [9*bitSymbol+6] = 4;
504
         MrefTab [9*bitSymbol+7] = 3;
505
         MrefTab [9*bitSymbol+8] = 2;
506
         MrefTab [9*bitSymbol+9] = 1;
507
         // M[10] class
508
         MrefTab [10*bitSymbol+1] = 10;
509
         MrefTab [10*bitSymbol+2] = 9;
510
         MrefTab [10*bitSymbol+3] = 8;
511
         MrefTab [10*bitSymbol+4] = 7;
512
         MrefTab [10*bitSymbol+5] = 6;
513
         MrefTab [10*bitSymbol+6] = 5;
514
         MrefTab [10*bitSymbol+7] = 4;
515
         MrefTab [10*bitSymbol+8] = 3;
516
         MrefTab [10*bitSymbol+9] = 2;
517
         // M[11] class
518
         MrefTab [11*bitSymbol+2] = 10;
519
         MrefTab [11*bitSymbol+3] = 9;
520
         MrefTab [11*bitSymbol+4] = 8;
521
         MrefTab [11*bitSymbol+5] = 7;
522
         MrefTab [11*bitSymbol+6] = 6;
523
         MrefTab [11*bitSymbol+7] = 5;
524
         MrefTab [11*bitSymbol+8] = 4;
525
         MrefTab [11*bitSymbol+9] = 3;
526
         // M[12] class
527
         MrefTab [12*bitSymbol+3] = 10;
528
         MrefTab [12*bitSymbol+4] = 9;
529
         MrefTab [12*bitSymbol+5] = 8;
530
         MrefTab [12*bitSymbol+6] = 7;
531
         MrefTab [12*bitSymbol+7] = 6;
532
         MrefTab [12*bitSymbol+8] = 5;
533
         MrefTab [12*bitSymbol+9] = 4;
534
         // M[13] class
535
         MrefTab [13*bitSymbol+4] = 10;
536
         MrefTab [13*bitSymbol+5] = 9;
537
         MrefTab [13*bitSymbol+6] = 8;
538
         MrefTab [13*bitSymbol+7] = 7;
539
         MrefTab [13*bitSymbol+8] = 6;
540
         MrefTab [13*bitSymbol+9] = 5;
541
         // M[14] class
542
         MrefTab [14*bitSymbol+5] = 10;
543
         MrefTab [14*bitSymbol+6] = 9;
544
         MrefTab [14*bitSymbol+7] = 8;
545
         MrefTab [14*bitSymbol+8] = 7;
546
         MrefTab [14*bitSymbol+9] = 6;
547
         // M[15] class
548
         MrefTab [15*bitSymbol+6] = 10;
549
         MrefTab [15*bitSymbol+7] = 9;
550
         MrefTab [15*bitSymbol+8] = 8;
551
         MrefTab [15*bitSymbol+9] = 7;
552
         // M[16] class
553
         MrefTab [16*bitSymbol+7] = 10;
554
         MrefTab [16*bitSymbol+8] = 9;
555
         MrefTab [16*bitSymbol+9] = 8;
556
         // M[17] class
557
         MrefTab [17*bitSymbol+8] = 10;
558
         MrefTab [17*bitSymbol+9] = 9;
559
         // M[18] class
560
         MrefTab [18*bitSymbol+9] = 10;
561
      break;
562
      //------------------------------------------------------------------------
563
      // bitSymbol = 11
564
      //------------------------------------------------------------------------
565
      case (11):
566
         // M[0] class
567
         MrefTab [0] = 1;
568
         // M[1] class
569
         MrefTab [1*bitSymbol+0] = 2;
570
         MrefTab [1*bitSymbol+1] = 1;
571
         // M[2] class
572
         MrefTab [2*bitSymbol+0] = 3;
573
         MrefTab [2*bitSymbol+1] = 2;
574
         MrefTab [2*bitSymbol+2] = 1;
575
         // M[3] class
576
         MrefTab [3*bitSymbol+0] = 4;
577
         MrefTab [3*bitSymbol+1] = 3;
578
         MrefTab [3*bitSymbol+2] = 2;
579
         MrefTab [3*bitSymbol+3] = 1;
580
         // M[4] class
581
         MrefTab [4*bitSymbol+0] = 5;
582
         MrefTab [4*bitSymbol+1] = 4;
583
         MrefTab [4*bitSymbol+2] = 3;
584
         MrefTab [4*bitSymbol+3] = 2;
585
         MrefTab [4*bitSymbol+4] = 1;
586
         // M[5] class
587
         MrefTab [5*bitSymbol+0] = 6;
588
         MrefTab [5*bitSymbol+1] = 5;
589
         MrefTab [5*bitSymbol+2] = 4;
590
         MrefTab [5*bitSymbol+3] = 3;
591
         MrefTab [5*bitSymbol+4] = 2;
592
         MrefTab [5*bitSymbol+5] = 1;
593
         // M[6] class
594
         MrefTab [6*bitSymbol+0] = 7;
595
         MrefTab [6*bitSymbol+1] = 6;
596
         MrefTab [6*bitSymbol+2] = 5;
597
         MrefTab [6*bitSymbol+3] = 4;
598
         MrefTab [6*bitSymbol+4] = 3;
599
         MrefTab [6*bitSymbol+5] = 2;
600
         MrefTab [6*bitSymbol+6] = 1;
601
         // M[7] class
602
         MrefTab [7*bitSymbol+0] = 8;
603
         MrefTab [7*bitSymbol+1] = 7;
604
         MrefTab [7*bitSymbol+2] = 6;
605
         MrefTab [7*bitSymbol+3] = 5;
606
         MrefTab [7*bitSymbol+4] = 4;
607
         MrefTab [7*bitSymbol+5] = 3;
608
         MrefTab [7*bitSymbol+6] = 2;
609
         MrefTab [7*bitSymbol+7] = 1;
610
         // M[8] class
611
         MrefTab [8*bitSymbol+0] = 9;
612
         MrefTab [8*bitSymbol+1] = 8;
613
         MrefTab [8*bitSymbol+2] = 7;
614
         MrefTab [8*bitSymbol+3] = 6;
615
         MrefTab [8*bitSymbol+4] = 5;
616
         MrefTab [8*bitSymbol+5] = 4;
617
         MrefTab [8*bitSymbol+6] = 3;
618
         MrefTab [8*bitSymbol+7] = 2;
619
         MrefTab [8*bitSymbol+8] = 1;
620
         // M[9] class
621
         MrefTab [9*bitSymbol+0] = 10;
622
         MrefTab [9*bitSymbol+1] = 9;
623
         MrefTab [9*bitSymbol+2] = 8;
624
         MrefTab [9*bitSymbol+3] = 7;
625
         MrefTab [9*bitSymbol+4] = 6;
626
         MrefTab [9*bitSymbol+5] = 5;
627
         MrefTab [9*bitSymbol+6] = 4;
628
         MrefTab [9*bitSymbol+7] = 3;
629
         MrefTab [9*bitSymbol+8] = 2;
630
         MrefTab [9*bitSymbol+9] = 1;
631
         // M[10] class
632
         MrefTab [10*bitSymbol+0]  = 11;
633
         MrefTab [10*bitSymbol+1]  = 10;
634
         MrefTab [10*bitSymbol+2]  = 9;
635
         MrefTab [10*bitSymbol+3]  = 8;
636
         MrefTab [10*bitSymbol+4]  = 7;
637
         MrefTab [10*bitSymbol+5]  = 6;
638
         MrefTab [10*bitSymbol+6]  = 5;
639
         MrefTab [10*bitSymbol+7]  = 4;
640
         MrefTab [10*bitSymbol+8]  = 3;
641
         MrefTab [10*bitSymbol+9]  = 2;
642
         MrefTab [10*bitSymbol+10] = 1;
643
         // M[11] class
644
         MrefTab [11*bitSymbol+1]  = 11;
645
         MrefTab [11*bitSymbol+2]  = 10;
646
         MrefTab [11*bitSymbol+3]  = 9;
647
         MrefTab [11*bitSymbol+4]  = 8;
648
         MrefTab [11*bitSymbol+5]  = 7;
649
         MrefTab [11*bitSymbol+6]  = 6;
650
         MrefTab [11*bitSymbol+7]  = 5;
651
         MrefTab [11*bitSymbol+8]  = 4;
652
         MrefTab [11*bitSymbol+9]  = 3;
653
         MrefTab [11*bitSymbol+10] = 2;
654
         // M[12] class
655
         MrefTab [12*bitSymbol+2]  = 11;
656
         MrefTab [12*bitSymbol+3]  = 10;
657
         MrefTab [12*bitSymbol+4]  = 9;
658
         MrefTab [12*bitSymbol+5]  = 8;
659
         MrefTab [12*bitSymbol+6]  = 7;
660
         MrefTab [12*bitSymbol+7]  = 6;
661
         MrefTab [12*bitSymbol+8]  = 5;
662
         MrefTab [12*bitSymbol+9]  = 4;
663
         MrefTab [12*bitSymbol+10] = 3;
664
         // M[13] class
665
         MrefTab [13*bitSymbol+3]  = 11;
666
         MrefTab [13*bitSymbol+4]  = 10;
667
         MrefTab [13*bitSymbol+5]  = 9;
668
         MrefTab [13*bitSymbol+6]  = 8;
669
         MrefTab [13*bitSymbol+7]  = 7;
670
         MrefTab [13*bitSymbol+8]  = 6;
671
         MrefTab [13*bitSymbol+9]  = 5;
672
         MrefTab [13*bitSymbol+10] = 4;
673
         // M[14] class
674
         MrefTab [14*bitSymbol+4]  = 11;
675
         MrefTab [14*bitSymbol+5]  = 10;
676
         MrefTab [14*bitSymbol+6]  = 9;
677
         MrefTab [14*bitSymbol+7]  = 8;
678
         MrefTab [14*bitSymbol+8]  = 7;
679
         MrefTab [14*bitSymbol+9]  = 6;
680
         MrefTab [14*bitSymbol+10] = 5;
681
         // M[15] class
682
         MrefTab [15*bitSymbol+5]  = 11;
683
         MrefTab [15*bitSymbol+6]  = 10;
684
         MrefTab [15*bitSymbol+7]  = 9;
685
         MrefTab [15*bitSymbol+8]  = 8;
686
         MrefTab [15*bitSymbol+9]  = 7;
687
         MrefTab [15*bitSymbol+10] = 6;
688
         // M[16] class
689
         MrefTab [16*bitSymbol+6]  = 11;
690
         MrefTab [16*bitSymbol+7]  = 10;
691
         MrefTab [16*bitSymbol+8]  = 9;
692
         MrefTab [16*bitSymbol+9]  = 8;
693
         MrefTab [16*bitSymbol+10] = 7;
694
         // M[17] class
695
         MrefTab [17*bitSymbol+7]  = 11;
696
         MrefTab [17*bitSymbol+8]  = 10;
697
         MrefTab [17*bitSymbol+9]  = 9;
698
         MrefTab [17*bitSymbol+10] = 8;
699
         // M[18] class
700
         MrefTab [18*bitSymbol+8]  = 11;
701
         MrefTab [18*bitSymbol+9]  = 10;
702
         MrefTab [18*bitSymbol+10] = 9;
703
         // M[19] class
704
         MrefTab [19*bitSymbol+9]  = 11;
705
         MrefTab [19*bitSymbol+10] = 10;
706
         // M[20] class
707
         MrefTab [20*bitSymbol+10] = 11;
708
      break;
709
      //------------------------------------------------------------------------
710
      // bitSymbol = 12
711
      //------------------------------------------------------------------------
712
      case (12):
713
         // M[0] class
714
         MrefTab [0] = 1;
715
         // M[1] class
716
         MrefTab [1*bitSymbol+0] = 2;
717
         MrefTab [1*bitSymbol+1] = 1;
718
         // M[2] class
719
         MrefTab [2*bitSymbol+0] = 3;
720
         MrefTab [2*bitSymbol+1] = 2;
721
         MrefTab [2*bitSymbol+2] = 1;
722
         // M[3] class
723
         MrefTab [3*bitSymbol+0] = 4;
724
         MrefTab [3*bitSymbol+1] = 3;
725
         MrefTab [3*bitSymbol+2] = 2;
726
         MrefTab [3*bitSymbol+3] = 1;
727
         // M[4] class
728
         MrefTab [4*bitSymbol+0] = 5;
729
         MrefTab [4*bitSymbol+1] = 4;
730
         MrefTab [4*bitSymbol+2] = 3;
731
         MrefTab [4*bitSymbol+3] = 2;
732
         MrefTab [4*bitSymbol+4] = 1;
733
         // M[5] class
734
         MrefTab [5*bitSymbol+0] = 6;
735
         MrefTab [5*bitSymbol+1] = 5;
736
         MrefTab [5*bitSymbol+2] = 4;
737
         MrefTab [5*bitSymbol+3] = 3;
738
         MrefTab [5*bitSymbol+4] = 2;
739
         MrefTab [5*bitSymbol+5] = 1;
740
         // M[6] class
741
         MrefTab [6*bitSymbol+0] = 7;
742
         MrefTab [6*bitSymbol+1] = 6;
743
         MrefTab [6*bitSymbol+2] = 5;
744
         MrefTab [6*bitSymbol+3] = 4;
745
         MrefTab [6*bitSymbol+4] = 3;
746
         MrefTab [6*bitSymbol+5] = 2;
747
         MrefTab [6*bitSymbol+6] = 1;
748
         // M[7] class
749
         MrefTab [7*bitSymbol+0] = 8;
750
         MrefTab [7*bitSymbol+1] = 7;
751
         MrefTab [7*bitSymbol+2] = 6;
752
         MrefTab [7*bitSymbol+3] = 5;
753
         MrefTab [7*bitSymbol+4] = 4;
754
         MrefTab [7*bitSymbol+5] = 3;
755
         MrefTab [7*bitSymbol+6] = 2;
756
         MrefTab [7*bitSymbol+7] = 1;
757
         // M[8] class
758
         MrefTab [8*bitSymbol+0] = 9;
759
         MrefTab [8*bitSymbol+1] = 8;
760
         MrefTab [8*bitSymbol+2] = 7;
761
         MrefTab [8*bitSymbol+3] = 6;
762
         MrefTab [8*bitSymbol+4] = 5;
763
         MrefTab [8*bitSymbol+5] = 4;
764
         MrefTab [8*bitSymbol+6] = 3;
765
         MrefTab [8*bitSymbol+7] = 2;
766
         MrefTab [8*bitSymbol+8] = 1;
767
         // M[9] class
768
         MrefTab [9*bitSymbol+0] = 10;
769
         MrefTab [9*bitSymbol+1] = 9;
770
         MrefTab [9*bitSymbol+2] = 8;
771
         MrefTab [9*bitSymbol+3] = 7;
772
         MrefTab [9*bitSymbol+4] = 6;
773
         MrefTab [9*bitSymbol+5] = 5;
774
         MrefTab [9*bitSymbol+6] = 4;
775
         MrefTab [9*bitSymbol+7] = 3;
776
         MrefTab [9*bitSymbol+8] = 2;
777
         MrefTab [9*bitSymbol+9] = 1;
778
         // M[10] class
779
         MrefTab [10*bitSymbol+0]  = 11;
780
         MrefTab [10*bitSymbol+1]  = 10;
781
         MrefTab [10*bitSymbol+2]  = 9;
782
         MrefTab [10*bitSymbol+3]  = 8;
783
         MrefTab [10*bitSymbol+4]  = 7;
784
         MrefTab [10*bitSymbol+5]  = 6;
785
         MrefTab [10*bitSymbol+6]  = 5;
786
         MrefTab [10*bitSymbol+7]  = 4;
787
         MrefTab [10*bitSymbol+8]  = 3;
788
         MrefTab [10*bitSymbol+9]  = 2;
789
         MrefTab [10*bitSymbol+10] = 1;
790
         // M[11] class
791
         MrefTab [11*bitSymbol+0]  = 12;
792
         MrefTab [11*bitSymbol+1]  = 11;
793
         MrefTab [11*bitSymbol+2]  = 10;
794
         MrefTab [11*bitSymbol+3]  = 9;
795
         MrefTab [11*bitSymbol+4]  = 8;
796
         MrefTab [11*bitSymbol+5]  = 7;
797
         MrefTab [11*bitSymbol+6]  = 6;
798
         MrefTab [11*bitSymbol+7]  = 5;
799
         MrefTab [11*bitSymbol+8]  = 4;
800
         MrefTab [11*bitSymbol+9]  = 3;
801
         MrefTab [11*bitSymbol+10] = 2;
802
         MrefTab [11*bitSymbol+11] = 1;
803
         // M[12] class
804
         MrefTab [12*bitSymbol+1]  = 12;
805
         MrefTab [12*bitSymbol+2]  = 11;
806
         MrefTab [12*bitSymbol+3]  = 10;
807
         MrefTab [12*bitSymbol+4]  = 9;
808
         MrefTab [12*bitSymbol+5]  = 8;
809
         MrefTab [12*bitSymbol+6]  = 7;
810
         MrefTab [12*bitSymbol+7]  = 6;
811
         MrefTab [12*bitSymbol+8]  = 5;
812
         MrefTab [12*bitSymbol+9]  = 4;
813
         MrefTab [12*bitSymbol+10] = 3;
814
         MrefTab [12*bitSymbol+11] = 2;
815
         // M[13] class
816
         MrefTab [13*bitSymbol+2]  = 12;
817
         MrefTab [13*bitSymbol+3]  = 11;
818
         MrefTab [13*bitSymbol+4]  = 10;
819
         MrefTab [13*bitSymbol+5]  = 9;
820
         MrefTab [13*bitSymbol+6]  = 8;
821
         MrefTab [13*bitSymbol+7]  = 7;
822
         MrefTab [13*bitSymbol+8]  = 6;
823
         MrefTab [13*bitSymbol+9]  = 5;
824
         MrefTab [13*bitSymbol+10] = 4;
825
         MrefTab [13*bitSymbol+11] = 3;
826
         // M[14] class
827
         MrefTab [14*bitSymbol+3]  = 12;
828
         MrefTab [14*bitSymbol+4]  = 11;
829
         MrefTab [14*bitSymbol+5]  = 10;
830
         MrefTab [14*bitSymbol+6]  = 9;
831
         MrefTab [14*bitSymbol+7]  = 8;
832
         MrefTab [14*bitSymbol+8]  = 7;
833
         MrefTab [14*bitSymbol+9]  = 6;
834
         MrefTab [14*bitSymbol+10] = 5;
835
         MrefTab [14*bitSymbol+11] = 4;
836
         // M[15] class
837
         MrefTab [15*bitSymbol+4]  = 12;
838
         MrefTab [15*bitSymbol+5]  = 11;
839
         MrefTab [15*bitSymbol+6]  = 10;
840
         MrefTab [15*bitSymbol+7]  = 9;
841
         MrefTab [15*bitSymbol+8]  = 8;
842
         MrefTab [15*bitSymbol+9]  = 7;
843
         MrefTab [15*bitSymbol+10] = 6;
844
         MrefTab [15*bitSymbol+11] = 5;
845
         // M[16] class
846
         MrefTab [16*bitSymbol+5]  = 12;
847
         MrefTab [16*bitSymbol+6]  = 11;
848
         MrefTab [16*bitSymbol+7]  = 10;
849
         MrefTab [16*bitSymbol+8]  = 9;
850
         MrefTab [16*bitSymbol+9]  = 8;
851
         MrefTab [16*bitSymbol+10] = 7;
852
         MrefTab [16*bitSymbol+11] = 6;
853
         // M[17] class
854
         MrefTab [17*bitSymbol+6]  = 12;
855
         MrefTab [17*bitSymbol+7]  = 11;
856
         MrefTab [17*bitSymbol+8]  = 10;
857
         MrefTab [17*bitSymbol+9]  = 9;
858
         MrefTab [17*bitSymbol+10] = 8;
859
         MrefTab [17*bitSymbol+11] = 7;
860
         // M[18] class
861
         MrefTab [18*bitSymbol+7]  = 12;
862
         MrefTab [18*bitSymbol+8]  = 11;
863
         MrefTab [18*bitSymbol+9]  = 10;
864
         MrefTab [18*bitSymbol+10] = 9;
865
         MrefTab [18*bitSymbol+11] = 8;
866
         // M[19] class
867
         MrefTab [19*bitSymbol+8]  = 12;
868
         MrefTab [19*bitSymbol+9]  = 11;
869
         MrefTab [19*bitSymbol+10] = 10;
870
         MrefTab [19*bitSymbol+11] = 9;
871
         // M[20] class
872
         MrefTab [20*bitSymbol+9]  = 12;
873
         MrefTab [20*bitSymbol+10] = 11;
874
         MrefTab [20*bitSymbol+11] = 10;
875
         // M[21] class
876
         MrefTab [21*bitSymbol+10] = 12;
877
         MrefTab [21*bitSymbol+11] = 11;
878
         // M[22] class
879
         MrefTab [22*bitSymbol+11] = 12;
880
      break;
881
      default:
882
         MrefTab [0] = 0;
883
      break;
884
   }
885
 
886
 
887
}

powered by: WebSVN 2.1.0

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