Forum Discussion
Altera_Forum
Honored Contributor
10 years agoPercentage calculation in VHDL
Hi All, I am using MAX10 FPGA and need to calculate percentage. My data is 12 bit long. So I take the data, divide it by 100 by using the LPM_DIVIDE IP. I take the Quotient and multiply it to t...
Altera_Forum
Honored Contributor
10 years agoouh...
first you do multiplication and store intermediate result with more than required bits , then you do division. <- this works well. i don't know the number range you deal with. ( but if it doesn't break your accuracy you can replace division by 100 = 2^2 * 25 with division by 96 = 2^5 * 3 it means that at least 5 bits of operand looses)