Hello,
I am working on migrating code from C54x to C64x+. In C54x there was a sine lookup table in ROM. Do we have a similar sine table in C64x+ processors? If so where can I find the address of location of Sine tables of C64x+?
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.
Hello,
I am working on migrating code from C54x to C64x+. In C54x there was a sine lookup table in ROM. Do we have a similar sine table in C64x+ processors? If so where can I find the address of location of Sine tables of C64x+?
Suresh,
I don't believe that the 64x+ family has a sine lookup table. On the C54x, memory space and processor speed was very limited compared to what is available on the C6000 devices. Additionally, data space and code space were completely separated, so you couldn't trade one for the other. Compare 64K of Internal Data Ram on the 5416 and a maximum speed of 160MHz to the C6455, which has 256K of internal data memory and a max speed of 1.2Ghz. If you need a sine table, you should have plenty of power to create your own sine lookup table at init for use in your application. Or, depending on how often you use the sine function, you might find it quicker to just calculate the value at certain times.
Regards,
Dan
Dan,
Thanks for your reply. I want to look at the ROM sine table of C54x. I searched in the TI documents. SPRA618A suggested that ROM contents can be looked at http://www.ti.com/sc/docs/tools/dsp/ftp/c54x.htm. This weblink is not active.
Could you please suggest some ways to get the sine table of C54x ?
Thanks
Suresh
Suresh,
The ROM sine table of the 54x, I believe is a 16-bit fractional representation of the sine (i.e. 0xFFFF = -1, 0x0000 = 0, and 0x7FFF = +1).
So, if you want to calculate these by hand or with excel, I think this is the correct way.
Assume:
N = # of samples in a period of the sine wave
n = the index into the sine table (0-255)
Calculate sin (2*PI*n / N)
Take the result and multiply by 32767 and drop any values after the decimal point. Use this value as your lookup value.
For example, I think these are the correct values for N=256. As you can see, elements 0 and 128 are zero (corresponding to 0 and pi). Element 64 is 32767 (0x7FFF) corresponding to PI/2, and element 192 is -32767 (0xFFFF) corresponding to 3*PI / 2.
int16_t sinetable[256] = {
0, 804, 1607, 2410, 3211, 4011, 4807, 5601, 6392, 7179, 7961, 8739, 9511, 10278, 11038, 11792,
12539, 13278, 14009, 14732, 15446, 16150, 16845, 17530, 18204, 18867, 19519, 20159, 20787, 21402, 22004, 22594,
23169, 23731, 24278, 24811, 25329, 25831, 26318, 26789, 27244, 27683, 28105, 28510, 28897, 29268, 29621, 29955,
30272, 30571, 30851, 31113, 31356, 31580, 31785, 31970, 32137, 32284, 32412, 32520, 32609, 32678, 32727, 32757,
32767, 32757, 32727, 32678, 32609, 32520, 32412, 32284, 32137, 31970, 31785, 31580, 31356, 31113, 30851, 30571,
30272, 29955, 29621, 29268, 28897, 28510, 28105, 27683, 27244, 26789, 26318, 25831, 25329, 24811, 24278, 23731,
23169, 22594, 22004, 21402, 20787, 20159, 19519, 18867, 18204, 17530, 16845, 16150, 15446, 14732, 14009, 13278,
12539, 11792, 11038, 10278, 9511, 8739, 7961, 7179, 6392, 5601, 4807, 4011, 3211, 2410, 1607, 804,
0, -805, -1608, -2411, -3212, -4012, -4808, -5602, -6393, -7180, -7962, -8740, -9512, -10279, -11039, -11793,
-12540, -13279, -14010, -14733, -15447, -16151, -16846, -17531, -18205, -18868, -19520, -20160, -20788, -21403, -22005, -22595
-23170, -23732, -24279, -24812, -25330, -25832, -26319, -26790, -27245, -27684, -28106, -28511, -28898, -29269, -29622, -29956,
-30273, -30572, -30852, -31114, -31357, -31581, -31786, -31971, -32138, -32285, -32413, -32521, -32610, -32679, -32728, -32758,
-32767, -32758, -32728, -32679, -32610, -32521, -32413, -32285, -32138, -31971, -31786, -31581, -31357, -31114, -30852, -30572,
-30273, -29956, -29622, -29269, -28898, -28511, -28106, -27684, -27245, -26790, -26319, -25832, -25330, -24812, -24279, -23732,
-23170, -22595, -22005, -21403, -20788, -20160, -19520, -18868, -18205, -17531, -16846, -16151, -15447, -14733, -14010, -13279
-12540, -11793, -11039, -10279, -9512, -8740, -7962, -7180, -6393, -5602, -4808, -4012, -3212, -2411, -1608, -805
}
Hope this helps!
Regards,
Dan