Pascal

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

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
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?




Report
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.
Report
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?



Report
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.
Report
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
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.