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/] [tags/] [INITIAL/] [source/] [product_code.vhdl] - Blame information for rev 12

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

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

powered by: WebSVN 2.1.0

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