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 agoYour 12bit data ranges from 0 to 4095, then if you divide it by 100 you simply lose the last two digits, namely 6-7 less significant bits of original data.
A better solution would be starting with the multiplication into a 18bit register and THEN dividing by 100.