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

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [dff.vhd] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 joaocarlos
----------------------------------------------------------------------------------
2 11 joaocarlos
-- Engineer: Joao Carlos Nunes Bittencourt
3
----------------------------------------------------------------------------------
4
-- Create Date:    13:18:18 03/06/2012 
5
----------------------------------------------------------------------------------
6
-- Design Name:    D-Flip-flop
7
-- Module Name:    dff - behavioral 
8
----------------------------------------------------------------------------------
9
-- Project Name:   16-bit uRISC Processor
10
----------------------------------------------------------------------------------
11 2 joaocarlos
-- Revision: 
12 11 joaocarlos
--      1.0 - File Created
13
--      2.0 - Project refactoring
14 2 joaocarlos
--
15
----------------------------------------------------------------------------------
16
library ieee;
17
use ieee.std_logic_1164.all;
18
 
19
entity dff is
20 11 joaocarlos
        generic( WIDTH : integer := 16 );
21
    port ( clk          : in std_logic;
22
           enable       : in std_logic;
23
           rst_n        : in std_logic;
24
           sink_d       : in std_logic_vector (WIDTH-1 downto 0);
25
           src_q        : out std_logic_vector (WIDTH-1 downto 0)
26
    );
27 2 joaocarlos
end dff;
28
 
29 11 joaocarlos
architecture behavioral of dff is
30 2 joaocarlos
 
31
begin
32
        process (clock,reset)
33
        begin
34
                if(reset = '0') then
35 11 joaocarlos
                        src_q <= (others => '0');
36 2 joaocarlos
                elsif clock'event and clock = '1' then
37
                        if(enable = '1') then
38 11 joaocarlos
                                src_q <= sink_d;
39 2 joaocarlos
                        end if;
40
                end if;
41
        end process;
42
 
43 11 joaocarlos
end behavioral;
44 2 joaocarlos
 

powered by: WebSVN 2.1.0

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