library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity s3_display1234 is port ( CLKIN : in std_logic; AN3 : inout std_logic; AN2 : inout std_logic; AN1 : inout std_logic; AN0 : inout std_logic; LED : out std_logic_vector(6 downto 0)); end s3_display1234; architecture behavioral of s3_display1234 is signal CTR : STD_LOGIC_VECTOR(12 downto 0); begin Process (CLKIN) begin if CLKIN'event and CLKIN = '1' then if (CTR="0000000000000") then if (AN0='0') then AN0 <= '1'; LED <= "0000110"; -- cifra 3 AN1 <= '0'; elsif (AN1='0') then AN1 <= '1'; LED <= "0010010"; -- cifra 2 AN2 <= '0'; elsif (AN2='0') then AN2 <= '1'; LED <= "1001111"; -- cifra 1 AN3 <= '0'; elsif (AN3='0') then AN3 <= '1'; LED <= "1001100"; -- cifra 4 AN0 <= '0'; else LED <= "1001100"; -- cifra 4 AN0 <= '0'; end if; end if; CTR<=CTR+"0000000000001"; if (CTR > "1000000000000") then -- num. ajunge la 2^13 CTR<="0000000000000"; end if; end if; -- CLK'event and CLK = '1' End Process; End Behavioral;