Line 1... |
Line 1... |
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
-- Company:
|
-- Engineer: Joao Carlos Nunes Bittencourt
|
-- Engineer:
|
----------------------------------------------------------------------------------
|
--
|
-- Create Date: 13:18:18 03/06/2012
|
-- Create Date: 01:14:05 05/02/2012
|
----------------------------------------------------------------------------------
|
-- Design Name:
|
-- Design Name: D-Flip-flop
|
-- Module Name: DFF - FlipFlop
|
-- Module Name: dff - behavioral
|
-- Project Name:
|
----------------------------------------------------------------------------------
|
-- Target Devices:
|
-- Project Name: 16-bit uRISC Processor
|
-- Tool versions:
|
----------------------------------------------------------------------------------
|
-- Description:
|
|
--
|
|
-- Dependencies:
|
|
--
|
|
-- Revision:
|
-- Revision:
|
-- Revision 0.01 - File Created
|
-- 1.0 - File Created
|
-- Additional Comments:
|
-- 2.0 - Project refactoring
|
--
|
--
|
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
|
|
entity dff is
|
entity dff is
|
Generic (WIDTH : integer := 16);
|
generic( WIDTH : integer := 16 );
|
Port ( clk : in std_logic;
|
port ( clk : in std_logic;
|
en : in std_logic;
|
enable : in std_logic;
|
rst_n : in std_logic;
|
rst_n : in std_logic;
|
D : in std_logic_vector (WIDTH-1 downto 0);
|
sink_d : in std_logic_vector (WIDTH-1 downto 0);
|
Q : out std_logic_vector (WIDTH-1 downto 0));
|
src_q : out std_logic_vector (WIDTH-1 downto 0)
|
|
);
|
end dff;
|
end dff;
|
|
|
architecture FlipFlop of dff is
|
architecture behavioral of dff is
|
|
|
begin
|
begin
|
process (clock,reset)
|
process (clock,reset)
|
begin
|
begin
|
if(reset = '0') then
|
if(reset = '0') then
|
Q <= (others => '0');
|
src_q <= (others => '0');
|
elsif clock'event and clock = '1' then
|
elsif clock'event and clock = '1' then
|
if(enable = '1') then
|
if(enable = '1') then
|
Q <= D;
|
src_q <= sink_d;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|
end FlipFlop;
|
end behavioral;
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|