je voudrais réaliser la fonction suivante (en vert les entrées du module, en rouge les sorties)

et les ereursvoila mon code
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
Entity compteur is port(
locked, raza, c0 : in std_logic;
pllena : out std_logic;
dout : out std_logic_vector (7 downto 0));
end entity;
architecture compt of compteur is
signal dint, dint_inc : std_logic_vector (7 downto 0);
signal pllena_int : std_logic;
begin
if raza='0' then
if c0 'event and c0='1' then -- sur front montant de l'horloge c0
dint<=dint_inc; -- incrémentation du compteur
end if;
else dint<="00000000"; -- reset du compteur
end if;
if locked='1' then -- si locked vaut 1 on incrémente,sinon non
dint_inc<=std_logic_vector(unsigned(dint)+1);
else dint_inc<=dint_inc;
end if;
if (unsigned(dint)>150) then -- si le compteur dépasse 150, on met pllena
pllena_int<='0'; -- a l'état bas
else pllena_int<='1';
end if;
dout<=dint;
pllena<=pllena_int;
end compt;
je ne comprend pas pourquoi cela ne compile pas...Error (10500): VHDL syntax error at Compteur.vhd(18) near text "if"; expecting "end", or "(", or an identifier ("if" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at Compteur.vhd(19) near text "and"; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at Compteur.vhd(21) near text "if"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
Error (10500): VHDL syntax error at Compteur.vhd(26) near text "else"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at Compteur.vhd(27) near text "if"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
Error (10500): VHDL syntax error at Compteur.vhd(29) near text "then"; expecting "<="
Error (10500): VHDL syntax error at Compteur.vhd(31) near text "else"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a concurrent statement
Error (10500): VHDL syntax error at Compteur.vhd(32) near text "if"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
Quelqu'un peut il m'aider ?
Merci d'avance =)