Altera_Forum
Honored Contributor
13 years agoHow to use multiple megafunctions
Hi,
I want to create a program where it reads in some values, divide the values by a certain coefficient, multiple them by another coefficient and then finally output them. I read in the values and store them using the flip-flip storage megafunction (lpm_ff). I divide the stored values by a certain coefficient using the divide megafunction (lpm_divide). But for some reason i can't multiple the results from the divide using the multiple megafunction (lpm_mult). I just get a plain 0 output. I can multiply the values stored in the flip flops and it works but not the result of the divide. I've tried putting in another storage block of flip-flips to store the values calculated from the divide but it doesn't work. I've also tried multiplying the values first and then dividing them but this doesn't work either. I have no other logic in the program other than the megafunctions. So i have no always block or anything. I've managed to successful create a moving average filter this way, so i assumed it would work for other programs. I've set it up so that none of the megafunctions have an enable line. So they should always be operating all of the time at the moment. I feel like i'm missing something fundamental but i just can't seem to work it out. Your help is much appreciated.