Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frequency Divider

Status
Not open for further replies.

manofwax1

MIS
Feb 27, 2007
1
US
Dear all,
I'm working on an assignment, and I'm stucked. Please help.
I'm asked to write a simple program.
Input: CLKIN. Output: CLKOUT.
The frequency of CLKIN is five times faster than CLKOUT. I came out with a couple solutions, such as, johnson counter, and regular counter. But I was told that the output can only happen at EITHER the rising edge OR the falling edge of the input CLKIN, but not both.

|--|__|--|__|--|__|--|__|--|__|
|____________|----------------|

^
|___how do I change the output at the falling edge when the process any happen at rising edge??

process(CLKIN)
if(CLKIN'EVENT and CLKIN = '1')
....
....
 

if(CLKIN'event) then

if(CLKIN = '1') then

-- write code for the rising edge

elsif(CLKIN = '0') then

-- write code for the falling edge

end if;

end if;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top