-- 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
Process
Variable c: natural :=0;
BeginLoop
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;