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
begin
   wait until hor = '1' ; -- commandes synchrones
      if raz ='0' then -- mise à zéro prioritaire
         cpt <= (others => '0') ;
      elsif en = '0' then
-- comptage actif à '0'
         cpt <= incremente(cpt) ;
      end if ; -- par défaut : mémoire
end process ;
end fonc ;