1 / 21

CSE 8351 Computer Arithmetic Fall 2005 Instructor: Peter-Michael Seidel

CSE 8351 Computer Arithmetic Fall 2005 Instructor: Peter-Michael Seidel. Other than Basic Functions. We have discussed basic arithmetic operations. What about other arithmetic operations? sin(x) x^(1/3) log(x) …. Function Evaluation. Lookup Tables

diep
Download Presentation

CSE 8351 Computer Arithmetic Fall 2005 Instructor: Peter-Michael Seidel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 8351Computer ArithmeticFall 2005Instructor:Peter-Michael Seidel

  2. Other than Basic Functions • We have discussed basic arithmetic operations. • What about other arithmetic operations? • sin(x) • x^(1/3) • log(x) • … Seidel - Fall 2005

  3. Function Evaluation • Lookup Tables • Tables with Function values • Linear Approximations • Polynomial Approximations • reduces Function evaluation to • Table Lookup (ROM,RAM) • Additions • Multiplications • Can also help reduce calculation cost/delay for small sets of operands Seidel - Fall 2005

  4. Taylor Series Approximation • Suppose we have a function which we want to write as: • The coefficients can be determined from the function itself • To determine , let's evaluate the function and the series at : • This shows us that the first coefficient . • Correspondingly, Seidel - Fall 2005

  5. Taylor Series Approximation • Suppose we have a function which we want to write as: • The coefficients can be determined from the function itself • Correspondingly, helps us determine: Seidel - Fall 2005

  6. Taylor Series Approximation • Suppose we have a function which we want to write as: • The coefficients can be determined from the function itself • if we can determine all derivatives at x=0 Seidel - Fall 2005

  7. Taylor Series Approximation • Choosing a subset of terms of the Taylor approximation • leads to polynomial approximations • It is important to bound the error contribution of the remaining terms. • Helps to reduce function evaluation to • Lookups, • multiplication and • additions • Can make differentiation/ • integration easy: Seidel - Fall 2005

  8. CORDIC

  9. CORDIC - History • CORDIC – • COordinate Rotation Digital Computer (Volder, 1956&1959) • References • J.S. Walter, A unified algorithm for elementary functions, Spring Joint Computer Conference, 1971, Proc, pp.379-385. • R. Andraka, A survey of CORDIC algorithms for FPGA based computers, ACM/SIGDA sixth Int.Symp. on Field Programmable Gate Arrays, 1998, pp.191–200. Seidel - Fall 2005

  10. cotana tana 1 sina a cosa Coordinate Rotations • Consider circle functions on the unit circle: Seidel - Fall 2005

  11. Coordinate Rotations • Consider rotation of a point P by the angle  Seidel - Fall 2005

  12. Using Addition Theorems • for sine and cosine: Seidel - Fall 2005

  13. Pseudo-Rotations • Coordinates after • - Real rotation: • - Pseudo rotation: K tan 1 1 K sin(a+)  a K cos(a+) Seidel - Fall 2005

  14. Iterative Computation Process • Iteration: Initialization: • Goal: get ito 0 • Approximation of • cos a by sin a by tan a by • Tabulated values of • and • allow one iteration to be computed with • 3 multiplications • 3 additions • Which and how many values of should be stored ? Seidel - Fall 2005

  15. Simplified Iterations • Consider • Then iteration • become: Seidel - Fall 2005

  16. Simplified Iterations • Iteration i: determine di in {-1,1} to • be of same sign as i • allow one iteration to be computed with • 3 multiplications • 3 additions • For fixed number of t iterations: • initialize with xi = 1/Rt =1/1.64676025 = 0.60725293 Seidel - Fall 2005

  17. Simplified Iterations • Iteration i: determine di in {-1,1} to • be of same sign as i • Computation sequence for a = 30 • 30 ~ 45.0–26.6+14.0-7.1+3.6+1.8-0.9+0.4-0.2+0.1 • = 30.1 Seidel - Fall 2005

  18. Simplified Iterations • Computation sequence for a = 30 • 30 ~ 45.0–26.6+14.0-7.1+3.6+1.8-0.9+0.4-0.2+0.1 • = 30.1 Seidel - Fall 2005

  19. CORDIC Hardware Seidel - Fall 2005

  20. Generalized CORDIC • Generalized CORDIC iteration: • Choose di in {-1,1} for iteration i: • Choices for :  = 1 Circular rotations (basic CORDIC) e(i)= tan-1 2-i  = 0 Linear rotations e(i)= 2-i  = -1 Hyperbolic rotations e(i)= tanh-1 2-i Seidel - Fall 2005

  21. Generalized CORDIC • can compute: • sin a • cos a • tan-1a • multiplication • division • sinh a • cosh a • tanh-1a Circular mode linear mode hyperbolic mode Seidel - Fall 2005

More Related