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

Subversion Repositories dirac

[/] [dirac/] [trunk/] [src/] [decoder/] [STORAGE_REGISTER.vhd] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 petebleack
library IEEE;
2
use IEEE.STD_LOGIC_1164.ALL;
3
use IEEE.STD_LOGIC_ARITH.ALL;
4
use IEEE.STD_LOGIC_UNSIGNED.ALL;
5
 
6
--  Uncomment the following lines to use the declarations that are
7
--  provided for instantiating Xilinx primitive components.
8
--library UNISIM;
9
--use UNISIM.VComponents.all;
10
 
11 9 petebleack
entity STORAGE_REGISTER is
12 2 petebleack
    Port ( LOAD : in std_logic_vector(15 downto 0);
13
                          SHIFT_IN : in std_logic;
14
           SET_VALUE : in std_logic;
15
           SHIFT_ALL : in std_logic;
16
           SHIFT_MOST : in std_logic;
17
                          RESET : in std_logic;
18
           CLOCK : in std_logic;
19
           OUTPUT : out std_logic_vector(15 downto 0));
20
end entity STORAGE_REGISTER;
21
 
22
architecture RTL of STORAGE_REGISTER is
23 5 petebleack
 
24
        signal Q:       std_logic_vector(15 downto 0);
25 2 petebleack
begin
26
 
27
 
28
-- outputs
29
 
30 5 petebleack
        OUTPUT <= Q;
31 2 petebleack
 
32
-- storage
33
 
34 5 petebleack
        STORE: process (CLOCK)
35
        begin
36
                if CLOCK'event and CLOCK = '1' then
37 9 petebleack
                        if RESET = '1' then
38
                                Q <= (others => '0');
39
                        elsif SET_VALUE = '1' then
40
                                Q <= LOAD;
41
                        elsif SHIFT_ALL = '1' then
42
                                Q <= Q(14 downto 0) & SHIFT_IN;
43
                        elsif SHIFT_MOST = '1' then
44
                                Q <= Q(15) & Q(13 downto 0) & SHIFT_IN;
45 5 petebleack
                        end if;
46
                end if;
47
        end process STORE;
48 2 petebleack
 
49
 
50
end architecture RTL;
51
 

powered by: WebSVN 2.1.0

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