Advertisement
ceterumcenseo

Static D Flip-Flop

Oct 20th, 2022 (edited)
1,975
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.50 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3.  
  4. -- Description of a static D flip-flop (D latch) with
  5. -- high-active enable and high-active asynchronous reset.
  6.  
  7. entity Dlatch is
  8.   port (
  9.     en : in STD_LOGIC;
  10.     res : in STD_LOGIC;
  11.     D : in STD_LOGIC;
  12.     Q: out STD_LOGIC
  13.     );
  14. end entity;
  15.  
  16. architecture impl of Dlatch is
  17. begin
  18.        
  19.   process(D,en,res) is
  20.   begin
  21.     if res = '1' then
  22.       Q <= '0';
  23.     elsif en = '1' then
  24.       Q <= D;      
  25.     end if;
  26.   end process;
  27.  
  28. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement