## Pascal

Moderators: None (Apply to moderate this forum)
Number of posts: 14004

This Forum Only

I know this is not PASCAL specific but has anyone ever found out...... Posted by DrMarten on 17 Mar 2005 at 6:33 PM
This message was edited by DrMarten at 2005-3-17 18:34:38

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?

Re: I know this is not PASCAL specific but has anyone ever found out.. Posted by zibadian on 17 Mar 2005 at 6:59 PM
: This message was edited by DrMarten at 2005-3-17 18:34:38

: 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.
Re: I know this is not PASCAL specific but has anyone ever found out.. Posted by DrMarten on 17 Mar 2005 at 7:13 PM

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?

Re: I know this is not PASCAL specific but has anyone ever found out.. Posted by zibadian on 17 Mar 2005 at 11:04 PM
:
: 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.
Re: I know this is not PASCAL specific but has anyone ever found out.. Posted by bpajk on 18 Mar 2005 at 8:40 AM
: :
: : 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.

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic