Altera_Forum
Honored Contributor
8 years agoFlex 10k LPM_ADD_SUB issue
Hi There!
Not sure if this has been addressed but instantiating an lpm_add_sub function with carry in- and out under 9.0sp2 (IIRC) for Flex 10K seems to have some peculiar behavior. The add / adc works as advertised whereas the sub/sbc seems to have... problems. For instance, using unsigned 8-bit, subtracting one from 128 (0x80) results in 0x7e *with* a carry, which obviously is wrong.. The reason I've been going for LPM functions for some of these is that they're more resource friendly as the synthesis isn't all that great in recognizing counters, adders, etc. I'll poke around tonight and isolate it but without carry in/out, I've never had issues IIRC. -Mux Edit: Isolating the addsub function and running the same values as the waveforms seems to give the correct result, so I guess I need to double check what's wrong.. Will let you folks know for completeness!