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

powered by: WebSVN 2.1.0

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