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 10

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
-- 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
use ieee.std_logic_arith.all;
45
use ieee.std_logic_unsigned.all;
46
 
47
entity analyze is
48
   port (
49
      clear   : in  bit;
50
      start   : in  bit;
51
      match   : in  bit_vector (3 downto 0);
52
      col_0   : out integer;
53
      col_1   : out integer;
54
      col_2   : out integer;
55
      col_3   : out integer;
56
      result  : out integer
57
      );
58
end analyze;
59
 
60
architecture analyzer of analyze is
61
 
62
signal col_0_int  : integer range 0 to 19999;
63
signal col_1_int  : integer range 0 to 19999;
64
signal col_2_int  : integer range 0 to 19999;
65
signal col_3_int  : integer range 0 to 19999;
66
signal result_int : integer range 0 to 19999;
67
 
68
begin
69
 
70
process (start,clear)
71
begin
72
 
73
if (clear = '1') then
74
   col_0_int  <= 0;
75
   col_1_int  <= 0;
76
   col_2_int  <= 0;
77
   col_3_int  <= 0;
78
   result_int <= 0;
79
-- sample at rising edge then show the result at falling edge.
80
elsif (start = '1' and start'event) then
81
   if (match(0) = '0') then
82
      if (col_0_int < 19999) then
83
         col_0_int <= col_0_int + 1;
84
      else
85
         col_0_int <= 0;
86
      end if;
87
   end if;
88
   if (match(1) = '0') then
89
      if (col_1_int < 19999) then
90
         col_1_int <= col_1_int + 1;
91
      else
92
         col_1_int <= 0;
93
      end if;
94
   end if;
95
   if (match(2) = '0') then
96
      if (col_2_int < 19999) then
97
         col_2_int <= col_2_int + 1;
98
      else
99
         col_2_int <= 0;
100
      end if;
101
   end if;
102
   if (match(3) = '0') then
103
      if (col_3_int < 19999) then
104
         col_3_int <= col_3_int + 1;
105
      else
106
         col_3_int <= 0;
107
      end if;
108
   end if;
109
end if;
110
 
111
result_int <= col_0_int + col_1_int + col_2_int + col_3_int;
112
 
113
end process;
114
 
115
result   <= result_int;
116
col_0    <= col_0_int;
117
col_1    <= col_1_int;
118
col_2    <= col_2_int;
119
col_3    <= col_3_int;
120
 
121
end analyzer;

powered by: WebSVN 2.1.0

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