Altera_Forum
Honored Contributor
16 years agoGenerate 1Hz clock from a 50MHz clock
I want to generate 1Hz clock with 50% duty from 40MHZ input clock to MAX II CPLD.
I had known to keep the 40MHz clock as input then use the generated 1Hz clk signals from the counter divisions as enable. And I have saw some posts said that the most straighforward way is to generate a 1Hz clock by using a counter: toggle the 1Hz clock every 20_000_000 cycles of the 40Mhz clock. (no. 21981) However, this method will require a large counter (25 bits or so) running at 40 Mhz. I have another idea that to use some smaller counter to generate the 1Hz clock: firstly to generate a 400K clock by using a smaller counter of 6 bit (range from 1 to 50), then use another counter to generate a 4KHz clock, then to generate 40HZ clock, then to 1Hz clock. This method needs three counter of 6bit (range from 1 to 50) and one 5bit counter (range from 1 to 20). Can anyone help to tell what difference between the two methods (one large counter, some smaller counters)? Which method is more efficient in using CPLD's resources (LE, LUT, etc.) ps. i am working in VHDL.