entity compteur is
  port(hor, en, raz : in bit ;
       compte : out bit_vector(15 downto 0)) ;
function incremente (e : in bit_vector)
-- suite de la définition de la fonction
end incremente ;
end compteur ;

architecture fonc of compteur is
   signal cpt : bit_vector(15 downto 0) ;
begin
   compte <= cpt ;
process(hor, raz) -- deux signaux activent le processus
begin
      if raz ='0' then -- mise à zéro asynchrone
         cpt <= (others => '0') ;
      elsif hor'event and hor = '1' then -- synchrone
         if en = '0' then
-- comptage actif à '0'
            cpt <= incremente(cpt) ;
         end if ; -- par défaut : mémoire
      end if ;
end process
;
end fonc ;