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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [cam_bit.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       = CAM_BIT     --
19
--  version      = 1.0         --
20
--  last update  = 30/05/98    --
21
--  author       = Mark Gooch  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- basic bit element of the CAM array
27
-- reset to zero
28
 
29
--  PIN LIST
30
--  SEARCH   = input search data bit
31
--  PREVIOUS = data from the previous location in the array
32
--  MOVE     = movement control
33
--  CLEAR    = asynchronous clear of the data latch (active LOW)
34
--  CLK      = master clock
35
--  RESET    = asynchronous reset of the data latch (active LOW)
36
--  DOUT     = output of the data latch
37
--  MATCH    = indicates a match between search bit and data bit (active LOW)
38
 
39
 
40
library ieee;
41
use ieee.std_logic_1164.all;
42
 
43
entity CAM_BIT is
44
port
45
(
46
        SEARCH : in bit;
47
        PREVIOUS : in bit;
48
        MOVE : in bit;
49
        CLEAR : in bit ;
50
        RESET : in bit;
51
        CLK : in bit ;
52
        DOUT : out bit;
53
        MATCH : out bit
54
);
55
 
56
 
57
end CAM_BIT;
58
-----------------------------------
59
--  entity       = CAM_BIT       --
60
--  ARCHITECTURE = BIT1          --
61
--  version      = 1.0           --
62
--  last update  = 30/05/95      --
63
--  author       = Mark Gooch    --
64
-----------------------------------
65
 
66
 
67
architecture BIT1 of CAM_BIT is
68
 
69
signal TEMP_D : bit;
70
signal TEMP_Q : bit;
71
 
72
begin
73
 
74
 
75
COMB : process (TEMP_Q , PREVIOUS , MOVE)
76
begin
77
 
78
if (MOVE = '1') then
79
                TEMP_D <= PREVIOUS;     -- get data from previous location
80
else
81
                TEMP_D <= TEMP_Q;       -- keep current data
82
end if;
83
--end if;
84
 
85
end process COMB;
86
 
87
 
88
 
89
LATCHES : process (CLK,CLEAR)
90
begin
91
 
92
if (CLEAR = '0') then
93
        TEMP_Q <= '0';
94
elsif ((CLK'event) and (CLK = '1')) then
95
        if (RESET = '0') then
96
                TEMP_Q <= '0';
97
        else
98
                TEMP_Q <= TEMP_D;
99
        end if;
100
end if;
101
 
102
end process LATCHES;
103
 
104
 
105
 
106
DOUT <= TEMP_Q;
107
MATCH <= SEARCH xor TEMP_Q;             -- match goes low if SEARCH = TEMP_Q
108
 
109
 
110
end BIT1;
111
 
112
 

powered by: WebSVN 2.1.0

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