I know this is not PASCAL specific but has anyone ever found out......

[b][red]This message was edited by DrMarten at 2005-3-17 18:34:38[/red][/b][hr]I know this is not PASCAL specific but has anyone ever found out the algorithims that a processor uses for higher functions like COSINE etc when all a processor can really do is ADD ( at machine code level )?

SUBTRACTION is the ADDITON of a NEGated number like > 5-2 is +5+-2 ( in the binary form )

So most coders know MULTIPLY is ( ADDITION repeated ) and DIVISION is ( the ADDITION of NEGated numbers repeated and counted ).

I am just curious as I am am thinking of writing a program that does some number crunching etc.

Comments

: [b][red]This message was edited by DrMarten at 2005-3-17 18:34:38[/red][/b][hr]: I know this is not PASCAL specific but has anyone ever found out the algorithims that a processor uses for higher functions like COSINE etc when all a processor can really do is ADD ( at machine code level )? : : SUBTRACTION is the ADDITON of a NEGated number like : > 5-2 is +5+-2 ( in the binary form ) : : So most coders know MULTIPLY is ( ADDITION repeated ) and : DIVISION is ( the ADDITION of NEGated numbers repeated and counted ). : : I am just curious as I am am thinking of writing a program that does some number crunching etc. : : Is there a book on this MACHINE CODE subject area, anyone know? : : : I think that things like sine and cosine are burned into the FPFU of the processor and are actually done using the microprogramming. I have found the assembly code for the tan, which is FPTAN. It is possible to get an estimate of the sine using polynomials, which should be covered in any good mathematics book.

: : Okay thanks, I am still curious though as someone has obviously "worked out" how to do these things with just the on-offs of the binary switches or transistor gates ( if you like ).: : Some ASSEMBLERS only let you do ADD,SUBTRACT,MUL,DIV etc with all the comparison functions like BGT ( Branch if Greater Than ) and the ROTATE functions etc.: : So does anyone know TRIG functions etc as algorithim's in ASSEMBLY language then?: : I would suggest that you ask this in the assembly board or perform a google search. As I've posted earlier, it is possible to approximate trig functions using polynomials.

: : : : Okay thanks, I am still curious though as someone has obviously "worked out" how to do these things with just the on-offs of the binary switches or transistor gates ( if you like ).: : : : Some ASSEMBLERS only let you do ADD,SUBTRACT,MUL,DIV etc with all the comparison functions like BGT ( Branch if Greater Than ) and the ROTATE functions etc.: : : : So does anyone know TRIG functions etc as algorithim's in ASSEMBLY language then?: : : : : I would suggest that you ask this in the assembly board or perform a google search. As I've posted earlier, it is possible to approximate trig functions using polynomials.: For calculating such functions computer uses Taylor series. This is an unlimited serie. With this method you can calculate such functions as acurate as you want if you sum up the Taylor polinom.