Hello Champs!
I got the information for more efficient calculation of multiplication and division which called Horner and Horner+CSD method from SLAA329 document.
Here's the link.
http://www.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=slaa329&docCategoryId=1&familyId=342
http://www.ti.com/lit/an/slaa329/slaa329.pdf
http://www.ti.com/litv/zip/slaa329
What I want to know of these source code is as below.
- In case of div_int.c they just use one parameter in the horner function.
ie) result3 = div_horner_int(input) - I think two parameters should be needed in the parameter(input and divisor), but there's no documents represented this in the web site.
- And I tested with changing input and divisor value, but the result show wrong value.
- So if you have any modified functions(Horner, Horner+CSD) regarding slaa329 document, please let me know.
------------------------------------------------
cf) Here's the test source code in slaa329
#include <stdio.h>
#include <msp430xG43x.h>
int div_c_int(int,int);
int div_horner_int(register int);
int div_csd_int(register int);
int div_hamacher(register int, register int);
int input=9280; // If we change this variable, some result show wrong answer.
int divisor=41; // If we change this variable, some result show wrong answer.
int result1,result2,result3,result4;
int div_c(int x, int y) // C routine for division
{
return(x/y);
}
main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT.
FLL_CTL0 |= XCAP18PF; // Configure load caps.
result1=div_c(input,divisor); // C routine called for division
result2=div_hamacher(input,divisor);
result3=div_horner_int(input); // I think this code should have two parameters for calculating divide operation.
result4=div_csd_int(input); // I think this code should have two parameters for calculating divide operation.
__no_operation(); // for breakpoint
while(1);
}