dave kellogg

Implementing Guard Bits for EMACS Instruction

Discussion created by dave kellogg on Nov 18, 2009
Latest reply on Nov 22, 2009 by kef

The EMACS instruction has no guard bits natively implemented, to accommodate overflow when accumulating the 32-bit result. 


Has anyone worked out the logic to implement a "manual" guard byte?

I'm interested in the fastest method possible, since my EMACS instruction is in the "hot spot" in a FIR filter loop.


It seems that the basic strategy is to check the overflow flag after the EMACS, and increment (or decrement) the guard byte.  The EMACS accumulator in memory also needs to be adjusted correspondingly.