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

Subversion Repositories uart_fpga_slow_control_migrated

[/] [uart_fpga_slow_control/] [trunk/] [code/] [library/] [gh_shift_reg_se_sl.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 aborga
-----------------------------------------------------------------------------
2
--      Filename:       gh_shift_reg_se_sl.vhd
3
--
4
--      Description:
5
--              a shift register with async reset and count enable
6
--
7
--      Copyright (c) 2006 by George Huber 
8
--              an OpenCores.org Project
9
--              free to use, but see documentation for conditions 
10
--
11
--      Revision        History:
12
--      Revision        Date            Author          Comment
13
--      --------        ----------      --------        -----------
14
--      1.0             02/11/06        G Huber         Initial revision
15
--
16
-----------------------------------------------------------------------------
17
LIBRARY ieee;
18
USE ieee.std_logic_1164.all;
19
 
20
 
21
ENTITY gh_shift_reg_se_sl IS
22
        GENERIC (size: INTEGER := 16);
23
        PORT(
24
                clk      : IN STD_logic;
25
                rst      : IN STD_logic;
26
                srst     : IN STD_logic:='0';
27
                SE       : IN STD_logic; -- shift enable
28
                D        : IN STD_LOGIC;
29
                Q        : OUT STD_LOGIC_VECTOR(size-1 DOWNTO 0)
30
                );
31
END entity ;
32
 
33
ARCHITECTURE a OF gh_shift_reg_se_sl IS
34
 
35
        signal iQ :  STD_LOGIC_VECTOR(size-1 DOWNTO 0);
36
 
37
BEGIN
38
 
39
        Q <= iQ;
40
 
41
process(clk,rst)
42
begin
43
        if (rst = '1') then
44
                iQ <= (others => '0');
45
        elsif (rising_edge(clk)) then
46
                if (srst = '1') then
47
                        iQ <= (others => '0');
48
                elsif (SE = '1') then
49
                        iQ(size-1) <= D;
50
                        iQ(size-2 downto 0) <= iQ(size-1 downto 1);
51
                end if;
52
        end if;
53
end process;
54
 
55
 
56
END a;
57
 

powered by: WebSVN 2.1.0

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