Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. LIBRARY IEEE;
  2. LIBRARY WORK;
  3. USE IEEE.STD_LOGIC_1164.ALL;
  4.  
  5. ENTITY mux4to1 IS
  6. Port( w : IN STD_LOGIC_VECTOR(0 TO 3);
  7. s : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
  8. f : OUT STD_LOGIC);
  9. END mux4to1;
  10.  
  11.  
  12. ARCHITECTURE Behavior OF mux4to1 IS
  13.  
  14. COMPONENT mux2to1 IS
  15. Port( w1: IN STD_LOGIC;
  16. w2: IN STD_LOGIC;
  17. s : IN STD_LOGIC;
  18. f : OUT STD_LOGIC);
  19. END COMPONENT;
  20.  
  21. SIGNAL f1, f2 : STD_LOGIC;
  22.  
  23. BEGIN
  24. Mux1: mux2to1 PORT MAP
  25. (w(0), w(1), s(0), f1);
  26. Mux2: mux2to1 PORT MAP
  27. (w(2), w(3), s(0), f2);
  28. Mux3: mux2to1 PORT MAP
  29. (f1, f2, s(1), f);
  30. END Behavior;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement