"Amontec, Larry" <> wrote in message
news:...
> Patrick wrote:
> > i have implemented this vhdl code for divide the clock
> > p1 : process (clk_chip)
> > variable compteur : integer range 0 to 11;
> > begin
> > if (clk_chip'event )then
> > if reset='1' then
> > compteur := 1;
> > else if compteur >= 11 then
> > compteur := 1;
> > else
> > compteur := compteur + 1;
> > end if;
> > end if;
> > if compteur >= 6 then
> > clock_bit <= '0';
> > else
> > clock_bit <= '1';
> > end if;
> > end if;
> > end process p1;
> >
> > but the counter not count the two edge !!
> >
> > have you any idea ?
>
> Some VHDL rules:
Huh? Where did you get these "rules"?
>
> - do not use variable, but use signal
The use of variables should be fine in this case, if your synthesis
tools can handle it.
> - if possible use asynchronous reset
In general, asynchrounous resets are problematic. I would recommend
synchronous resets wherever possible.
> - if possible do not use >= but only = , you will save in your clock
compteur is defined as having a range of 0 to 11 so the >= comparison is
unnecessary because the variable can never be > 11. Also, you defined
the range as 0 to 11 but in your code compteur never has a value of 0,
so the range should probably be 1 to 11.
> frequency
>
> Laurent
> www.amontec.com
> ------------ And now a word from our sponsor ------------------
> For a quality usenet news server, try DNEWS, easy to install,
> fast, efficient and reliable. For home servers or carrier class
> installations with millions of users it will allow you to grow!
> ---- See http://netwinsite.com/sponsor/sponsor_dnews.htm ----