Created
January 30, 2018 16:25
-
-
Save davilamds/ad98bf61e65fda64420e3dc07c1ebbd9 to your computer and use it in GitHub Desktop.
Flip Flop tipo D con reset y eneable VHDL
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 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