Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity Exercises is
  5. port (
  6. clk: in std_logic;
  7. d: out std_logic_vector (3 downto 0));
  8. end Exercises;
  9.  
  10.  
  11. architecture Exercises of Exercises is
  12. type memory is array (natural range <>) of std_logic_vector (3 downto 0);
  13.  
  14. constant words: memory (0 to 7) := ("0000", "0001", "0011", "0010", "0110", "0111", "0101", "0100");
  15.  
  16. signal ctr: integer range 0 to 7 := 0;
  17.  
  18. begin
  19.  
  20. process(clk)
  21. begin
  22. if (clk'EVENT and clk = '1') then
  23. ctr <= ctr + 1;
  24. d <= words(ctr);
  25. end if;
  26. end process;
  27.  
  28.  
  29. end Exercises;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement