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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [BUFFER_COUNTER_WRITE_9BITS.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 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       = BUFFER_COUNTER_WRITE        --
19
--  version      = 1.0                         --
20
--  last update  = 30/5/00                     --
21
--  author       = Jose Nunez                  --
22
-------------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 8 bit counter for the read and write on dual port ram buffers
27
 
28
 
29
--  PIN LIST
30
--  ENABLE = enable count 
31
--  CLEAR = asyncronus clear of the counter
32
--  CLK   = master clock
33
--  COUNT = count output
34
 
35
 
36
library ieee,dzx;
37
use ieee.std_logic_1164.all;
38
use dzx.bit_arith.all;
39
use dzx.bit_utils.all;
40
 
41
entity BUFFER_COUNTER_WRITE_9BITS is
42
 
43
port (  ENABLE : in bit;
44
                SHORT : in bit; -- only write 32 bits
45
          CLEAR : in bit;
46
          CLEAR_COUNTERS : in bit;
47
          CLK : in bit;
48
          COUNT : out bit_vector(9 downto 0)
49
     );
50
 
51
end BUFFER_COUNTER_WRITE_9BITS;
52
 
53
architecture STRUCTURAL of BUFFER_COUNTER_WRITE_9BITS is
54
 
55
signal COUNT_AUX : bit_vector(9 downto 0);
56
 
57
 
58
begin
59
 
60
 
61
COUNTING : process (CLK,CLEAR,CLEAR_COUNTERS,ENABLE)
62
 
63
begin
64
        -- asynchronous RESET signal forces all outputs LOW
65
      if (CLEAR = '0') then
66
            COUNT_AUX <= "0000000000";
67
            -- check for +ve clock edge
68
          elsif ((CLK'event) and (CLK = '1')) then
69
                   if(CLEAR_COUNTERS = '1') then
70
                             COUNT_AUX <= "0000000000";
71
                 elsif( ENABLE = '1') then
72
                                                                if (SHORT = '1') then
73
                                                 COUNT_AUX <= COUNT_AUX+"0000000010";
74
                                                           else
75
                                                 COUNT_AUX <= COUNT_AUX+"0000000001";  -- short enable at zero
76
                                                                end if;
77
                         else
78
                             COUNT_AUX <= COUNT_AUX;
79
                         end if;
80
         end if;
81
 
82
end process COUNTING;
83
 
84
COUNT <= COUNT_AUX;
85
 
86
end STRUCTURAL;

powered by: WebSVN 2.1.0

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