Forum Discussion
Altera_Forum
Honored Contributor
16 years agofrequency divider
i want ot create frequency divider which devide the frequency by 50 000 000 (so with 50 MHz clock i want ot reach 1 HZ (T=1s)) can i use this code:
library ieee;
use ieee.std_logic_116...
Altera_Forum
Honored Contributor
16 years agoI did not calculate the constant, I just reused your value.
BTW you can replace "000000000" with "(others => '0')" And you can write your constant Like this: constant CLK_PERIOD_NS = 20; -- CLK period in [ns] units constant DESIRED_PERIOD_NS = 1000000000; -- desired period in [ns] units constant TIMER_RELOAD = DESIRED_PERIOD_NS/CLK_PERIOD/2-1; And then just replace "11101110011010110010100000000" with TIMER_RELOAD