Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity rom_mu1 is
  5. port (
  6. addr: in std_logic_vector(3 downto 0);
  7. data: out std_logic_vector(3 downto 0)
  8. );
  9. end rom_mu1;
  10.  
  11. architecture behavioural of rom_mu1 is
  12.  
  13. type rom is array (0 to 15) of std_logic_vector( 3 downto 0 );
  14.  
  15. constant mu1: rom:=(
  16. 0 => x"0",
  17. 1 => x"0",
  18. 2 => x"0",
  19. 3 => x"0",
  20. 4 => x"0",
  21. 5 => x"1",
  22. 6 => x"2",
  23. 7 => x"3",
  24. 8 => x"0",
  25. 9 => x"2",
  26. 10 => x"4",
  27. 11 => x"6",
  28. 12 => x"0",
  29. 13 => x"3",
  30. 14 => x"6",
  31. 15 => x"9"
  32. );
  33.  
  34. begin
  35.  
  36. process(addr)
  37. begin
  38.  
  39. case addr is
  40.  
  41. when "00" => data <= decoder(0);
  42. when "01" => data <= decoder(1);
  43. when "10" => data <= decoder(2);
  44. when others => data <= decoder(3);
  45.  
  46. end case;
  47. end process;
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. end behavioural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement