1 -------------------------------------------------------
6 -------------------------------------------------------
10 USE ieee.std_logic_1164.
all;
26 data_o : out ((K*SYMB_BITWIDTH)-1 downto 0)
28 END rs_decoder_N31K29;
34 FUNCTION gf_multBy2_5 (
38 VARIABLE tmp: (4 downto 0);
42 tmp(2) := op(1) xor op(4);
50 op1 :
in (
4 downto 0);
54 VARIABLE tmp: (4 downto 0);
56 tmp(0) := (((((op1(4) and op2(4)) xor (op1(1) and op2(4))) xor (op1(2) and op2(3))) xor (op1(3) and op2(2))) xor (op1(4) and op2(1))) xor (op1(0) and op2(0));
57 tmp(1) := ((((op1(1) and op2(0)) xor (op1(0) and op2(1))) xor (op1(4) and op2(2))) xor (op1(3) and op2(3))) xor (op1(2) and op2(4));
58 tmp(2) := (((((((((op1(2) and op2(0)) xor (op1(1) and op2(1))) xor (op1(4) and op2(1))) xor (op1(0) and op2(2))) xor (op1(3) and op2(2))) xor (op1(2) and op2(3))) xor (op1(4) and op2(3))) xor (op1(1) and op2(4))) xor (op1(3) and op2(4))) xor (op1(4) and op2(4));
59 tmp(3) := (((((((op1(3) and op2(0)) xor (op1(2) and op2(1))) xor (op1(1) and op2(2))) xor (op1(4) and op2(2))) xor (op1(0) and op2(3))) xor (op1(3) and op2(3))) xor (op1(2) and op2(4))) xor (op1(4) and op2(4));
60 tmp(4) := ((((((op1(4) and op2(0)) xor (op1(3) and op2(1))) xor (op1(2) and op2(2))) xor (op1(1) and op2(3))) xor (op1(4) and op2(3))) xor (op1(0) and op2(4))) xor (op1(3) and op2(4));
69 VARIABLE tmp: (4 downto 0);
74 WHEN "00000" => tmp := "00000";
75 WHEN "00001" => tmp := "00001";
76 WHEN "00010" => tmp := "10010";
77 WHEN "00011" => tmp := "11100";
78 WHEN "00100" => tmp := "01001";
79 WHEN "00101" => tmp := "10111";
80 WHEN "00110" => tmp := "01110";
81 WHEN "00111" => tmp := "01100";
82 WHEN "01000" => tmp := "10110";
83 WHEN "01001" => tmp := "00100";
84 WHEN "01010" => tmp := "11001";
85 WHEN "01011" => tmp := "10000";
86 WHEN "01100" => tmp := "00111";
87 WHEN "01101" => tmp := "01111";
88 WHEN "01110" => tmp := "00110";
89 WHEN "01111" => tmp := "01101";
90 WHEN "10000" => tmp := "01011";
91 WHEN "10001" => tmp := "11000";
92 WHEN "10010" => tmp := "00010";
93 WHEN "10011" => tmp := "11101";
94 WHEN "10100" => tmp := "11110";
95 WHEN "10101" => tmp := "11010";
96 WHEN "10110" => tmp := "01000";
97 WHEN "10111" => tmp := "00101";
98 WHEN "11000" => tmp := "10001";
99 WHEN "11001" => tmp := "01010";
100 WHEN "11010" => tmp := "10101";
101 WHEN "11011" => tmp := "11111";
102 WHEN "11100" => tmp := "00011";
103 WHEN "11101" => tmp := "10011";
104 WHEN "11110" => tmp := "10100";
105 WHEN "11111" => tmp := "11011";
106 WHEN OTHERS => tmp := "00000";
116 VARIABLE tmp: (4 downto 0);
121 WHEN "00000" => tmp := "00000";
-- 0
122 WHEN "00001" => tmp := "00000";
-- 0
123 WHEN "00010" => tmp := "00001";
-- 1
124 WHEN "00011" => tmp := "10010";
-- 18
125 WHEN "00100" => tmp := "00010";
-- 2
126 WHEN "00101" => tmp := "00101";
-- 5
127 WHEN "00110" => tmp := "10011";
-- 19
128 WHEN "00111" => tmp := "01011";
-- 11
129 WHEN "01000" => tmp := "00011";
-- 3
130 WHEN "01001" => tmp := "11101";
-- 29
131 WHEN "01010" => tmp := "00110";
-- 6
132 WHEN "01011" => tmp := "11011";
-- 27
133 WHEN "01100" => tmp := "10100";
-- 20
134 WHEN "01101" => tmp := "01000";
-- 8
135 WHEN "01110" => tmp := "01100";
-- 12
136 WHEN "01111" => tmp := "10111";
-- 23
137 WHEN "10000" => tmp := "00100";
-- 4
138 WHEN "10001" => tmp := "01010";
-- 10
139 WHEN "10010" => tmp := "11110";
-- 30
140 WHEN "10011" => tmp := "10001";
-- 17
141 WHEN "10100" => tmp := "00111";
-- 7
142 WHEN "10101" => tmp := "10110";
-- 22
143 WHEN "10110" => tmp := "11100";
-- 28
144 WHEN "10111" => tmp := "11010";
-- 26
145 WHEN "11000" => tmp := "10101";
-- 21
146 WHEN "11001" => tmp := "11001";
-- 25
147 WHEN "11010" => tmp := "01001";
-- 9
148 WHEN "11011" => tmp := "10000";
-- 16
149 WHEN "11100" => tmp := "01101";
-- 13
150 WHEN "11101" => tmp := "01110";
-- 14
151 WHEN "11110" => tmp := "11000";
-- 24
152 WHEN "11111" => tmp := "01111";
-- 15
153 WHEN OTHERS => tmp := "00000";
160 SIGNAL msg : ((N*SYMB_BITWIDTH)-1 downto 0);
161 SIGNAL decMsg : ((K*SYMB_BITWIDTH)-1 downto 0);
163 SIGNAL outSt1 : ((SYMB_BITWIDTH-1) downto 0);
164 SIGNAL outSt2 : ((SYMB_BITWIDTH-1) downto 0);
165 SIGNAL outSt3 : ((SYMB_BITWIDTH-1) downto 0);
166 SIGNAL outSt4 : ((SYMB_BITWIDTH-1) downto 0);
167 SIGNAL outSt5 : ((SYMB_BITWIDTH-1) downto 0);
168 SIGNAL outSt6 : ((SYMB_BITWIDTH-1) downto 0);
169 SIGNAL outSt7 : ((SYMB_BITWIDTH-1) downto 0);
170 SIGNAL outSt8 : ((SYMB_BITWIDTH-1) downto 0);
171 SIGNAL outSt9 : ((SYMB_BITWIDTH-1) downto 0);
172 SIGNAL outSt10 : ((SYMB_BITWIDTH-1) downto 0);
173 SIGNAL outSt11 : ((SYMB_BITWIDTH-1) downto 0);
174 SIGNAL outSt12 : ((SYMB_BITWIDTH-1) downto 0);
175 SIGNAL outSt13 : ((SYMB_BITWIDTH-1) downto 0);
176 SIGNAL outSt14 : ((SYMB_BITWIDTH-1) downto 0);
177 SIGNAL outSt15 : ((SYMB_BITWIDTH-1) downto 0);
178 SIGNAL outSt16 : ((SYMB_BITWIDTH-1) downto 0);
179 SIGNAL outSt17 : ((SYMB_BITWIDTH-1) downto 0);
180 SIGNAL outSt18 : ((SYMB_BITWIDTH-1) downto 0);
181 SIGNAL outSt19 : ((SYMB_BITWIDTH-1) downto 0);
182 SIGNAL outSt20 : ((SYMB_BITWIDTH-1) downto 0);
183 SIGNAL outSt21 : ((SYMB_BITWIDTH-1) downto 0);
184 SIGNAL outSt22 : ((SYMB_BITWIDTH-1) downto 0);
185 SIGNAL outSt23 : ((SYMB_BITWIDTH-1) downto 0);
186 SIGNAL outSt24 : ((SYMB_BITWIDTH-1) downto 0);
187 SIGNAL outSt25 : ((SYMB_BITWIDTH-1) downto 0);
188 SIGNAL outSt26 : ((SYMB_BITWIDTH-1) downto 0);
189 SIGNAL outSt27 : ((SYMB_BITWIDTH-1) downto 0);
190 SIGNAL outSt28 : ((SYMB_BITWIDTH-1) downto 0);
191 SIGNAL outSt29 : ((SYMB_BITWIDTH-1) downto 0);
192 SIGNAL outAdd0 : ((SYMB_BITWIDTH-1) downto 0);
193 SIGNAL outAdd1 : ((SYMB_BITWIDTH-1) downto 0);
194 SIGNAL outAdd2 : ((SYMB_BITWIDTH-1) downto 0);
195 SIGNAL outAdd3 : ((SYMB_BITWIDTH-1) downto 0);
196 SIGNAL outAdd4 : ((SYMB_BITWIDTH-1) downto 0);
197 SIGNAL outAdd5 : ((SYMB_BITWIDTH-1) downto 0);
198 SIGNAL outAdd6 : ((SYMB_BITWIDTH-1) downto 0);
199 SIGNAL outAdd7 : ((SYMB_BITWIDTH-1) downto 0);
200 SIGNAL outAdd8 : ((SYMB_BITWIDTH-1) downto 0);
201 SIGNAL outAdd9 : ((SYMB_BITWIDTH-1) downto 0);
202 SIGNAL outAdd10 : ((SYMB_BITWIDTH-1) downto 0);
203 SIGNAL outAdd11 : ((SYMB_BITWIDTH-1) downto 0);
204 SIGNAL outAdd12 : ((SYMB_BITWIDTH-1) downto 0);
205 SIGNAL outAdd13 : ((SYMB_BITWIDTH-1) downto 0);
206 SIGNAL outAdd14 : ((SYMB_BITWIDTH-1) downto 0);
207 SIGNAL outAdd15 : ((SYMB_BITWIDTH-1) downto 0);
208 SIGNAL outAdd16 : ((SYMB_BITWIDTH-1) downto 0);
209 SIGNAL outAdd17 : ((SYMB_BITWIDTH-1) downto 0);
210 SIGNAL outAdd18 : ((SYMB_BITWIDTH-1) downto 0);
211 SIGNAL outAdd19 : ((SYMB_BITWIDTH-1) downto 0);
212 SIGNAL outAdd20 : ((SYMB_BITWIDTH-1) downto 0);
213 SIGNAL outAdd21 : ((SYMB_BITWIDTH-1) downto 0);
214 SIGNAL outAdd22 : ((SYMB_BITWIDTH-1) downto 0);
215 SIGNAL outAdd23 : ((SYMB_BITWIDTH-1) downto 0);
216 SIGNAL outAdd24 : ((SYMB_BITWIDTH-1) downto 0);
217 SIGNAL outAdd25 : ((SYMB_BITWIDTH-1) downto 0);
218 SIGNAL outAdd26 : ((SYMB_BITWIDTH-1) downto 0);
219 SIGNAL outAdd27 : ((SYMB_BITWIDTH-1) downto 0);
220 SIGNAL outAdd28 : ((SYMB_BITWIDTH-1) downto 0);
221 SIGNAL outMult0 : ((SYMB_BITWIDTH-1) downto 0);
222 SIGNAL outMult1 : ((SYMB_BITWIDTH-1) downto 0);
223 SIGNAL outMult2 : ((SYMB_BITWIDTH-1) downto 0);
224 SIGNAL outMult3 : ((SYMB_BITWIDTH-1) downto 0);
225 SIGNAL outMult4 : ((SYMB_BITWIDTH-1) downto 0);
226 SIGNAL outMult5 : ((SYMB_BITWIDTH-1) downto 0);
227 SIGNAL outMult6 : ((SYMB_BITWIDTH-1) downto 0);
228 SIGNAL outMult7 : ((SYMB_BITWIDTH-1) downto 0);
229 SIGNAL outMult8 : ((SYMB_BITWIDTH-1) downto 0);
230 SIGNAL outMult9 : ((SYMB_BITWIDTH-1) downto 0);
231 SIGNAL outMult10 : ((SYMB_BITWIDTH-1) downto 0);
232 SIGNAL outMult11 : ((SYMB_BITWIDTH-1) downto 0);
233 SIGNAL outMult12 : ((SYMB_BITWIDTH-1) downto 0);
234 SIGNAL outMult13 : ((SYMB_BITWIDTH-1) downto 0);
235 SIGNAL outMult14 : ((SYMB_BITWIDTH-1) downto 0);
236 SIGNAL outMult15 : ((SYMB_BITWIDTH-1) downto 0);
237 SIGNAL outMult16 : ((SYMB_BITWIDTH-1) downto 0);
238 SIGNAL outMult17 : ((SYMB_BITWIDTH-1) downto 0);
239 SIGNAL outMult18 : ((SYMB_BITWIDTH-1) downto 0);
240 SIGNAL outMult19 : ((SYMB_BITWIDTH-1) downto 0);
241 SIGNAL outMult20 : ((SYMB_BITWIDTH-1) downto 0);
242 SIGNAL outMult21 : ((SYMB_BITWIDTH-1) downto 0);
243 SIGNAL outMult22 : ((SYMB_BITWIDTH-1) downto 0);
244 SIGNAL outMult23 : ((SYMB_BITWIDTH-1) downto 0);
245 SIGNAL outMult24 : ((SYMB_BITWIDTH-1) downto 0);
246 SIGNAL outMult25 : ((SYMB_BITWIDTH-1) downto 0);
247 SIGNAL outMult26 : ((SYMB_BITWIDTH-1) downto 0);
248 SIGNAL outMult27 : ((SYMB_BITWIDTH-1) downto 0);
249 SIGNAL outMult28 : ((SYMB_BITWIDTH-1) downto 0);
250 SIGNAL outMult29 : ((SYMB_BITWIDTH-1) downto 0);
251 SIGNAL syndr0 : ((SYMB_BITWIDTH-1) downto 0);
252 SIGNAL syndr1 : ((SYMB_BITWIDTH-1) downto 0);
253 SIGNAL syndr0_inv : ((SYMB_BITWIDTH-1) downto 0);
254 SIGNAL syndrProd : ((SYMB_BITWIDTH-1) downto 0);
255 SIGNAL errorPos : ((SYMB_BITWIDTH-1) downto 0);
257 BEGIN --========#### Architecture Body ####========--
259 -- ---------------- The Parallel LFSR HDL description ---------------- --
264 -- Evaluates the first syndrom
265 outSt1 <= msg(((SYMB_BITWIDTH + 0)-1) downto 0) xor msg(((2*SYMB_BITWIDTH)-1) downto SYMB_BITWIDTH);
266 outSt2 <= msg(((SYMB_BITWIDTH + (2*SYMB_BITWIDTH)-1)) downto (2*SYMB_BITWIDTH)) xor outSt1;
267 outSt3 <= msg(((SYMB_BITWIDTH + (3*SYMB_BITWIDTH)-1)) downto (3*SYMB_BITWIDTH)) xor outSt2;
268 outSt4 <= msg(((SYMB_BITWIDTH + (4*SYMB_BITWIDTH)-1)) downto (4*SYMB_BITWIDTH)) xor outSt3;
269 outSt5 <= msg(((SYMB_BITWIDTH + (5*SYMB_BITWIDTH)-1)) downto (5*SYMB_BITWIDTH)) xor outSt4;
270 outSt6 <= msg(((SYMB_BITWIDTH + (6*SYMB_BITWIDTH)-1)) downto (6*SYMB_BITWIDTH)) xor outSt5;
271 outSt7 <= msg(((SYMB_BITWIDTH + (7*SYMB_BITWIDTH)-1)) downto (7*SYMB_BITWIDTH)) xor outSt6;
272 outSt8 <= msg(((SYMB_BITWIDTH + (8*SYMB_BITWIDTH)-1)) downto (8*SYMB_BITWIDTH)) xor outSt7;
273 outSt9 <= msg(((SYMB_BITWIDTH + (9*SYMB_BITWIDTH)-1)) downto (9*SYMB_BITWIDTH)) xor outSt8;
274 outSt10 <= msg(((SYMB_BITWIDTH + (10*SYMB_BITWIDTH)-1)) downto (10*SYMB_BITWIDTH)) xor outSt9;
275 outSt11 <= msg(((SYMB_BITWIDTH + (11*SYMB_BITWIDTH)-1)) downto (11*SYMB_BITWIDTH)) xor outSt10;
276 outSt12 <= msg(((SYMB_BITWIDTH + (12*SYMB_BITWIDTH)-1)) downto (12*SYMB_BITWIDTH)) xor outSt11;
277 outSt13 <= msg(((SYMB_BITWIDTH + (13*SYMB_BITWIDTH)-1)) downto (13*SYMB_BITWIDTH)) xor outSt12;
278 outSt14 <= msg(((SYMB_BITWIDTH + (14*SYMB_BITWIDTH)-1)) downto (14*SYMB_BITWIDTH)) xor outSt13;
279 outSt15 <= msg(((SYMB_BITWIDTH + (15*SYMB_BITWIDTH)-1)) downto (15*SYMB_BITWIDTH)) xor outSt14;
280 outSt16 <= msg(((SYMB_BITWIDTH + (16*SYMB_BITWIDTH)-1)) downto (16*SYMB_BITWIDTH)) xor outSt15;
281 outSt17 <= msg(((SYMB_BITWIDTH + (17*SYMB_BITWIDTH)-1)) downto (17*SYMB_BITWIDTH)) xor outSt16;
282 outSt18 <= msg(((SYMB_BITWIDTH + (18*SYMB_BITWIDTH)-1)) downto (18*SYMB_BITWIDTH)) xor outSt17;
283 outSt19 <= msg(((SYMB_BITWIDTH + (19*SYMB_BITWIDTH)-1)) downto (19*SYMB_BITWIDTH)) xor outSt18;
284 outSt20 <= msg(((SYMB_BITWIDTH + (20*SYMB_BITWIDTH)-1)) downto (20*SYMB_BITWIDTH)) xor outSt19;
285 outSt21 <= msg(((SYMB_BITWIDTH + (21*SYMB_BITWIDTH)-1)) downto (21*SYMB_BITWIDTH)) xor outSt20;
286 outSt22 <= msg(((SYMB_BITWIDTH + (22*SYMB_BITWIDTH)-1)) downto (22*SYMB_BITWIDTH)) xor outSt21;
287 outSt23 <= msg(((SYMB_BITWIDTH + (23*SYMB_BITWIDTH)-1)) downto (23*SYMB_BITWIDTH)) xor outSt22;
288 outSt24 <= msg(((SYMB_BITWIDTH + (24*SYMB_BITWIDTH)-1)) downto (24*SYMB_BITWIDTH)) xor outSt23;
289 outSt25 <= msg(((SYMB_BITWIDTH + (25*SYMB_BITWIDTH)-1)) downto (25*SYMB_BITWIDTH)) xor outSt24;
290 outSt26 <= msg(((SYMB_BITWIDTH + (26*SYMB_BITWIDTH)-1)) downto (26*SYMB_BITWIDTH)) xor outSt25;
291 outSt27 <= msg(((SYMB_BITWIDTH + (27*SYMB_BITWIDTH)-1)) downto (27*SYMB_BITWIDTH)) xor outSt26;
292 outSt28 <= msg(((SYMB_BITWIDTH + (28*SYMB_BITWIDTH)-1)) downto (28*SYMB_BITWIDTH)) xor outSt27;
293 outSt29 <= msg(((SYMB_BITWIDTH + (29*SYMB_BITWIDTH)-1)) downto (29*SYMB_BITWIDTH)) xor outSt28;
294 syndr0 <= msg(((SYMB_BITWIDTH + (30*SYMB_BITWIDTH)-1)) downto (30*SYMB_BITWIDTH)) xor outSt29;
296 -- Evaluates the second syndrom
297 outMult0 <= gf_multBy2_5(msg(SYMB_BITWIDTH-1 downto 0));
298 outMult1 <= gf_multBy2_5(outAdd0);
299 outMult2 <= gf_multBy2_5(outAdd1);
300 outMult3 <= gf_multBy2_5(outAdd2);
301 outMult4 <= gf_multBy2_5(outAdd3);
302 outMult5 <= gf_multBy2_5(outAdd4);
303 outMult6 <= gf_multBy2_5(outAdd5);
304 outMult7 <= gf_multBy2_5(outAdd6);
305 outMult8 <= gf_multBy2_5(outAdd7);
306 outMult9 <= gf_multBy2_5(outAdd8);
307 outMult10 <= gf_multBy2_5(outAdd9);
308 outMult11 <= gf_multBy2_5(outAdd10);
309 outMult12 <= gf_multBy2_5(outAdd11);
310 outMult13 <= gf_multBy2_5(outAdd12);
311 outMult14 <= gf_multBy2_5(outAdd13);
312 outMult15 <= gf_multBy2_5(outAdd14);
313 outMult16 <= gf_multBy2_5(outAdd15);
314 outMult17 <= gf_multBy2_5(outAdd16);
315 outMult18 <= gf_multBy2_5(outAdd17);
316 outMult19 <= gf_multBy2_5(outAdd18);
317 outMult20 <= gf_multBy2_5(outAdd19);
318 outMult21 <= gf_multBy2_5(outAdd20);
319 outMult22 <= gf_multBy2_5(outAdd21);
320 outMult23 <= gf_multBy2_5(outAdd22);
321 outMult24 <= gf_multBy2_5(outAdd23);
322 outMult25 <= gf_multBy2_5(outAdd24);
323 outMult26 <= gf_multBy2_5(outAdd25);
324 outMult27 <= gf_multBy2_5(outAdd26);
325 outMult28 <= gf_multBy2_5(outAdd27);
326 outMult29 <= gf_multBy2_5(outAdd28);
328 outAdd0 <= outMult0 xor msg(((SYMB_BITWIDTH+SYMB_BITWIDTH)-1) downto SYMB_BITWIDTH);
329 outAdd1 <= outMult1 xor msg(((SYMB_BITWIDTH+2*SYMB_BITWIDTH)-1) downto (2*SYMB_BITWIDTH));
330 outAdd2 <= outMult2 xor msg(((SYMB_BITWIDTH+3*SYMB_BITWIDTH)-1) downto (3*SYMB_BITWIDTH));
331 outAdd3 <= outMult3 xor msg(((SYMB_BITWIDTH+4*SYMB_BITWIDTH)-1) downto (4*SYMB_BITWIDTH));
332 outAdd4 <= outMult4 xor msg(((SYMB_BITWIDTH+5*SYMB_BITWIDTH)-1) downto (5*SYMB_BITWIDTH));
333 outAdd5 <= outMult5 xor msg(((SYMB_BITWIDTH+6*SYMB_BITWIDTH)-1) downto (6*SYMB_BITWIDTH));
334 outAdd6 <= outMult6 xor msg(((SYMB_BITWIDTH+7*SYMB_BITWIDTH)-1) downto (7*SYMB_BITWIDTH));
335 outAdd7 <= outMult7 xor msg(((SYMB_BITWIDTH+8*SYMB_BITWIDTH)-1) downto (8*SYMB_BITWIDTH));
336 outAdd8 <= outMult8 xor msg(((SYMB_BITWIDTH+9*SYMB_BITWIDTH)-1) downto (9*SYMB_BITWIDTH));
337 outAdd9 <= outMult9 xor msg(((SYMB_BITWIDTH+10*SYMB_BITWIDTH)-1) downto (10*SYMB_BITWIDTH));
338 outAdd10 <= outMult10 xor msg(((SYMB_BITWIDTH+11*SYMB_BITWIDTH)-1) downto (11*SYMB_BITWIDTH));
339 outAdd11 <= outMult11 xor msg(((SYMB_BITWIDTH+12*SYMB_BITWIDTH)-1) downto (12*SYMB_BITWIDTH));
340 outAdd12 <= outMult12 xor msg(((SYMB_BITWIDTH+13*SYMB_BITWIDTH)-1) downto (13*SYMB_BITWIDTH));
341 outAdd13 <= outMult13 xor msg(((SYMB_BITWIDTH+14*SYMB_BITWIDTH)-1) downto (14*SYMB_BITWIDTH));
342 outAdd14 <= outMult14 xor msg(((SYMB_BITWIDTH+15*SYMB_BITWIDTH)-1) downto (15*SYMB_BITWIDTH));
343 outAdd15 <= outMult15 xor msg(((SYMB_BITWIDTH+16*SYMB_BITWIDTH)-1) downto (16*SYMB_BITWIDTH));
344 outAdd16 <= outMult16 xor msg(((SYMB_BITWIDTH+17*SYMB_BITWIDTH)-1) downto (17*SYMB_BITWIDTH));
345 outAdd17 <= outMult17 xor msg(((SYMB_BITWIDTH+18*SYMB_BITWIDTH)-1) downto (18*SYMB_BITWIDTH));
346 outAdd18 <= outMult18 xor msg(((SYMB_BITWIDTH+19*SYMB_BITWIDTH)-1) downto (19*SYMB_BITWIDTH));
347 outAdd19 <= outMult19 xor msg(((SYMB_BITWIDTH+20*SYMB_BITWIDTH)-1) downto (20*SYMB_BITWIDTH));
348 outAdd20 <= outMult20 xor msg(((SYMB_BITWIDTH+21*SYMB_BITWIDTH)-1) downto (21*SYMB_BITWIDTH));
349 outAdd21 <= outMult21 xor msg(((SYMB_BITWIDTH+22*SYMB_BITWIDTH)-1) downto (22*SYMB_BITWIDTH));
350 outAdd22 <= outMult22 xor msg(((SYMB_BITWIDTH+23*SYMB_BITWIDTH)-1) downto (23*SYMB_BITWIDTH));
351 outAdd23 <= outMult23 xor msg(((SYMB_BITWIDTH+24*SYMB_BITWIDTH)-1) downto (24*SYMB_BITWIDTH));
352 outAdd24 <= outMult24 xor msg(((SYMB_BITWIDTH+25*SYMB_BITWIDTH)-1) downto (25*SYMB_BITWIDTH));
353 outAdd25 <= outMult25 xor msg(((SYMB_BITWIDTH+26*SYMB_BITWIDTH)-1) downto (26*SYMB_BITWIDTH));
354 outAdd26 <= outMult26 xor msg(((SYMB_BITWIDTH+27*SYMB_BITWIDTH)-1) downto (27*SYMB_BITWIDTH));
355 outAdd27 <= outMult27 xor msg(((SYMB_BITWIDTH+28*SYMB_BITWIDTH)-1) downto (28*SYMB_BITWIDTH));
356 outAdd28 <= outMult28 xor msg(((SYMB_BITWIDTH+29*SYMB_BITWIDTH)-1) downto (29*SYMB_BITWIDTH));
357 syndr1 <= outMult29 xor msg(((SYMB_BITWIDTH+30*SYMB_BITWIDTH)-1) downto (30*SYMB_BITWIDTH));
359 -- Evaluates position of error
360 syndr0_inv <= gf_inv_5(syndr0);
361 syndrProd <= gf_mult_5(syndr0_inv, syndr1);
362 errorPos <= gf_log_5(syndrProd);
364 -- Correct message.. Correction on parity bits is ignored!
365 decMsg(((SYMB_BITWIDTH+28*SYMB_BITWIDTH)-1) downto (28*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+28*SYMB_BITWIDTH)-1) downto (28*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00010" ELSE
366 msg(((SYMB_BITWIDTH+28*SYMB_BITWIDTH)-1) downto (28*SYMB_BITWIDTH));
368 decMsg(((SYMB_BITWIDTH+27*SYMB_BITWIDTH)-1) downto (27*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+27*SYMB_BITWIDTH)-1) downto (27*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00011" ELSE
369 msg(((SYMB_BITWIDTH+27*SYMB_BITWIDTH)-1) downto (27*SYMB_BITWIDTH));
371 decMsg(((SYMB_BITWIDTH+26*SYMB_BITWIDTH)-1) downto (26*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+26*SYMB_BITWIDTH)-1) downto (26*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00100" ELSE
372 msg(((SYMB_BITWIDTH+26*SYMB_BITWIDTH)-1) downto (26*SYMB_BITWIDTH));
374 decMsg(((SYMB_BITWIDTH+25*SYMB_BITWIDTH)-1) downto (25*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+25*SYMB_BITWIDTH)-1) downto (25*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00101" ELSE
375 msg(((SYMB_BITWIDTH+25*SYMB_BITWIDTH)-1) downto (25*SYMB_BITWIDTH));
377 decMsg(((SYMB_BITWIDTH+24*SYMB_BITWIDTH)-1) downto (24*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+24*SYMB_BITWIDTH)-1) downto (24*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00110" ELSE
378 msg(((SYMB_BITWIDTH+24*SYMB_BITWIDTH)-1) downto (24*SYMB_BITWIDTH));
380 decMsg(((SYMB_BITWIDTH+23*SYMB_BITWIDTH)-1) downto (23*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+23*SYMB_BITWIDTH)-1) downto (23*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "00111" ELSE
381 msg(((SYMB_BITWIDTH+23*SYMB_BITWIDTH)-1) downto (23*SYMB_BITWIDTH));
383 decMsg(((SYMB_BITWIDTH+22*SYMB_BITWIDTH)-1) downto (22*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+22*SYMB_BITWIDTH)-1) downto (22*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01000" ELSE
384 msg(((SYMB_BITWIDTH+22*SYMB_BITWIDTH)-1) downto (22*SYMB_BITWIDTH));
386 decMsg(((SYMB_BITWIDTH+21*SYMB_BITWIDTH)-1) downto (21*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+21*SYMB_BITWIDTH)-1) downto (21*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01001" ELSE
387 msg(((SYMB_BITWIDTH+21*SYMB_BITWIDTH)-1) downto (21*SYMB_BITWIDTH));
389 decMsg(((SYMB_BITWIDTH+20*SYMB_BITWIDTH)-1) downto (20*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+20*SYMB_BITWIDTH)-1) downto (20*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01010" ELSE
390 msg(((SYMB_BITWIDTH+20*SYMB_BITWIDTH)-1) downto (20*SYMB_BITWIDTH));
392 decMsg(((SYMB_BITWIDTH+19*SYMB_BITWIDTH)-1) downto (19*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+19*SYMB_BITWIDTH)-1) downto (19*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01011" ELSE
393 msg(((SYMB_BITWIDTH+19*SYMB_BITWIDTH)-1) downto (19*SYMB_BITWIDTH));
395 decMsg(((SYMB_BITWIDTH+18*SYMB_BITWIDTH)-1) downto (18*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+18*SYMB_BITWIDTH)-1) downto (18*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01100" ELSE
396 msg(((SYMB_BITWIDTH+18*SYMB_BITWIDTH)-1) downto (18*SYMB_BITWIDTH));
398 decMsg(((SYMB_BITWIDTH+17*SYMB_BITWIDTH)-1) downto (17*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+17*SYMB_BITWIDTH)-1) downto (17*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01101" ELSE
399 msg(((SYMB_BITWIDTH+17*SYMB_BITWIDTH)-1) downto (17*SYMB_BITWIDTH));
401 decMsg(((SYMB_BITWIDTH+16*SYMB_BITWIDTH)-1) downto (16*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+16*SYMB_BITWIDTH)-1) downto (16*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01110" ELSE
402 msg(((SYMB_BITWIDTH+16*SYMB_BITWIDTH)-1) downto (16*SYMB_BITWIDTH));
404 decMsg(((SYMB_BITWIDTH+15*SYMB_BITWIDTH)-1) downto (15*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+15*SYMB_BITWIDTH)-1) downto (15*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "01111" ELSE
405 msg(((SYMB_BITWIDTH+15*SYMB_BITWIDTH)-1) downto (15*SYMB_BITWIDTH));
407 decMsg(((SYMB_BITWIDTH+14*SYMB_BITWIDTH)-1) downto (14*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+14*SYMB_BITWIDTH)-1) downto (14*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10000" ELSE
408 msg(((SYMB_BITWIDTH+14*SYMB_BITWIDTH)-1) downto (14*SYMB_BITWIDTH));
410 decMsg(((SYMB_BITWIDTH+13*SYMB_BITWIDTH)-1) downto (13*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+13*SYMB_BITWIDTH)-1) downto (13*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10001" ELSE
411 msg(((SYMB_BITWIDTH+13*SYMB_BITWIDTH)-1) downto (13*SYMB_BITWIDTH));
413 decMsg(((SYMB_BITWIDTH+12*SYMB_BITWIDTH)-1) downto (12*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+12*SYMB_BITWIDTH)-1) downto (12*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10010" ELSE
414 msg(((SYMB_BITWIDTH+12*SYMB_BITWIDTH)-1) downto (12*SYMB_BITWIDTH));
416 decMsg(((SYMB_BITWIDTH+11*SYMB_BITWIDTH)-1) downto (11*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+11*SYMB_BITWIDTH)-1) downto (11*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10011" ELSE
417 msg(((SYMB_BITWIDTH+11*SYMB_BITWIDTH)-1) downto (11*SYMB_BITWIDTH));
419 decMsg(((SYMB_BITWIDTH+10*SYMB_BITWIDTH)-1) downto (10*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+10*SYMB_BITWIDTH)-1) downto (10*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10100" ELSE
420 msg(((SYMB_BITWIDTH+10*SYMB_BITWIDTH)-1) downto (10*SYMB_BITWIDTH));
422 decMsg(((SYMB_BITWIDTH+9*SYMB_BITWIDTH)-1) downto (9*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+9*SYMB_BITWIDTH)-1) downto (9*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10101" ELSE
423 msg(((SYMB_BITWIDTH+9*SYMB_BITWIDTH)-1) downto (9*SYMB_BITWIDTH));
425 decMsg(((SYMB_BITWIDTH+8*SYMB_BITWIDTH)-1) downto (8*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+8*SYMB_BITWIDTH)-1) downto (8*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10110" ELSE
426 msg(((SYMB_BITWIDTH+8*SYMB_BITWIDTH)-1) downto (8*SYMB_BITWIDTH));
428 decMsg(((SYMB_BITWIDTH+7*SYMB_BITWIDTH)-1) downto (7*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+7*SYMB_BITWIDTH)-1) downto (7*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "10111" ELSE
429 msg(((SYMB_BITWIDTH+7*SYMB_BITWIDTH)-1) downto (7*SYMB_BITWIDTH));
431 decMsg(((SYMB_BITWIDTH+6*SYMB_BITWIDTH)-1) downto (6*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+6*SYMB_BITWIDTH)-1) downto (6*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11000" ELSE
432 msg(((SYMB_BITWIDTH+6*SYMB_BITWIDTH)-1) downto (6*SYMB_BITWIDTH));
434 decMsg(((SYMB_BITWIDTH+5*SYMB_BITWIDTH)-1) downto (5*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+5*SYMB_BITWIDTH)-1) downto (5*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11001" ELSE
435 msg(((SYMB_BITWIDTH+5*SYMB_BITWIDTH)-1) downto (5*SYMB_BITWIDTH));
437 decMsg(((SYMB_BITWIDTH+4*SYMB_BITWIDTH)-1) downto (4*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+4*SYMB_BITWIDTH)-1) downto (4*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11010" ELSE
438 msg(((SYMB_BITWIDTH+4*SYMB_BITWIDTH)-1) downto (4*SYMB_BITWIDTH));
440 decMsg(((SYMB_BITWIDTH+3*SYMB_BITWIDTH)-1) downto (3*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+3*SYMB_BITWIDTH)-1) downto (3*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11011" ELSE
441 msg(((SYMB_BITWIDTH+3*SYMB_BITWIDTH)-1) downto (3*SYMB_BITWIDTH));
443 decMsg(((SYMB_BITWIDTH+2*SYMB_BITWIDTH)-1) downto (2*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+2*SYMB_BITWIDTH)-1) downto (2*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11100" ELSE
444 msg(((SYMB_BITWIDTH+2*SYMB_BITWIDTH)-1) downto (2*SYMB_BITWIDTH));
446 decMsg(((SYMB_BITWIDTH+1*SYMB_BITWIDTH)-1) downto (1*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+1*SYMB_BITWIDTH)-1) downto (1*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11101" ELSE
447 msg(((SYMB_BITWIDTH+1*SYMB_BITWIDTH)-1) downto (1*SYMB_BITWIDTH));
449 decMsg(((SYMB_BITWIDTH+0*SYMB_BITWIDTH)-1) downto (0*SYMB_BITWIDTH)) <= msg(((SYMB_BITWIDTH+0*SYMB_BITWIDTH)-1) downto (0*SYMB_BITWIDTH)) xor syndr0 WHEN errorPos = "11110" ELSE
450 msg(((SYMB_BITWIDTH+0*SYMB_BITWIDTH)-1) downto (0*SYMB_BITWIDTH));
455 --=================================================================================================--
456 --#################################################################################################--
457 --=================================================================================================--
in payloadData_istd_logic_vector%(%(K%*%SYMB_BITWIDTH)%-%1%%%downto%%%0%)
Message to be decoded.
in fecData_istd_logic_vector%(%((N%-%K)%*%SYMB_BITWIDTH)%-%1%%%downto%%%0%)
FEC USEd to decode.
rs_decoder_N31K29 - N31K29 Reed-Solomon decoder
out data_ostd_logic_vector%(%(K%*%SYMB_BITWIDTH)%-%1%%%downto%%%0%)
Decoded / corrected data.
_library_ ieeeieee
Include the IEEE VHDL standard LIBRARY.