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/] [xilinx/] [analyze.vhdl] - Blame information for rev 14

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

Line No. Rev Author Line
1 9 arif_endro
-- $Id: analyze.vhdl,v 1.1 2006-01-16 03:40:22 arif_endro Exp $
2
-------------------------------------------------------------------------------
3
-- Title       :
4
-- Project     : 
5
-------------------------------------------------------------------------------
6
-- File        :
7
-- Author      : "Arif E. Nugroho" <arif_endro@yahoo.com>
8
-- Created     : 2005/12/19
9
-- Last update : 
10
-- Simulators  :
11
-- Synthesizers: ISE Xilinx 6.3i
12
-- Target      : 
13
-------------------------------------------------------------------------------
14
-- Description : 
15
-------------------------------------------------------------------------------
16 14 arif_endro
-- Copyright (C) 2005 Arif Endro Nugroho
17 9 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
use ieee.std_logic_arith.all;
42
use ieee.std_logic_unsigned.all;
43
 
44
entity analyze is
45
   port (
46
      clear   : in  bit;
47
      start   : in  bit;
48
      match   : in  bit_vector (3 downto 0);
49
      col_0   : out integer;
50
      col_1   : out integer;
51
      col_2   : out integer;
52
      col_3   : out integer;
53
      result  : out integer
54
      );
55
end analyze;
56
 
57
architecture analyzer of analyze is
58
 
59
signal col_0_int  : integer range 0 to 19999;
60
signal col_1_int  : integer range 0 to 19999;
61
signal col_2_int  : integer range 0 to 19999;
62
signal col_3_int  : integer range 0 to 19999;
63
signal result_int : integer range 0 to 19999;
64
 
65
begin
66
 
67
process (start,clear)
68
begin
69
 
70
if (clear = '1') then
71
   col_0_int  <= 0;
72
   col_1_int  <= 0;
73
   col_2_int  <= 0;
74
   col_3_int  <= 0;
75
   result_int <= 0;
76
-- sample at rising edge then show the result at falling edge.
77
elsif (start = '1' and start'event) then
78
   if (match(0) = '0') then
79
      if (col_0_int < 19999) then
80
         col_0_int <= col_0_int + 1;
81
      else
82
         col_0_int <= 0;
83
      end if;
84
   end if;
85
   if (match(1) = '0') then
86
      if (col_1_int < 19999) then
87
         col_1_int <= col_1_int + 1;
88
      else
89
         col_1_int <= 0;
90
      end if;
91
   end if;
92
   if (match(2) = '0') then
93
      if (col_2_int < 19999) then
94
         col_2_int <= col_2_int + 1;
95
      else
96
         col_2_int <= 0;
97
      end if;
98
   end if;
99
   if (match(3) = '0') then
100
      if (col_3_int < 19999) then
101
         col_3_int <= col_3_int + 1;
102
      else
103
         col_3_int <= 0;
104
      end if;
105
   end if;
106
end if;
107
 
108
result_int <= col_0_int + col_1_int + col_2_int + col_3_int;
109
 
110
end process;
111
 
112
result   <= result_int;
113
col_0    <= col_0_int;
114
col_1    <= col_1_int;
115
col_2    <= col_2_int;
116
col_3    <= col_3_int;
117
 
118
end analyzer;

powered by: WebSVN 2.1.0

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