rtbuhler

Flip-Flop tipo D

Sep 2nd, 2021 (edited)
823
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.45 KB | None | 0 0
  1. -- Quartus II VHDL Template
  2.  
  3. library ieee;
  4. use ieee.std_logic_1164.all;
  5.  
  6. entity ff_d is
  7.  
  8.     port
  9.     (
  10.         d, ck, set, rst    : in std_logic;
  11.         q, nq  : out std_logic
  12.     );
  13. end ff_d;
  14.  
  15. architecture comportamental of ff_d is
  16. begin
  17.     process (ck, set, rst)
  18.     begin
  19.         if (rst='0') then q <='0'; nq <='1';
  20.         elsif (set='0') then q<='1'; nq <='0';
  21.         elsif (ck'event and ck='1') then q <=d; nq <= not(d);
  22.         end if;
  23.     end process;
  24. end comportamental;
  25.  
Add Comment
Please, Sign In to add comment