Advertisement
Guest User

Untitled

a guest
Feb 21st, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.31 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    23:53:22 02/20/2014
  6. -- Design Name:
  7. -- Module Name:    Switch_led - 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. use IEEE.std_logic_ARITH.ALL;
  23. use IEEE.std_logic_UNSIGNED.ALL;
  24.  
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx primitives in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity Switch_led is
  35. port(
  36.     Switch_0: in std_logic;
  37.     Switch_1: in std_logic;
  38.     Switch_2: in std_logic;
  39.     Switch_3: in std_logic;
  40.     Switch_4: in std_logic;
  41.     Switch_5: in std_logic;
  42.     Switch_6: in std_logic;
  43.     Switch_7: in std_logic;
  44.     BTN_3: in std_logic;
  45.    
  46.     Led_0: out std_logic;
  47.     Led_1: out std_logic;
  48.     Led_2: out std_logic;
  49.     Led_3: out std_logic;
  50.     Led_4: out std_logic;
  51.     Led_5: out std_logic;
  52.     Led_6: out std_logic;
  53.     Led_7: out std_logic
  54.                         );
  55. end Switch_led;
  56.  
  57. architecture Behavioral of Switch_led is
  58.  
  59. begin
  60. Process(Switch_0, Switch_1, Switch_2, Switch_3, Switch_4, Switch_5, Switch_6 , Switch_7, BTN_3)
  61. begin
  62.     if BTN_3 = '1' then
  63.     Led_0 <= '0';
  64.     Led_1 <= '0';
  65.     Led_2 <= '0';
  66.     Led_3 <= '0';
  67.     Led_4 <= '0';
  68.     Led_5 <= '0';
  69.     Led_6 <= '0';
  70.     Led_7 <= '0';
  71.     else
  72.     end if;
  73.    
  74.     if Switch_0 = '1' then
  75.     Led_0 <= '1';
  76.     else
  77.     Led_0 <= '0';
  78.     end if;
  79.    
  80.     if Switch_1 = '1' then
  81.     Led_1 <= '1';
  82.     else
  83.     Led_1 <= '0';
  84.     end if;
  85.    
  86.     if Switch_2 = '1' then
  87.     Led_2 <= '1';
  88.     else
  89.     Led_2 <= '0';
  90.     end if;
  91.    
  92.     if Switch_3 = '1' then
  93.     Led_3 <= '1';
  94.     else
  95.     Led_3 <= '0';
  96.     end if;
  97.    
  98.     if Switch_4 = '1' then
  99.     Led_4 <= '1';
  100.     else
  101.     Led_4 <= '0';
  102.     end if;
  103.    
  104.     if Switch_5 = '1' then
  105.     Led_5 <= '1';
  106.     else
  107.     Led_5 <= '0';
  108.     end if;
  109.    
  110.     if Switch_6 = '1' then
  111.     Led_6 <= '1';
  112.     else
  113.     Led_6 <= '0';
  114.     end if;
  115.    
  116.     if Switch_7 = '1' then
  117.     Led_7 <= '1';
  118.     else
  119.     Led_7 <= '0';
  120.     end if;
  121. end process;
  122.    
  123. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement