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

Subversion Repositories xmatchpro

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

powered by: WebSVN 2.1.0

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