Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------
- -- Company:
- -- Engineer:
- --
- -- Create Date: 14:33:10 03/16/2019
- -- Design Name:
- -- Module Name: LED_kod - Behavioral
- -- Project Name:
- -- Target Devices:
- -- Tool versions:
- -- Description:
- --
- -- Dependencies:
- --
- -- Revision:
- -- Revision 0.01 - File Created
- -- Additional Comments:
- --
- ----------------------------------------------------------------------------------
- library IEEE;
- use IEEE.STD_LOGIC_1164.ALL;
- -- Uncomment the following library declaration if using
- -- arithmetic functions with Signed or Unsigned values
- --use IEEE.NUMERIC_STD.ALL;
- -- Uncomment the following library declaration if instantiating
- -- any Xilinx primitives in this code.
- --library UNISIM;
- --use UNISIM.VComponents.all;
- entity LED_kod is
- Port ( SW_30 : in STD_LOGIC_VECTOR (3 downto 0); -- liczby
- SW_74 : in STD_LOGIC_VECTOR (7 downto 4); -- kropki
- BTN : in STD_LOGIC_VECTOR (3 downto 0); -- BT3 BT2 BT1 BT0
- AN : out STD_LOGIC_VECTOR (3 downto 0); -- AN3 AN2 AN1 AN0
- SEGM : out STD_LOGIC_VECTOR (6 downto 0); -- 6G 5F 4E 3D 2C 1B 0A
- DOT : out STD_LOGIC); -- kropka
- end LED_kod;
- architecture Behavioral of LED_kod is
- begin
- Aktywacja: process (BTN, SW_30) -- nie wiem czy SW_30 konieczne
- begin
- case BTN is
- when "0001" => AN <= "1110";
- when "0010" => AN <= "1101";
- when "0100" => AN <= "1011";
- when "1000" => AN <= "0111";
- when others => AN <= "1111";
- end case;
- case SW_30 is
- when "0000" => SEGM <= "1000000";
- when "0001" => SEGM <= "1111001";
- when "0010" => SEGM <= "1101000";
- when "0011" => SEGM <= "0110000";
- when "0100" => SEGM <= "0011001";
- when "0101" => SEGM <= "0010010";
- when "0110" => SEGM <= "0000010";
- when "0111" => SEGM <= "1111000";
- when "1000" => SEGM <= "0000000";
- when "1001" => SEGM <= "0010000";
- when "1010" => SEGM <= "0001000";
- when "1011" => SEGM <= "0000011";
- when "1100" => SEGM <= "1000110";
- when "1101" => SEGM <= "0100001";
- when "1110" => SEGM <= "0000110";
- when "1111" => SEGM <= "0001110";
- when others => SEGM <= "1111111";
- end case;
- end process;
- -- Kropki : process (SW_74)
- -- begin
- -- if SW_74(4) = '1' then
- -- AN(0) <= '0';
- -- DOT <= '0';
- -- elsif SW_74(5) = '1' then
- -- AN(1) <= '0';
- -- DOT <= '0';
- -- elsif SW_74(6) = '1' then
- -- AN(2) <= '0';
- -- DOT <= '0';
- -- elsif SW_74(7) = '1' then
- -- AN(3) <= '0';
- -- DOT <= '0';
- -- end if;
- -- end process;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement