zlotawy wrote:
> Uzytkownik "Al" <> napisal w wiadomosci
> news:eka3cl$7s7$...
>
>>Hi zlotawy,
>>first I suggest you to use more meaningful names (english is preferrable
>>to let other people understand the code) for your states and signals,
>>secondly I just noticed that your wynick signal is not registered and this
>>can be the cause of your "clutters".
>
>
>
> should I not send value direct to port?
>
> By signal, and from signal to port is the same problem.
>
>
> Moreover your zmienna looks
>
>>like a counter, but there is no clock on the process, is this that you
>>want?
>
>
> hmm.....
>
> If i make counter with clock, wynik is beautifull.
>
> "
> process (P_I_CLK,Rst)
> begin
> if (Rst='1') then zmienna <= 0 ;
> elsif (P_I_CLK'event and P_I_CLK='1') then
>
> zmienna<= zmienna+1;
>
> end if;
>
> end process;
>
> process(zmienna)
> begin
> if (zmienna=3) then wynik<="1111";
> else
> wynik<="0000";
> end if;
> "
I wouldn't have done this the same. If your output is not registered it
will have glitches in most of the cases.
KJ's solution for zmienna is exactly what I meant, but it is not enough
to me to have a "clean" wynik.
Try this:
process(P_I_CLK, Rst)
begin
if Rst = '1' then
wynik <= "0000";
elsif (P_I_CLK'event and P_I_CLK='1') then
if zmienna = "11" then
wynik <= "1111";
..... -- al your cases here.
else
wynik <= "0000";
end if;
end if;
end process;
In this case your wynick is registered and it will not show glitches.
>
> But I wanted count how many times, state was Idle...not how many were rising
> clock.
Follow KJ's suggestion to count only when idle.
Cheers
Al
--
Alessandro Basili
CERN, PH/UGC
Hardware Designer
|