LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY CNT2_18T IS PORT(CO2:IN STD_LOGIC; Q:OUT STD_LOGIC); END CNT2_18T; ARCHITECTURE bhv OF CNT2_18T IS SIGNAL Q1:STD_LOGIC_VECTOR(0 TO 17); BEGIN PROCESS(CO2) BEGIN IF CO2'EVENT AND CO2='1' THEN IF Q1<249999 THEN Q1<=Q1+1; Q<='0'; ELSif Q1=249999 then Q1<=(others=>'0'); Q<='1'; END IF; END IF; END PROCESS; END bhv;