Forum Discussion
Altera_Forum
Honored Contributor
13 years agoRefer to my correction of code above. Moreover you can factorise your values of 50MHz and new clock by dividing each by 5 then use modulo 10000000 instead saving few bits on adder.
Notice this adder is a general case for any rate below clock rate and is equivalent to using explicit counters (which are adders anyway) for example to get half clock out of 50000000 then you will say add 25000000 modulo 50000000 then factorise it to the ratio 2:1 hence add 1 modulo 2 which is what we do by just having 1 bit toggle without the hassle of modulo but modulo serves a good generic concept.