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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [sreg.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       = SREG        --
19
--  version      = 1.0         --
20
--  last update  = 5/05/01    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 32 bit wide search register
27
 
28
 
29
--  PIN LIST
30
--  DIN   = 32 bit input data
31
--  MIN  = 5 bit mask data
32
--  CLEAR = asynchronous clear of register
33
--  CLK   = clock
34
--  QOUT  = 32 bit output of flip-flops
35
--  QMOUT  = 5 bit mask out
36
 
37
 
38
library ieee,dzx;
39
use ieee.std_logic_1164.all;
40
 
41
 
42
entity SREG is
43
port
44
(
45
      DIN : in bit_vector(31 downto 0) ;
46
        MASK_IN : in bit_vector(4 downto 0);
47
      CLEAR : in bit ;
48
      CLK : in bit ;
49
        MASK_OUT : out bit_vector(4 downto 0);
50
      QOUT : out bit_vector(31 downto 0)
51
);
52
 
53
 
54
end SREG;
55
 
56
 
57
 
58
architecture LATCH of SREG is
59
begin
60
 
61
FLIP_FLOPS : process (CLK,CLEAR)
62
begin
63
        -- asynchronous RESET signal forces all outputs LOW
64
        if (CLEAR = '0') then
65
            QOUT <= x"00000000";
66
                MASK_OUT <= "00000";
67
            -- check for +ve clock edge
68
          elsif ((CLK'event) and (CLK = '1')) then
69
            -- check for synchronous clear signal
70
                    QOUT <= DIN;
71
                        MASK_OUT <= MASK_IN;
72
        end if;
73
end process FLIP_FLOPS;
74
 
75
end LATCH;
76
 

powered by: WebSVN 2.1.0

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