even or odd

C

crazyrdx

Guest
If I need to check whether I have an even clock cycle or odd, how can I
do it? should I use a counter? If using a counter, do I %2 it to check
if it returns 0 or 1? Is there an easier way to check for even or odd
clock cycles?

thanks
 
crazyrdx wrote:
If I need to check whether I have an even clock cycle or odd, how can I
do it? should I use a counter? If using a counter, do I %2 it to check
if it returns 0 or 1? Is there an easier way to check for even or odd
clock cycles?

thanks

Yes, use a T type flip flop. Thjis is a flip flop that toggles every
clock cycle, and may be created with any primitive flip flop type.

And, in a HW independent manner:

process(reset,clock)
begin
if reset='1' then
state<='0';
elsif rising_edge(clock) then
state<=not state;
end if;
end process;
output<=state;

If you fill in the holes left, you will have a full functioning, optimal
"odd-even" cycle detector.

Regards
 
plz write ur question in more details.what do u mean by even and odd
clocks??
 

Welcome to EDABoard.com

Sponsor

Back
Top