library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; LIBRARY lpm; USE lpm.lpm_components.ALL; --function used in the wind speed module entity decadecount is generic (Width : POSITIVE := 4; MODULUS : STRING := "10"); port( clock: IN STD_LOGIC; clk_en: IN STD_LOGIC; cnt_en: IN STD_LOGIC; sclr: IN STD_LOGIC; Carryout: out STD_LOGIC; q: OUT STD_LOGIC_VECTOR(Width -1 DOWNTO 0)); end decadecount; architecture x of decadecount is signal values : STD_LOGIC_VECTOR(15 DOWNTO 0); begin --uses the lpm_counter to increment StartCount : lpm_counter GENERIC MAP (LPM_WIDTH => Width, LPM_TYPE => L_COUNTER, LPM_MODULUS => MODULUS) PORT MAP ( clock=> clock, clk_en=> clk_en, cnt_en=> cnt_en, sclr=> sclr, eq=> values, q => q); Carryout <= values(9); end x;