Facebook
From a, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 185
  1. Library IEEE;
  2. use IEEE.STD_LOGIC_1164.All;
  3.  
  4. entity z1 is
  5. port(
  6. Ledr : out std_Logic_vector(2 downto 0);
  7. sw : in std_Logic_vector(2 downto 0);
  8. );
  9. architecture z1 of zad1 VHDL is
  10. begin process(sw)
  11. begin
  12. case sw is
  13. when
  14.         "000" => ledr <= "000";
  15.         "001" => ledr <= "100";
  16.         "010" => ledr <= "001";
  17.         "011" => ledr <= "010";
  18.         "100" => ledr <= "010";
  19.         "101" => ledr <= "110";
  20.         "110" => ledr <= "011";
  21. end case;
  22. end process;
  23. end z1;