Forum Discussion
Altera_Forum
Honored Contributor
12 years ago --- Quote Start --- Ok Kaz, but this way you need more system resources, I mean logic gates in fpga or computation time in a programming language. In other words you are still implementing some sort of division algorithm. I would keep on my idea, which is also the one exploited by the sample code at start of this thread: if you don't mind the x1000 (or whatever) factor you can quietly avoid the division. If you later need to compare this 'average x 1000' with something else, it will be easier to multiply this one x1000 than dividing the average result. --- Quote End --- Yes I needed two adders (not that bad as a divider). I agree you don't need to divide if you want the sum rather than the average but in many cases we do need the average itself over a given time window.