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

Subversion Repositories ourisc

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

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

Line No. Rev Author Line
1 2 joaocarlos
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    01:14:05 05/02/2012 
6
-- Design Name: 
7
-- Module Name:    DFF - FlipFlop 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library ieee;
21
use ieee.std_logic_1164.all;
22
 
23
entity dff is
24
        Generic (WIDTH : integer := 16);
25
    Port ( clk : in std_logic;
26
           en : in std_logic;
27
           rst_n : in std_logic;
28
           D : in std_logic_vector (WIDTH-1 downto 0);
29
           Q : out std_logic_vector (WIDTH-1 downto 0));
30
end dff;
31
 
32
architecture FlipFlop of dff is
33
 
34
begin
35
        process (clock,reset)
36
        begin
37
                if(reset = '0') then
38
                        Q <= (others => '0');
39
                elsif clock'event and clock = '1' then
40
                        if(enable = '1') then
41
                                Q <= D;
42
                        end if;
43
                end if;
44
        end process;
45
 
46
end FlipFlop;
47
 

powered by: WebSVN 2.1.0

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