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

Subversion Repositories pif2wb

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

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

Line No. Rev Author Line
1 4 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 tran_reg is
7
        port (
8
                        clk     : in std_logic;
9
                        rst     : in std_logic;
10
                        En      : in std_logic;
11
                        Num_i : in integer range 0 to 15;
12
                        Num_o   : out integer range 0 to 15
13
                        );
14
end tran_reg;
15
 
16
architecture Behavioral of tran_reg is
17
 
18
signal temp : integer range 0 to 15;
19
 
20
begin
21
        process (clk, rst, En, temp)
22
        begin
23
                if rst = '1' then
24
                        temp <= 0;
25
                elsif (clk'event and clk = '1') then
26
                        if En = '1' then
27
                                temp <= Num_i;
28
                        else
29
                                temp <= temp;
30
                        end if;
31
                end if;
32
        end process;
33
 
34
        Num_o <= temp;
35
 
36
end Behavioral;
37
 

powered by: WebSVN 2.1.0

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