Forum Discussion
Altera_Forum
Honored Contributor
11 years agoDividing numbers by constants without dividers?
Hi! I would like to divide a number by a set of constants (3, 5 or 7) and I have read in an old post that using a divider might be a waste of resources. I have also read that for simple divisio...
Altera_Forum
Honored Contributor
11 years agoFor low numbers of bits, you can also do it using a lookup table. 14bit is starting to get a bit large for this approach, but it could be done in 1 or 2 clock cycles using four M20K's as ROM. Your 14bit number is the address (14b=2^14=16k), and the 1 bit output from each of the four memories forms the result. If you need to do two different divisions, you can use the memory in dual-port mode and be able to do two simultaneous divisions with the same memory.