Skip to content

Instantly share code, notes, and snippets.

@davilamds
Created January 30, 2018 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davilamds/ad98bf61e65fda64420e3dc07c1ebbd9 to your computer and use it in GitHub Desktop.
Save davilamds/ad98bf61e65fda64420e3dc07c1ebbd9 to your computer and use it in GitHub Desktop.
Flip Flop tipo D con reset y eneable VHDL
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity d_ff_en_1 is
port(
clk, reset: in std_logic;
en: in std_logic;
d: in std_logic;
q: out std_logic
);
end d_ff_en_1;
architecture arch_d_ff_en_1 of d_ff_en_1 is
begin
process(clk,reset) -- el proceso principal es disparado por clk o reset (proceso único)
begin
if (reset='1') then --reset tiene prioridad
q<='0';
elsif (clk'event and clk='1') then --luego si clk=1 sigue
if (en='1') then --si clk=1 y en=1
q<=d; --funcionamiento normal de ffd
end if;
end if;
end process;
end arch_d_ff_en_1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment