Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.numeric_std.all;
  4. use IEEE.std_logic_unsigned.all;
  5.  
  6.  
  7. entity Dwukierunkowy3 is
  8. Port ( CLK, DIR: in std_logic;
  9. Q : buffer std_logic_vector(7 downto 0));
  10. end Dwukierunkowy3;
  11.  
  12. architecture Behavioral of Dwukierunkowy3 is
  13.  
  14. begin
  15. process (CLK)
  16. begin
  17. if rising_edge (CLK) then
  18. if (DIR = '0') then
  19. Q <= Q + 1;
  20. else
  21. Q <= Q - 1;
  22. end if;
  23. end if;
  24. end process;
  25. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement