Guest User

Untitled

a guest
Apr 21st, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 12:20:15 04/19/2017
  6. -- Design Name:
  7. -- Module Name: MUX_8x1 - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22.  
  23. -- Uncomment the following library declaration if using
  24. -- arithmetic functions with Signed or Unsigned values
  25. --use IEEE.NUMERIC_STD.ALL;
  26.  
  27. -- Uncomment the following library declaration if instantiating
  28. -- any Xilinx primitives in this code.
  29. --library UNISIM;
  30. --use UNISIM.VComponents.all;
  31.  
  32. entity MUX_8x1 is
  33. Port ( I : in STD_LOGIC_VECTOR (7 downto 0);
  34. S : in STD_LOGIC_VECTOR (2 downto 0);
  35. Y : out STD_LOGIC);
  36. end MUX_8x1;
  37.  
  38. architecture Behavioral of MUX_8x1 is
  39.  
  40. begin
  41.  
  42. process (S,I)
  43. begin
  44. case S is
  45. when "000" => Y <= I(0);
  46. when "001" => Y <= I(1);
  47. when "010" => Y <= I(2);
  48. when "011" => Y <= I(3);
  49. when "100" => Y <= I(4);
  50. when "101" => Y <= I(5);
  51. when "110" => Y <= I(6);
  52. when "111" => Y <= I(7);
  53. when others => Y <= '0';
  54. end case;
  55. end process;
  56.  
  57. end Behavioral;
Add Comment
Please, Sign In to add comment