Last active
March 14, 2023 07:16
-
-
Save smirnovich/7b9035a06c5cfb2fd67988e438b09055 to your computer and use it in GitHub Desktop.
More advance VHDL trigger with async reset and sync enable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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