Guest User

Untitled

a guest
Apr 21st, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 17:02:27 04/18/2017
  6. -- Design Name:
  7. -- Module Name: D_flip_flop - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22.  
  23. -- Uncomment the following library declaration if using
  24. -- arithmetic functions with Signed or Unsigned values
  25. --use IEEE.NUMERIC_STD.ALL;
  26.  
  27. -- Uncomment the following library declaration if instantiating
  28. -- any Xilinx primitives in this code.
  29. --library UNISIM;
  30. --use UNISIM.VComponents.all;
  31.  
  32. entity D_flip_flop is
  33. Port ( D : in STD_LOGIC;
  34. clk : in STD_LOGIC;
  35. clear : in STD_LOGIC;
  36. Q : out STD_LOGIC);
  37. end D_flip_flop;
  38.  
  39. architecture Behavioral of D_flip_flop is
  40.  
  41. begin
  42. process(clk,clear)
  43. begin
  44. if clear='0' then
  45. Q<='0';
  46. elsif clk'event and clk='1' then
  47. Q<=D;
  48. end if;
  49. end process;
  50.  
  51. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment