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

Subversion Repositories pif2wb

[/] [pif2wb/] [trunk/] [vhdl/] [sel_reg.vhd] - Blame information for rev 12

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sergio.tot
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
entity sel_reg is
7
        port (
8
                        clk     : in std_logic;
9
                        rst     : in std_logic;
10
                        En      : in std_logic;
11
                        sel_i : in std_logic_vector (3 downto 0);
12
                        sel_o   : out std_logic_vector (3 downto 0)
13
                        );
14
end sel_reg;
15
 
16
architecture Behavioral of sel_reg is
17
 
18
signal temp : std_logic_vector (3 downto 0);
19
 
20
begin
21
        process (clk, rst, En)
22
        begin
23
                if rst = '1' then
24
                        temp <= (others => '0');
25
                elsif (clk'event and clk = '1') then
26
                        if En = '1' then
27
                                temp <= sel_i;
28
                        else
29
                                temp <= temp;
30
                        end if;
31
                end if;
32
        end process;
33
 
34
        sel_o <= temp;
35
end Behavioral;
36
 

powered by: WebSVN 2.1.0

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