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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [src/] [input_counter_9bits.vhd] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 eejlny
--This library is free software; you can redistribute it and/or
2
--modify it under the terms of the GNU Lesser General Public
3
--License as published by the Free Software Foundation; either
4
--version 2.1 of the License, or (at your option) any later version.
5
 
6
--This library is distributed in the hope that it will be useful,
7
--but WITHOUT ANY WARRANTY; without even the implied warranty of
8
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9
--Lesser General Public License for more details.
10
 
11
--You should have received a copy of the GNU Lesser General Public
12
--License along with this library; if not, write to the Free Software
13
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
 
15
-- e_mail : j.l.nunez-yanez@byacom.co.uk
16
 
17
-------------------------------------------------
18
--  ENTITY       = INPUT_COUNTER                   --
19
--  version      = 1.0                         --
20
--  last update  = 30/5/01                     --
21
--  author       = Jose Nunez                  --
22
-------------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 8 bit counter for the read and write of the input buffer
27
 
28
 
29
--  PIN LIST
30
--  ENABLE = enable count 
31
--  CLEAR = asyncronus clear of the counter
32
--  CLEAR_COUNTERS : syncronous clear of counters
33
--  CLK   = master clock
34
--  COUNT = count output
35
 
36
 
37
library ieee,dzx;
38
use ieee.std_logic_1164.all;
39
use dzx.bit_arith.all;
40
use dzx.bit_utils.all;
41
 
42
entity INPUT_COUNTER_9BITS is
43
 
44
port (ENABLE : in bit;
45
          CLEAR : in bit;
46
          CLEAR_COUNTERS : in bit;
47
          CLK : in bit;
48
          COUNT : out bit_vector(8 downto 0)
49
     );
50
 
51
end INPUT_COUNTER_9BITS;
52
 
53
architecture STRUCTURAL of INPUT_COUNTER_9BITS is
54
 
55
signal COUNT_AUX : bit_vector(8 downto 0);
56
 
57
begin
58
 
59
COUNTING : process (CLK,CLEAR,ENABLE,CLEAR_COUNTERS)
60
 
61
begin
62
        -- asynchronous RESET signal forces all outputs LOW
63
      if (CLEAR = '0') then
64
            COUNT_AUX <= "000000000";
65
            -- check for +ve clock edge
66
          elsif ((CLK'event) and (CLK = '1')) then
67
                    if (CLEAR_COUNTERS = '1') then
68
                               COUNT_AUX <= "000000000";
69
                  elsif( ENABLE = '1') then
70
                           COUNT_AUX <= COUNT_AUX+"000000001";
71
                          else
72
                               COUNT_AUX <= COUNT_AUX;
73
                          end if;
74
         end if;
75
 
76
end process COUNTING;
77
 
78
COUNT <= COUNT_AUX;
79
 
80
end STRUCTURAL;

powered by: WebSVN 2.1.0

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