inkrementalis jelado feldolgozas

Zoltán Radó elektro1.zrado at axelero.hu
Fri Feb 10 15:50:24 CET 2006


Hello Tauri,

Friday, February 10, 2006, 7:46:25 AM, you wrote:

O.. Egyre szebb, amit csinálsz! :-)

Üdv.: Zoli

> sync: process(eclk)
> begin
>         if eclk'event and eclk = '1' then
>                 sync_a <= enc1_a;
>                 sync_b <= enc1_b;

>                 old_a <= sync_a;
>                 old_b <= sync_b;
>         end if;
> end process;

> count: process(eclk,clear)
> begin
>         if clear = '0' then
>                 pos <= (others => '0');

>         elsif eclk'event and eclk = '1' then
>                 if ((old_a = old_b) and (old_a /= sync_a)) or ((old_a /= old_b) and (old_b /= sync_b)) then
>                         pos <= pos -1;
>                 end if;
>                 if ((old_a = old_b) and (old_b /= sync_b)) or ((old_a /= old_b) and (old_a /= sync_a)) then
>                         pos <= pos +1;
>                 end if;
>         end if;
> end process;












More information about the Elektro mailing list