-- Contador empleando la instrucción loop

- Declaración de la entidad
Entity contador is
port (

ck: in bit;
tc: out bit);

end contador ;

-- Definición de la arquitectura
Architecture secuencial of contador is

begin

Process
Variable c: natural :=0;
Begin

Loop

wait until ck='1';
c := (c + 1) mod 16;
If c = 15 then tc <= '1';
Else tc <= '0';
End if;

End loop;

End process;

end secuencial;


WcN - Joan Oliver. Diseño de circuitos digitales con VHDL