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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [mask_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       = MASK_BIT     --
19
--  version      = 1.0         --
20
--  last update  = 30/06/01    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- basic bit element of the MASK 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 MASK_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 MASK_BIT;
58
 
59
 
60
 
61
architecture BIT1 of MASK_BIT is
62
 
63
signal TEMP_D : bit;
64
signal TEMP_Q : bit;
65
 
66
begin
67
 
68
 
69
COMB : process (TEMP_Q , PREVIOUS , MOVE)
70
begin
71
 
72
if (MOVE = '1') then
73
                TEMP_D <= PREVIOUS;     -- get data from previous location
74
else
75
                TEMP_D <= TEMP_Q;       -- keep current data
76
end if;
77
--end if;
78
 
79
end process COMB;
80
 
81
 
82
-- mask cleared to 1 so all the data is valid from the start but because all the data is zero only first is real valid
83
 
84
LATCHES : process (CLK,CLEAR)
85
begin
86
 
87
if (CLEAR = '0') then
88
        TEMP_Q <= '1';
89
elsif ((CLK'event) and (CLK = '1')) then
90
        if (RESET = '0') then
91
                TEMP_Q <= '1';
92
        else
93
                TEMP_Q <= TEMP_D;
94
        end if;
95
end if;
96
 
97
end process LATCHES;
98
 
99
 
100
 
101
DOUT <= TEMP_Q;
102
MATCH <= SEARCH nand TEMP_Q;            -- match goes low if SEARCH = TEMP_Q = 1
103
 
104
 
105
end BIT1;
106
 
107
 

powered by: WebSVN 2.1.0

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