library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity monostable_ff is
port(
mono_pulse : out std_logic;
clk : in std_logic;
reset: in std_logic;
key :in std_logic
);
end monostable_ff;
architecture Behavioral of monostable_ff is
component DFF_AsyncReset is
port(
Q : out std_logic;
QNot : out std_logic;
clk : in std_logic;
reset: in std_logic;
D :in std_logic
);
end component;
component nand2 is
port(a,b : in std_logic;
y : out std_logic);
end component;
signal Q1,Q2,Q3,Q4 : std_logic;
signal Q1N,Q2N,Q3N,Q4N : std_logic;
signal G1O : std_logic;
begin
DFF1: DFF_AsyncReset port map (
Q => Q1,
QNot => Q1N,
clk => clk,
reset => reset,
D => key
);
DFF2: DFF_AsyncReset port map (
Q => Q2,
QNot => Q2N,
clk => clk,
reset => reset,
D => Q1
);
DFF3: DFF_AsyncReset port map (
Q => Q3,
QNot => Q3N,
clk => clk,
reset => reset,
D => Q2
);
G1O <= (Q2 and Q3N);
DFF4: DFF_AsyncReset port map (
Q => mono_pulse,
QNot => Q4N,
clk => clk,
reset => reset,
D => G1O
);
end Behavioral;