Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4.  
  5. library work;
  6. use work.all;
  7.  
  8. entity chooser is
  9. port(
  10. clk, rst : in std_logic;
  11. DATA : in std_logic_vector(4 downto 0);
  12. A : out std_logic_vector(4 downto 0);
  13. Src : in std_logic_vector(1 downto 0);
  14. SOp : in std_logic_vector(1 downto 0);
  15. debug : out std_logic_vector(4 downto 0)
  16. );
  17. end entity;
  18.  
  19. architecture structural of chooser is
  20. -- here
  21. begin
  22.  
  23. end architecture;
  24.  
  25. library ieee;
  26. use ieee.std_logic_1164.all;
  27. use ieee.numeric_std.all;
  28.  
  29. entity MUX3x5 is
  30. port(
  31. IN0 : in std_logic_vector(4 downto 0);
  32. IN1 : in std_logic_vector(4 downto 0);
  33. IN2 : in std_logic_vector(4 downto 0);
  34. SEL : in std_logic_vector(1 downto 0);
  35. O : out std_logic_vector(4 downto 0)
  36. );
  37. end entity;
  38.  
  39. architecture behaviour of MUX3x5 is
  40.  
  41. begin
  42.  
  43. with SEl select O <=
  44. IN0 when "00",
  45. IN1 when "01",
  46. IN2 when others;
  47.  
  48. end architecture;
  49.  
  50. architecture structural of chooser is
  51.  
  52. signal -- signals here
  53.  
  54.  
  55. -- copy of the inputs/outputs in the entity declaration in the file above
  56. component MUX3x5 is
  57. port(
  58. IN0 : in std_logic_vector(4 downto 0);
  59. IN1 : in std_logic_vector(4 downto 0);
  60. IN2 : in std_logic_vector(4 downto 0);
  61. SEL : in std_logic_vector(1 downto 0);
  62. O : out std_logic_vector(4 downto 0)
  63. );
  64. end component;
  65.  
  66.  
  67. component registry is
  68. port(
  69. -- some signals here
  70. TS : out TS std_logic_vector(4 downto 0)
  71. );
  72.  
  73. begin
  74.  
  75. -- port map here
  76. port map(
  77. TS => IN1;
  78. -- other maps
  79. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement