Setting Registerbits for Saturation Arithmetic

Hi,

I´m using the ADSP-SC584 with the respective Evaluationboard and Cross Corse 2.8.3.

I wanted to use Saturatioan Arithmetic to preventing my Data from overflowing. 

In the Document "SHARC+ Core Programming Reference" I found the following:

  ALU Saturation

When the REGF_MODE1.ALUSAT bit is set (= 1), the ALU is in saturation mode. In this mode, positive fixedpoint overflows return the maximum positive fixed-point number (0x7FFF FFFF), and negative overflows return the maximum negative number (0x8000 0000). When the REGF_MODE1.ALUSAT bit is cleared (= 0), fixed-point results that overflow are not saturated, the upper 32 bits of the result are returned unaltered.

I´m pretty new to this topic and dont know how to set this bit. And also I´m confused about the fact that the saturation is for fixedpoint numbers. The ADSP-SC584 is a floating-point DSP, will this work with floating-point too?

 

Looking for help

Regards

Viktor

  • Hello,

    Regarding,"I´m pretty new to this topic and dont know how to set this bit."
    >>The below assembly Bit set instruction is used to set the ALUSAT bit from the MODE1 register of ADSP-SC58x Processors.
    asm("BIT SET MODE1 0x00002000;");         

    >>The below assembly Bit Clear instruction is used to set the ALUSAT bit from the MODE1 register of ADSP-SC58x Processors.
    asm("BIT CLR MODE1 0x00002000;");

    You can use the above instructions when programming the ADSP-SC58x Processors via CCES software.

    Regarding,"And also I´m confused about the fact that the saturation is for fixedpoint numbers. The ADSP-SC584 is a floating-point DSP, will this work with floating-point too?"
    >> The fixed point and floating point overflow has a exception/interrupts to handle. In addition fixed point overflows can be prevented by using ALUSAT bit.

    Hope this helps.

    Regards,
    Lalitha