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.

the calculation of inverse operation and power operation are not correct on the DSP TMDSDK6416-t

hy ,

i need technical help 

i have my own C code that i am trying to run on the DSP TMDSDK6416-t . 

my code use the library BigDigits as the calculations are using key length 1024 bits 

all the operations are working well except the Inverse operation and the Power operation 

all the inverse operation results are 1 

and all the power operation result are 0 

the same code exactly is working very accurate on the Microsoft visual studio 

but  using the code composer this  2 functions are not calculating correct 

any help !!!

  • Hi,

    Your query is not device specific and moving your post to code composer studio (CCS) forum to be better answered.

    Thanks & regards,

    Sivaraj K

  • Hi,

    Unfortunately with that level of detail is almost impossible to know where the issue may be coming from. It could be one or a range of factors that can be originated from the library you are using (is it this one?), an invalid call to the functions you are using (a usage error), or even a bug on its code.

    Being a third party library, we here have very limited power to figure out its internals. Also, it is also possible the failing functions may require some effort to change its code to be compatible with a C6000 DSP (the library seems to be ported only for specific architectures) - in other words, the code may not be platform independent.

    After verifying all these details you will probably either find and fix the issue or have some specific topics related to how the device behaves given a specific instruction is done (which the experts at the device forum would know better) or how the compiler should have addressed a specific operation (which the experts at the compiler forum would know better).

    In all cases, we here in the CCS forum will probably only be able to redirect this question to a more appropriate forum as soon as you are able to debug the internals of these functions you mentioned.

    Hope this helps,

    Rafael

     

  •  I would like to ask what is the best library that i could use on code composer V3 on TMDSDSK6416-T dsp kit 

    my code are working on large numbers i did use the Big digit library 

    http://www.di-mgt.com.au/bigdigits.html

    but the results are not correct 

    i did compare the same code on visual studio and it generate the correct results 

    but on the code composer the results are wrong . 

    i  did create a simple code that multiply a number then get the imverse of it 

    but the results are also not correct 

    i will past this simple code 

    but meanwhile , i need your feedback about what is the best library to be used with the above device to work on large numbers calculations ?

  • here it is a simple code that  i am trying it 


    #include <stdio.h>
    #include "hello.h"

    #include <string.h>

    #include "bigdigits.h"
    #include "bigdtypes.h"
    #include "bigd.h"


    #define BUFSIZE 30
    #define FILEIO 1
    struct PARMS str =
    {
    2934,
    9432,
    213,
    9432,
    &str
    };


    /*
    * ======== main ========
    */
    void main()
    {

    char *p_IN="3167";
    char *q_IN="1583";
    char *g_IN="44";
    BIGD p, q, g;
    BIGD Xa, Ya, Xb,Yb;

    BIGD temp1 , temp2,temp3,temp4;
    char charNo[1024];
    unsigned short int No;

    puts("hello world111111!\n");
    p = bdNew();
    q = bdNew();
    g = bdNew();
    Xa = bdNew();
    Ya = bdNew();
    bdConvFromDecimal(p,p_IN);
    bdConvFromDecimal(q,q_IN);
    bdConvFromDecimal(g,g_IN);
    bdSetShort(Xa,79);
    Ya = bdNew();
    temp1=bdNew();
    temp2=bdNew();
    bdConvToDecimal(Xa,charNo,sizeof(charNo)); /// convert the value of X into Character
    No=atoi(charNo);
    bdPower(temp1,g,No);
    bdPrintDecimal(" \n g ^xa= ",temp1, "\n");
    bdModulo(temp2,temp1,p);
    bdPrintDecimal(" \n temp2 = ",temp2, "\n");
    bdModInv(Ya,temp1,p);
    bdPrintDecimal("Alice's privarte Key :Xa= ", Xa, "\n");
    bdPrintDecimal("Alice's public Key :Ya= (g^-Xa) mod p =", Ya, "\n\n");
    printf("press any key to exist\n");
    /* write a string to stdout */
    puts("hello world!\n");
    getchar();
    getchar();

    }

    on micorosoft visual studio Ya has a value 

    but when run it on dsp 

    the Ya has value 0 or 1 

    which is not correct 

    i am sure that the results on the visual studio are correct 

    why on DSP not working 

    the library are in the link in the previous post 

    Need help