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

Subversion Repositories uos_processor

[/] [vhdl/] [dffre.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 droggen
-- 8-bit register (D flip-flop) with synchronous enable and reset
2
 
3
library IEEE;
4
use IEEE.STD_LOGIC_1164.ALL;
5
 
6
 
7
entity dffre is
8
        generic (N : integer);
9
        port(
10
                clk : in STD_LOGIC;
11
                en : in STD_LOGIC;
12
                rst: in STD_LOGIC;
13
                d : in STD_LOGIC_VECTOR(N-1 downto 0);
14
                q : out STD_LOGIC_VECTOR(N-1 downto 0)
15
                );
16
end dffre;
17
 
18
architecture Behavioral of dffre is
19
begin
20
 
21
        process(clk)
22
        begin
23
                if rising_edge(clk) then
24
                        if rst='1' then
25
                                q<=(others=>'0');
26
                        else
27
                                if en='1' then
28
                                        q<=d;
29
                                end if;
30
                        end if;
31
                end if;
32
        end process;
33
 
34
 
35
end Behavioral;
36
 

powered by: WebSVN 2.1.0

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