Title: CSE 246: Computer Arithmetic Algorithms and Hardware Design
1CSE 246 Computer Arithmetic Algorithms and
Hardware Design
Fall 2006 Lecture 11 Cordic, Log, Square,
Exponential Functions
- Instructor
- Prof. Chung-Kuan Cheng
2Project
- IEEE Computer Society Author Kit (5Pages)
- Introduction
- Statement of Problem
- Approaches
- Examples
- Experiments
- Conclusion
- 30 Minutes
3Cordic Algorithms
- Coordinate Rotations Digital Computer
- Rotate vector (x,y) to (x,y)
(x,y)
a
(x,y)
4Cordic Algorithms
5Cordic Algorithms
- Key Given cos a, sin a, tan a we can derive
i ai
0 45
1 26.6
2 14
3 7.1
4 3.6
5 1.8
6 0.9
7 0.4
8 0.2
9 0.1
6Cordic Algorithms (Example)
7Cordic Algorithms
8Logarithms Method 1
9Logarithms Method 1
10Logarithms Method 1 (Example)
- Find ln(x), x 1.625
- 10.50.1251.625
1. 1 0 1 1.-1 _ -1 -1 0
-1 x 1 1 0 1 _ 0. 1 1 0 1
0.1 1 0 1 1.0 1 _ 0 1 1 0 1 x 0 1 1
0 1 _ 1.0 0 0 0 1
11Logarithms Method 1 (Example)
- -ln x (1.-1) ln(1.01) ln(1.0000-1)
1. 0 0 0 0 0 1 1. 0 0 0 0 0-1 1. 0 0 0 0 0 0 0 0
0 0
12Logarithms Method 2
- Let define
-
- Initially xlt2, ie. y00
- If
-
13Logarithms Method 2
- for i 1 to l do
- x x2
- if x 2
- then yi 1
- x x/2
- else yi 0
14Logarithms Method 2 (Example)
- Find ln2(x), x 1.11 (1.75)
x2 1.1 1 x 1.1 1 1 1 1
1 1 1 1 1 1 __ 1 1 0 0 0 1 y1 1
x2/2 1.1 0 0 0 1 x 1.1
0 0 0 1 1 1 0 0 0 1 1 1 0 0 0
1 1 1 0 0 0 1 _ 1 0.0 1 0 1 1 0 0 0
0 1 y2 1
15Logarithms Method 2 (Example)
(x2/2)2/2 1.00101100001 y3 0 ln2 1.11
0.110
16Squarer
- x3 x2 x1 x0
- X x3 x2 x1 x0
- x3x0 x2x0 x1x0 x0x0
- x3x1 x2x1 x1x1 x0x1
- x3x2 x2x2 x1x2 x0x2
- x3x3 x2x3 x1x3 x0x3 _
- x3x2 x3x1 x3x0 x2x0 x1x0 x0
- x3 x2x1 x1
- x2 _
17Exponentiation ex
18Exponentiation ex