Last active
April 28, 2025 20:08
-
-
Save barbarbar338/29e05cf9aec846c85aadb8373ccc9f26 to your computer and use it in GitHub Desktop.
D-flip-flop for Basys3 with reset - Positive-edge triggered
This file contains hidden or 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
-- barbarbar338 | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.ALL; | |
entity dff is | |
Port ( | |
clk : in std_logic; | |
reset : in std_logic; | |
d : in std_logic; | |
q : out std_logic | |
); | |
end dff; | |
architecture Behavioral of dff is | |
begin | |
process(clk, reset) | |
begin | |
if reset = '1' then | |
q <= '0'; | |
elsif rising_edge(clk) then | |
q <= d; | |
end if; | |
end process; | |
end Behavioral; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment