[an error occurred while processing this directive]
|
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity counter is
port (
CLK : in std_logic;
CLR : in std_logic;
Q : out std_logic_vector(15 downto 0)
);
end entity;
architecture counter_arch of counter is
signal TEMP_Q : std_logic_vector(15 downto 0);
begin
process(CLK)
begin
if rising_edge(CLK) then
if CLR = '1' then
TEMP_Q <= (others => '0');
else
TEMP_Q <= TEMP_Q + 1;
end if;
end if;
end process;
Q <= TEMP_Q;
end architecture;
E-mail: info@telesys.ru