3.3.12.3.3 Data Space Write Saturation

In addition to adder/subtractor saturation, writes to data space can be saturated without affecting the contents of the source accumulator. This feature allows data to be limited, while not sacrificing the dynamic range of the accumulator during intermediate calculation stages. Data space write saturation is enabled by setting the data space write from the DSP Engine Saturation Enable (SATDW) control bit (CORCON[5]). Data space write saturation is enabled by default at a device Reset.

The data space write saturation feature works with the SAC and SACR instructions. The value held in the accumulator is never modified when these instructions are executed. The hardware takes the following steps to obtain the saturated write result:

  1. The read data are scaled based upon the arithmetic shift value specified in the instruction.
  2. The scaled data are rounded (SACR only).
  3. The scaled/rounded value is saturated to a 16-bit result based on the value of the guard bits. For data values greater than 0x007FFF, the data written to memory are saturated to the maximum positive 1.15 value, 0x7FFF. For input data less than 0xFF8000, data written to memory are saturated to the maximum negative 1.15 value, 0x8000.