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

Subversion Repositories product_code_iterative_decoder

[/] [product_code_iterative_decoder/] [trunk/] [source/] [product_code.vhdl] - Blame information for rev 14

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 arif_endro
-- $Id: product_code.vhdl,v 1.2 2005-12-26 04:32:32 arif_endro Exp $
2 2 arif_endro
-------------------------------------------------------------------------------
3
-- Title       : Product Code Iterative Decoder
4
-- Project     : 
5
-------------------------------------------------------------------------------
6
-- File        : product_code.vhdl
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2005/11/01
9
-- Last update : 
10
-- Simulators  :
11
-- Synthesizers: 
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : Connector of all component in Product Code Iterative Decoder.
15
-------------------------------------------------------------------------------
16 14 arif_endro
-- Copyright (C) 2005 Arif Endro Nugroho
17 2 arif_endro
-------------------------------------------------------------------------------
18
-- 
19
--      THIS SOURCE FILE MAY BE USED AND DISTRIBUTED WITHOUT RESTRICTION
20
-- PROVIDED THAT THIS COPYRIGHT STATEMENT IS NOT REMOVED FROM THE FILE AND THAT
21
-- ANY DERIVATIVE WORK CONTAINS THE ORIGINAL COPYRIGHT NOTICE AND THE
22
-- ASSOCIATED DISCLAIMER.
23
-- 
24
-------------------------------------------------------------------------------
25
-- 
26
--      THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27
-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
29
-- EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
-- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32
-- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34
-- OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35
-- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
-- 
37
-------------------------------------------------------------------------------
38
 
39
library IEEE;
40
use IEEE.std_logic_1164.all;
41
 
42
entity product_code is
43
   port (
44
     clock   : in  bit;
45
     start   : in  bit;
46
     rxin    : in  bit_vector (07 downto 00);
47
     y0d     : out bit;
48
     y1d     : out bit;
49
     y2d     : out bit;
50
     y3d     : out bit
51
     );
52
end product_code;
53
 
54
architecture structural of product_code is
55
 
56
   component ser2par8bit
57
      port (
58
         clock : in  bit;
59
         clear : in  bit;
60
         start : in  bit;
61
         rxin  : in  bit_vector (07 downto 00);
62
         y0    : out bit_vector (07 downto 00);
63
         y1    : out bit_vector (07 downto 00);
64
         y2    : out bit_vector (07 downto 00);
65
         y3    : out bit_vector (07 downto 00);
66
         r0    : out bit_vector (07 downto 00);
67
         r1    : out bit_vector (07 downto 00);
68
         c0    : out bit_vector (07 downto 00);
69
         c1    : out bit_vector (07 downto 00)
70
         );
71
   end component;
72
 
73
   component ext_val
74
      port (
75
         ext_a_i : in  bit_vector (07 downto 00);
76
         ext_b_i : in  bit_vector (07 downto 00);
77
         ext_r_o : out bit_vector (07 downto 00)
78
         );
79
   end component;
80
 
81
   component adder_08bit
82
      port (
83
         addend_08bit   : in  bit_vector (07 downto 00);
84
         augend_08bit   : in  bit_vector (07 downto 00);
85
         adder08_output : out bit_vector (08 downto 00)
86
         );
87
   end component;
88
 
89
   signal y0e : bit_vector (07 downto 00);
90
   signal y1e : bit_vector (07 downto 00);
91
   signal y2e : bit_vector (07 downto 00);
92
   signal y3e : bit_vector (07 downto 00);
93
 
94
   signal y0 : bit_vector (07 downto 00);
95
   signal y1 : bit_vector (07 downto 00);
96
   signal y2 : bit_vector (07 downto 00);
97
   signal y3 : bit_vector (07 downto 00);
98
   signal r0 : bit_vector (07 downto 00);
99
   signal r1 : bit_vector (07 downto 00);
100
   signal c0 : bit_vector (07 downto 00);
101
   signal c1 : bit_vector (07 downto 00);
102
 
103
   signal ext_b_c_0_b : bit_vector (08 downto 00);
104
   signal ext_b_c_1_b : bit_vector (08 downto 00);
105
   signal ext_b_c_2_b : bit_vector (08 downto 00);
106
   signal ext_b_c_3_b : bit_vector (08 downto 00);
107
 
108
   signal augend_sum_c_0 : bit_vector (07 downto 00);
109
   signal augend_sum_c_1 : bit_vector (07 downto 00);
110
   signal augend_sum_c_2 : bit_vector (07 downto 00);
111
   signal augend_sum_c_3 : bit_vector (07 downto 00);
112
 
113
   signal ext_r_r_0 : bit_vector (07 downto 00);
114
   signal ext_r_r_1 : bit_vector (07 downto 00);
115
   signal ext_r_r_2 : bit_vector (07 downto 00);
116
   signal ext_r_r_3 : bit_vector (07 downto 00);
117
 
118
   signal ext_b_r_0_b : bit_vector (08 downto 00);
119
   signal ext_b_r_1_b : bit_vector (08 downto 00);
120
   signal ext_b_r_2_b : bit_vector (08 downto 00);
121
   signal ext_b_r_3_b : bit_vector (08 downto 00);
122
 
123
   signal ext_b_r_0 : bit_vector (07 downto 00);
124
   signal ext_b_r_1 : bit_vector (07 downto 00);
125
   signal ext_b_r_2 : bit_vector (07 downto 00);
126
   signal ext_b_r_3 : bit_vector (07 downto 00);
127
 
128
   signal ext_r_c_0 : bit_vector (07 downto 00);
129
   signal ext_r_c_1 : bit_vector (07 downto 00);
130
   signal ext_r_c_2 : bit_vector (07 downto 00);
131
   signal ext_r_c_3 : bit_vector (07 downto 00);
132
 
133
   signal ext_b_c_0 : bit_vector (07 downto 00);
134
   signal ext_b_c_1 : bit_vector (07 downto 00);
135
   signal ext_b_c_2 : bit_vector (07 downto 00);
136
   signal ext_b_c_3 : bit_vector (07 downto 00);
137
 
138
   signal y0p_b : bit_vector (08 downto 00);
139
   signal y1p_b : bit_vector (08 downto 00);
140
   signal y2p_b : bit_vector (08 downto 00);
141
   signal y3p_b : bit_vector (08 downto 00);
142
 
143
   signal y0p : bit;
144
   signal y1p : bit;
145
   signal y2p : bit;
146
   signal y3p : bit;
147
 
148
   constant gnd : bit := '0';
149
 
150
begin
151
 
152
ext_b_c_0 (07 downto 00) <= ext_b_c_0_b (07 downto 00);
153
ext_b_c_1 (07 downto 00) <= ext_b_c_1_b (07 downto 00);
154
ext_b_c_2 (07 downto 00) <= ext_b_c_2_b (07 downto 00);
155
ext_b_c_3 (07 downto 00) <= ext_b_c_3_b (07 downto 00);
156
 
157
ext_b_r_0 (07 downto 00) <= ext_b_r_0_b (07 downto 00);
158
ext_b_r_1 (07 downto 00) <= ext_b_r_1_b (07 downto 00);
159
ext_b_r_2 (07 downto 00) <= ext_b_r_2_b (07 downto 00);
160
ext_b_r_3 (07 downto 00) <= ext_b_r_3_b (07 downto 00);
161
 
162
first : ser2par8bit
163
   port map (
164
      clock => clock,
165
      clear => gnd,
166
      start => start,
167
      rxin  => rxin,
168
      y0    => y0,
169
      y1    => y1,
170
      y2    => y2,
171
      y3    => y3,
172
      r0    => r0,
173
      r1    => r1,
174
      c0    => c0,
175
      c1    => c1
176
      );
177
 
178
sum_r_0 : adder_08bit
179
   port map (
180
      addend_08bit   => y0,
181
      augend_08bit   => y0e,
182
      adder08_output => ext_b_r_1_b
183
      );
184
 
185
sum_r_1 : adder_08bit
186
   port map (
187
      addend_08bit   => y1,
188
      augend_08bit   => y1e,
189
      adder08_output => ext_b_r_0_b
190
      );
191
 
192
sum_r_2 : adder_08bit
193
   port map (
194
      addend_08bit   => y2,
195
      augend_08bit   => y2e,
196
      adder08_output => ext_b_r_3_b
197
      );
198
 
199
sum_r_3 : adder_08bit
200
   port map (
201
      addend_08bit   => y3,
202
      augend_08bit   => y3e,
203
      adder08_output => ext_b_r_2_b
204
      );
205
 
206
sum_c_0 : adder_08bit
207
   port map (
208
      addend_08bit   => y0,
209
      augend_08bit   => augend_sum_c_0,
210
      adder08_output => ext_b_c_2_b
211
      );
212
 
213
sum_c_1 : adder_08bit
214
   port map (
215
      addend_08bit   => y1,
216
      augend_08bit   => augend_sum_c_1,
217
      adder08_output => ext_b_c_3_b
218
      );
219
 
220
sum_c_2 : adder_08bit
221
   port map (
222
      addend_08bit   => y2,
223
      augend_08bit   => augend_sum_c_2,
224
      adder08_output => ext_b_c_0_b
225
      );
226
 
227
sum_c_3 : adder_08bit
228
   port map (
229
      addend_08bit   => y3,
230
      augend_08bit   => augend_sum_c_3,
231
      adder08_output => ext_b_c_1_b
232
      );
233
 
234
sum_p_0 : adder_08bit
235
   port map (
236
      addend_08bit   => ext_b_r_1,
237
      augend_08bit   => ext_r_r_0,
238
      adder08_output => y0p_b
239
      );
240
 
241
sum_p_1 : adder_08bit
242
   port map (
243
      addend_08bit   => ext_b_r_0,
244
      augend_08bit   => ext_r_r_1,
245
      adder08_output => y1p_b
246
      );
247
 
248
sum_p_2 : adder_08bit
249
   port map (
250
      addend_08bit   => ext_b_r_3,
251
      augend_08bit   => ext_r_r_2,
252
      adder08_output => y2p_b
253
      );
254
 
255
sum_p_3 : adder_08bit
256
   port map (
257
      addend_08bit   => ext_b_r_2,
258
      augend_08bit   => ext_r_r_3,
259
      adder08_output => y3p_b
260
      );
261
 
262
row0 : ext_val
263
   port map (
264
      ext_a_i => r0,
265
      ext_b_i => ext_b_r_0,
266
      ext_r_o => ext_r_r_0
267
      );
268
 
269
row1 : ext_val
270
   port map (
271
      ext_a_i => r0,
272
      ext_b_i => ext_b_r_1,
273
      ext_r_o => ext_r_r_1
274
      );
275
 
276
row2 : ext_val
277
   port map (
278
      ext_a_i => r1,
279
      ext_b_i => ext_b_r_2,
280
      ext_r_o => ext_r_r_2
281
      );
282
 
283
row3 : ext_val
284
   port map (
285
      ext_a_i => r1,
286
      ext_b_i => ext_b_r_3,
287
      ext_r_o => ext_r_r_3
288
      );
289
 
290
col0 : ext_val
291
   port map (
292
      ext_a_i => c0,
293
      ext_b_i => ext_b_c_0,
294
      ext_r_o => ext_r_c_0
295
      );
296
 
297
col1 : ext_val
298
   port map (
299
      ext_a_i => c1,
300
      ext_b_i => ext_b_c_1,
301
      ext_r_o => ext_r_c_1
302
      );
303
 
304
col2 : ext_val
305
   port map (
306
      ext_a_i => c0,
307
      ext_b_i => ext_b_c_2,
308
      ext_r_o => ext_r_c_2
309
      );
310
 
311
col3 : ext_val
312
   port map (
313
      ext_a_i => c1,
314
      ext_b_i => ext_b_c_3,
315
      ext_r_o => ext_r_c_3
316
      );
317
 
318
process (start)
319
begin
320
   if (start = '1' and start'event) then
321
 
322 4 arif_endro
      y0p <= y0p_b (08);
323
      y1p <= y1p_b (08);
324
      y2p <= y2p_b (08);
325
      y3p <= y3p_b (08);
326 2 arif_endro
 
327
   end if;
328
end process;
329
 
330
process (start)
331
begin
332
   if (start = '0' and start'event) then
333
 
334
      y0d <= y0p;
335
      y1d <= y1p;
336
      y2d <= y2p;
337
      y3d <= y3p;
338
 
339
   end if;
340
end process;
341
 
342
process (clock, start)
343
begin
344
 
345
   if (clock = '0' and clock'event) then
346
 
347
      if (start = '1') then
348
         y0e <= ( others => '0' );
349
         y1e <= ( others => '0' );
350
         y2e <= ( others => '0' );
351
         y3e <= ( others => '0' );
352
 
353
         augend_sum_c_0 <= ( others => '0' );
354
         augend_sum_c_1 <= ( others => '0' );
355
         augend_sum_c_2 <= ( others => '0' );
356
         augend_sum_c_3 <= ( others => '0' );
357
      else
358
         y0e <= ext_r_c_0;
359
         y1e <= ext_r_c_1;
360
         y2e <= ext_r_c_2;
361
         y3e <= ext_r_c_3;
362
 
363
         augend_sum_c_0 <= ext_r_r_0;
364
         augend_sum_c_1 <= ext_r_r_1;
365
         augend_sum_c_2 <= ext_r_r_2;
366
         augend_sum_c_3 <= ext_r_r_3;
367
      end if;
368
 
369
   end if;
370
end process;
371
 
372
end structural;

powered by: WebSVN 2.1.0

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