Line 4... |
Line 4... |
---- This file is part of the ----
|
---- This file is part of the ----
|
---- Modular Simultaneous Exponentiation Core project ----
|
---- Modular Simultaneous Exponentiation Core project ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- ----
|
---- ----
|
---- Description ----
|
---- Description ----
|
---- 1 bit D flip-flop currently still uses primitives ----
|
---- 1-bit D flip-flop implemented with behavorial (generic) ----
|
|
---- description. With asynchronous active high reset. ----
|
---- ----
|
---- ----
|
---- Dependencies: none ----
|
---- Dependencies: none ----
|
---- ----
|
---- ----
|
---- Authors: ----
|
---- Authors: ----
|
---- - Geoffrey Ottoy, DraMCo research group ----
|
---- - Geoffrey Ottoy, DraMCo research group ----
|
Line 43... |
Line 44... |
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
-- Xilinx primitives used
|
|
library unisim;
|
|
use unisim.vcomponents.all;
|
|
|
|
|
|
|
-- 1-bit D flip-flop with asynchronous active high reset
|
entity d_flip_flop is
|
entity d_flip_flop is
|
port(
|
port(
|
core_clk : in std_logic;
|
core_clk : in std_logic; -- clock signal
|
reset : in std_logic;
|
reset : in std_logic; -- active high reset
|
din : in std_logic;
|
din : in std_logic; -- data in
|
dout : out std_logic
|
dout : out std_logic -- data out
|
);
|
);
|
end d_flip_flop;
|
end d_flip_flop;
|
|
|
|
|
architecture Structural of d_flip_flop is
|
architecture Behavorial of d_flip_flop is
|
signal dout_i : std_logic;
|
|
begin
|
begin
|
|
|
dout <= dout_i;
|
-- process for 1-bit D flip-flop
|
|
d_FF : process (reset, core_clk, din)
|
FDCE_inst : FDCE
|
begin
|
generic map (
|
if reset='1' then -- asynchronous active high reset
|
INIT => '0') -- Initial value of latch ('0' or '1')
|
dout <= '0';
|
port map (
|
else
|
Q => dout_i, -- Data output
|
if rising_edge(core_clk) then -- clock in data on rising edge
|
CLR => reset, -- Asynchronous clear/reset input
|
dout <= din;
|
D => din, -- Data input
|
end if;
|
C => core_clk, -- Gate input
|
end if;
|
CE => '1' -- Gate enable input
|
end process;
|
);
|
|
|
|
end Structural;
|
end Behavorial;
|
|
|
No newline at end of file
|
No newline at end of file
|