Skip to content

Instantly share code, notes, and snippets.

@smirnovich
Last active March 14, 2023 07:16
Show Gist options
  • Save smirnovich/7b9035a06c5cfb2fd67988e438b09055 to your computer and use it in GitHub Desktop.
Save smirnovich/7b9035a06c5cfb2fd67988e438b09055 to your computer and use it in GitHub Desktop.
More advance VHDL trigger with async reset and sync enable
library ieee;
use ieee.std_logic_1164.all;
entity upgraded_trigger is
port(
clk : in std_logic;
rst : in std_logic
d : in std_logic;
en : in std_logic;
q : out std_logic
);
end entity;
architecture rtl of upgraded_trigger is
begin
process(clk)
begin
if (rst = '1') then --asynq reset
q <= '0';
elsif(rising_edge(clk)) then
if (en = '1') then
q<=d;
end if;
end if;
end process;
end rtl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment