library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; entity V74x163a is port ( CLK, CLR_L, LD_L, ENP, ENT: in STD_LOGIC; D: in STD_LOGIC_VECTOR (3 downto 0); Q: out STD_LOGIC_VECTOR (3 downto 0); RCO: out STD_LOGIC ); end V74x163a; architecture V74x163a_arch of V74x163a is signal IQ: UNSIGNED (3 downto 0); begin process (CLK, ENT, IQ) begin if (CLK'event and CLK='1') then if CLR_L='0' then IQ <= (others => '0'); elsif LD_L='0' then IQ <= UNSIGNED(D); elsif (ENT and ENP)='1' then IQ <= UNSIGNED(D) + 1; end if; end if; if (IQ=15) and (ENT='1') then RCO <= '1'; else RCO <= '0'; end if; Q <= CONV_STD_LOGIC_VECTOR(IQ,4); end process; end V74x163a_arch;