This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28375S: What is the result if the input of CLAcosPU() is out of [-1,1]?

Part Number: TMS320F28375S

Hi,

I'm using CLAcosPU() in CLA and just curious about the input parameter range of this function. I found the description in datasheet shown below. I have two questions about this:

1. What if the input parameter is out of the range [-1 1]?

2. How DSP select the values of K and X?

  • Yuzheng Chen said:
    1. What if the input parameter is out of the range [-1 1]?

    The function has been written with this constraint.  Values outside of this range  may not produce the desired result. 

    Yuzheng Chen said:
    2. How DSP select the values of K and X?

    If you look at the assembly source code for the function, the comments explain where the values K and X are stored in tables used by the function

    ; MR3 = K = integer(radPU*TABLE_SIZE*Pi/(2*Pi))
    ; MR3 = K & TABLE_MASK
    ; MR3 = K * 2
    ; MAR0 = address of Sin(K)
    ; MR1 = frac(TABLE_SIZE*radPU*Pi/2*Pi)
    ; MR0 = 2*Pi/TABLE_SIZE
    ; MR1 = X = frac(TABLE_SIZE*radPU*Pi/2*Pi) * (2*Pi/TABLE_SIZE)
    ; MR0 = Coef3_neg

    Regards

    Lori

  • Thank you very much for your answer