LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;use IEEE.std_logic_signed.all;use IEEE.std_logic_arith.all;ENTITY CNT16 ISPORT (CLK,RST,EN: IN STD_LOGIC; CQ:OUT STD_LOGIC_VECTOR(3 DOWNTO 0); COUT:OUT STD_LOGIC);END CNT16;ARCHITECTURE behav OF CNT16 ISBEGINPROCESS (CLK, RST,EN) VARIABLE CQI :STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN IF RST='1' THEN CQI:=(OTHERS=>'0'); ELSIF CLK'EVENT AND CLK='1' THEN IF CQI<9 THEN CQI :=CQI+1; ELSE CQI:=(OTHERS=>'0'); END IF; END IF;IF CQI=9 THEN COUT<='1';ELSE COUT<='0'; END IF; CQ<=CQI; END PROCESS; END behav;