Skip to content

Instantly share code, notes, and snippets.

@barbarbar338
Last active April 28, 2025 20:08
Show Gist options
  • Save barbarbar338/29e05cf9aec846c85aadb8373ccc9f26 to your computer and use it in GitHub Desktop.
Save barbarbar338/29e05cf9aec846c85aadb8373ccc9f26 to your computer and use it in GitHub Desktop.
D-flip-flop for Basys3 with reset - Positive-edge triggered
-- 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