PDF-version

How Do Calculators Calculate?

Helmut Knaust
Department of Mathematical Sciences
University of Texas at El Paso


Introduction

We give an introduction to the CORDIC method used my most handheld calculators (such as the ones by Texas Instruments and Hewlett-Packard) to approximate the standard transcendental functions.

The CORDIC algorithm does not use Calculus based methods such as polynomial or rational function approximation.

The CORDIC (= COordinate Rotation DIgital Computer) algorithm was developed by Jack E. Volder in 1959.

His objective was to build a real-time navigational computer for use on aircrafts, so he was primarily interested in computing trigonometric functions.

Subsequently, the CORDIC scheme was extended by J. Walther in 1971 to other transcendental functions.


Hand-held calculators do not convert numbers to base 2. They use a binary-coded decimal (BCD) system instead.

Calculators can only perform four operations inexpensively:

  1. Addition and Subtraction
  2. Storing in memory and Retrieving from memory
  3. Digit shift (multiplication/division by the base)
  4. Comparisons

The CORDIC Algorithm is a unified computational scheme to perform

  1. multiplication and division
  2. computations of the trigonometric functions tex2html_wrap_inline225
  3. computations of the hyperbolic trigonometric functions tex2html_wrap_inline227
  4. and consequently can also compute the exponential function, the natural logarithm and the square root


The CORDIC Algorithm (Binary Version)

eqnarray61


An Example:

Computing tex2html_wrap_inline233 and tex2html_wrap_inline235

To compute tex2html_wrap_inline237 and tex2html_wrap_inline239 for tex2html_wrap_inline241 we let

displaymath211

We also define

displaymath212

The scheme becomes

eqnarray81

The Cordic Representation Theorem

Suppose tex2html_wrap_inline243 is a decreasing sequence of positive real numbers satisfying

displaymath213

for tex2html_wrap_inline245 , and suppose r is a real number such that

displaymath214

If tex2html_wrap_inline249 , and tex2html_wrap_inline251 , for tex2html_wrap_inline253 , where

displaymath215

then

displaymath216

Proof: By induction.

The previous Theorem and some computations tell us that it is basically possible to write the angle tex2html_wrap_inline255 as a combination of the angles tex2html_wrap_inline257 , more precisely, we can choose tex2html_wrap_inline259 so that

displaymath217

Set tex2html_wrap_inline261 . We then have the following

Theorem. If tex2html_wrap_inline263 and tex2html_wrap_inline265 , then tex2html_wrap_inline267 and tex2html_wrap_inline269.

Proof (by induction, sketch):

eqnarray121


Implementation for various functions:

Trigonometric Functions

tex2html_wrap_inline271

  1. tex2html_wrap_inline273 , tex2html_wrap_inline275 :


    tex2html_wrap_inline277 , tex2html_wrap_inline279 ,
    tex2html_wrap_inline281 , tex2html_wrap_inline265 , tex2html_wrap_inline285

  2. tex2html_wrap_inline287 :


    tex2html_wrap_inline277 , tex2html_wrap_inline291 ,
    tex2html_wrap_inline293

Hyperbolic Functions

tex2html_wrap_inline295

  1. tex2html_wrap_inline297 , tex2html_wrap_inline299 ,
    and thus tex2html_wrap_inline301 :


    tex2html_wrap_inline303 (repeated), tex2html_wrap_inline279 ,
    tex2html_wrap_inline307 , tex2html_wrap_inline265 , tex2html_wrap_inline285

  2. tex2html_wrap_inline313 , tex2html_wrap_inline315 ,
    and thus we obtain an approximation of tex2html_wrap_inline317 :


    tex2html_wrap_inline303 (repeated), tex2html_wrap_inline291 ,
    tex2html_wrap_inline293

Multiplication and Division

tex2html_wrap_inline325

  1. tex2html_wrap_inline327 :


    tex2html_wrap_inline329 , tex2html_wrap_inline279 ,
    tex2html_wrap_inline265

  2. tex2html_wrap_inline335 :


    tex2html_wrap_inline329 , tex2html_wrap_inline291 ,
    tex2html_wrap_inline293


References

  1. Charles W. Schelin
    Calculator Function Approximation
    American Math. Monthly 90, 1983, 317-325.
  2. Jack E. Volder
    The CORDIC Trigonometric Computing Technique
    IRE Transcactions EC-8, 1959, 330-334
  3. Richard J. Pulskamp and James A. Delaney
    Computer and Calculator Computation of Elementary Functions
    UMAP Module 708, 1991.


More information can be found on Bruce H. Edwards' Cordic Algorithm page.

Helmut Knaust
Wed Sep 17 12:16:32 MDT 1997. Reference updated Dec 5 2005.