Forum Discussion
Altera_Forum
Honored Contributor
14 years agoYou better use a modulo adder e.g. add 83 modulo 125 and generate clk en at overflow.
You may try this code, I haven't tested it but I will appreciate if you do and let me know the outcome:
variable count : integer range 0 to 124 := 0;
process
begin
wait until clk50mhz = '1';
if count < 125 then
count := count + 83;
clken <= '0';
else
count := count - 125;
clken <= '1';
end if;
end process;