[comp.arch] Cordic Math Algorithms

waw@cup.portal.com (Warren Charles Wong) (05/01/91)

Hello,

Recently, I've come across some terminology regarding floating-pt
algorithms used in PostScript character generations.  A popular one
I've heard is the "Cordix" algorithm.  This one supposedly is used
by some Intel and AMD chips in their laser-printer solutions and
is implemented in hardware.  The algorithm is best noted for its
speed (I think).  Where can I find out more information and who
can I speak to about implementing such an algorithm in software?

I know of a few collegues who are interested in printers/fp solutions
and we're looking into what fp routines are available out there.
Thanks ahead to any one that can shed some light on this subject.

[I've tried to post to comp.laser-printers but am enountering some probs]


Please post/email your replies to

warren%nort@mips.com   or   nort!warren@mips.com


Warren Wong

weaver@jetsun.weitek.COM (Mike Weaver) (05/02/91)

In article <41842@cup.portal.com> waw@cup.portal.com (Warren Charles Wong) writes:
>Hello,
>
>Recently, I've come across some terminology regarding floating-pt
>algorithms used in PostScript character generations.  A popular one
>I've heard is the "Cordix" algorithm...

That's CORDIC (an acronym). I don't have the book here but I believe
there is a reprint of the original paper by Walthers in 'Computer
Aritihmetic', Vol. I, Swartzlander, Ed.

CORDIC is a family of algorithms for computing elementary functions
(trig, hyperblolic trig, polar to/from rectangular coordinates,
rotations, linear transformations, perhaps others). The algorithms are
iterative, and take one iteration per result bit. By my thinking, this
is slow, but speed is relative. On the other hand, the only hardware
required is an adder and a shift by one place. CORDIC has been used
in floating point coprocessors (Motorola 68881 I believe) and hand held
calculators (HP I believe).

If you already have fast floating point hardware, there are probably faster
algorithms. However, if you only have an integer unit, these may be
interesting.

---

Michael Weaver.

jlg@cochiti.lanl.gov (Jim Giles) (05/02/91)

In article <1991May1.171420.11826@jetsun.weitek.COM>, weaver@jetsun.weitek.COM (Mike Weaver) writes:
|> [...]                                               The algorithms are
|> iterative, and take one iteration per result bit. By my thinking, this
|> is slow, but speed is relative. On the other hand, the only hardware
|> required is an adder and a shift by one place.  [...]

Yes, CORDIC is "fast" only in certain contexts.  If you have fast adder
and shift units, but no fast multiply, CORDIC may be the fastest thing
there is.  If you have a fast multiply (that is, one that's not iterative),
then there are other, faster algorithms.

There is, however, one advantage to CORDIC for embedded systems where
space or hardware complexity is a premium and speed is secondary: CORDIC
can use the same hardware (and mostly the same algorithm) to do sin, cos,
arctan, sinh, cosh, arctanh, sqrt, multiply and divide (and probably some
more that I've forgotten).  By composing these functions together, CORDIC
can also give you tan, tanh, ln (natural log), exp, and several others.
That's why it was often chosen by manufacturers of pocket calculators.

J. Giles