Forum Discussion
Altera_Forum
Honored Contributor
15 years agoYou have to add some VHDL code that uses a counter to divide the clock.
For example you create a counter (in VHDL) with the clock as inputclock that counts to a million (or more). And once the counter reaches a million you change the state from the LED (so on or off). A PLL is too complex for this purpose and I doubt that is what you want/need to do. So something like this (this is AHDL, with probably some syntax errors): SUBDESIGN counter ( clock : INPUT; LED_OUT : OUTPUT; ) VARIABLE count[20..0] : DFF; //create a counter that can count to 2^21-1 =1048576 LED : DFF; //help flipflop BEGIN count[].clk = clock; //link clocks LED.clk = clock; count[].d = count[].q+1; //start counting If Counter[21].q==1 Then LED = not LED; //change state Counter = 0; //reset counter end if LED_OUT = LED; //Link help flipflop to output END;