Altera_Forum
Honored Contributor
14 years agoAdder in LPM seems to be weird
Hello all,
I have met a something weird in an adder in LPM and need your help or suggestion. My signal is two 16 bits from NCOs which are signed numbered. And the adder is just summing those two numbers. To prevent an overflow, I used a carry out bit (cout). The final output bit-width is 17 bits (1 bit cout + 16 bit of the summed data) and later on, I will take first 16 bits from the MSB (1 bit cout + first 15 bits of the summed data). I ran a simulation but the output is wrong whenever datab port data is negative (result = dataa + datab; the result is wrong whenever datab is negative). Since I am using two sine and cosine waves, the sum of those is a something smooth wave but if you look at the screen capture which is also attached, there is abrupt change. Could anyone let me know how can I resolve this? Thanks,