You are on page 1of 32

FPGA Implementation of Base-N

Logarithm for the Data with Random


Decimal Point Positions

UNDER THE GUIDELINES


XXXXXX
XXXXXXXX
XXXX
XXXXXXXX

SUBMITTED BY
XXXXXX
XXXXXXXX
XXXX
XXXXXXXX

Outline
Aim of the Project
Introduction
Objective
Literature survey
Design Methodology
Conclusion
References

AIM OF THE PROJECT


Aim :Logarithmic transformation is an important part of
many digital signals processing system, especially in the
fields of instruments design.
This project gives details on a simple way based on
CORDIC algorithm and the idea of
Data initialization to implement logarithmic
transformation.

INTRODUCTION
In domain of digital signal processing, logarithmic

transformation is an indispensible part.


logarithmic transformation is not easy to achieve by
using digital circuits.
The effective methods to compute the logarithmic
values of data using digital circuits can be divided n
two main types.
One is the look-up table based algorithms, the
other is iterative methods.

OBJECTIVE
look-up table based algorithms: faster and

straightforward, but only useful for data with small


bits.
iterative methods : latter is slower, but it does not
rely on many memories and has relative high
precision.
Objective: CORDIC algorithm just needs adders
and shifters and provides relative high precision
which makes it very suitable for hardware
implementation

LITERATURE SURVEY
H. Hassler and N. Takagi, Function evaluation by

table look-up and addition, in Proc.12th Symp.on


Computer Arithmetic, pp. 1016, Jul.1995.

general approach decomposing a function into a sum of

functions each with a smaller input site than the


original. Hence we can map such functions with

essentially the same precision using small ROM tables


and adders.

Contd..
Tso-Bing Juang, Shen-Fu Hsiao and Ming-Yu Tsai, "Para-

CORDIC:Parallel CORDIC Rotation Algorithm," IEEE


Transactions on Circuits and Systems, VOL 51, NO. 8, pp. 15151524, August. 2004.
In this paper, the parallel COrdinate Rotation DIgital Computer

(CORDIC) rotation algorithm in circular and hyperbolic coordinate is


proposed. The most critical path of the conventional CORDIC rotation
lies in the determination of rotation directions, which depends on the
sign of the remaining angle after each iteration.

Contd..
D.R.LLAMCCA-OBREGON, C.P.AGURTO-RIOS, Fixed

Point Implementation of Hyperbolic Cordic Alogrithm Latin


American Applied Research- 2007.
A Fixed point Hyperbolic Cordic algorithm with expansion

scheme proposed by Hu et al,(1991) is presented.


Three Architecture :a low cost iterative, fully pipelined and bit

serial is proposed.

Contd..
Shaowei Wang, Yuanyuan Shang, Hui Ding, Chen Wang and Junming Hu,

"An FPGA Implementation of the Natural Logarithm Based on CORDIC


Algorithm," Research Journal of Applied Sciences, Engineering and
Technology 6(1): 119-122, 2013

This study introduces the basic principles of the mode of calculation of the
hyperbolic systems by using the CORDIC algorithm, then analyses the FieldProgrammable Gate Array (FPGA) CORDIC core processing unit in detail. The
biggest advantage of the CORDIC algorithm is that its circuit structure is very
simple, using only adder and shifter. It is very suitable for FPGA implementation.
Based on the iterative algorithm, a FPGA implementation of the natural logarithmic
function has been designed. The pipelined-FPGA architecture can achieve a high
computational speed, for completing a computation only requires one clock cycle. The
relative error values are below 10-4, which can satisfy the accuracy requirements.

Contd..
Volder, J.E., 1959. The CORDIC trigonometric computing

technique. IRE T. Electron. Comput., EC-8(3): 330-334..


In this paper, The COrdinate Rotation DIgital Computer

(CORDIC) rotation algorithm in circular and hyperbolic


coordinate is proposed.

Contd..
R. Ranga Teja, P. Sudhakara Reddy, IEEE, Member.

Sine/Cosine Generator Using Pipelined CORDIC


Processor. IACSIT International Journal of Engineering
and Technology, Vol.3, No.4, August 2011.
Here a developed of sine cosine generator, a common elementary
trigonometric functions using one of the hardware efficient
algorithm namely CORDIC. As the implemented design is a
pipelined one, it is more efficient than bit serial approach and is
more accurate and advantageous than bit serial architecture.

Design Methodology
CORDIC IP core of Xilinx ISE software, plus the

equivalent formula (1) for inverse hyperbolic tangent


and natural logarithm, the natural logarithm results
can be obtained(2).

Cordic IP Core with Data


Initialization for ln r function.

ln r
2

Base N Logarithm Algorithm


Overall Design
r=din

Data Initialization
fixed-point 2s complement numbers with an integer

width of 2 bits. Q Format.


Q is a fixed point number format where the number
of fractional bits (and optionally the number
of integer bits) is specified.
Example: when input data are in signed fraction
format, the XIN and YIN inputs are expressed as
fixed-point 2s complement numbers with an integer
width of 2 bits. 101000000000000000000000
represents the value -0.5.

Decimal point position of din


Assuming the position of decimal point of din is

between bit K and bit K-1,


Combing the identification method of CORDIC IP
core for input data and previous parts, it can be
concluded that the inputs for CORDIC IP core
inevitably need re-combination.

Locating the decimal point


din = 24bit data.

din Specific realization idea:

locating the first bit of "1"


bit by left to- right shifting
on the original data dins,
recording their position as n,
and then take each shifted
binary number as din_norm.

CORDIC Algorithm
The CORDIC algorithm involves rotation of a vector '

v' on the XY-plane in circular, linear and hyperbolic


coordinate systems depending on the function to be
evaluated.
The conventional method of implementation of 2D
vector rotation using Givens rotation transform is
represented by the equations (1) and (2).

Contd..
where ( xin ,yin) and (xout , yout) are the initial and

final coordinates of the vector, respectively. The


main principle of CORDIC algorithm is to implement
every function in terms of addition/subtraction and
shifting.

CORDIC Algorithm used


The CORDIC algorithm in this design is used to get

corresponding inverse hyperbolic tangent results.


When we have inputs Xin and Yin,

the CORDIC algorithm move


the input vector (Xin, Yin)
along the hyperbolic curve (Fig.5)
until the Y component reaches zero.
This generates the hyperbolic angle,
Atanh(Yin/Xin). The hyperbolic
angle represents the log of the area
under the vector (Xin, Yin)
and is unrelated to a
trigonometric angle.

Contd..
Natural logarithm values can be got by doubling

the corresponding inverse hyperbolic tangent


results .
Obtaining natural logarithmic value of original

inputs.
This part provides a base change by multiplying a

constant for the natural logarithmic results.

Contd..
CORDIC Architecture

Two Modes Rotational and Vector Mode

Contd..
Types of CORDIC Architecture

1. Sequential Architecture
2. Parallel Architecture
3. Pipelined Architecture

Contd..
Pipelined CORDIC Algorithm
The ideal architecture depends

upon the speed verses area


tradeoff's in the intended
application.
This architecture is advantageous to
serial architecture as it is fast
and doesn't require a
look up table. The number
of blocks is dependent
on the accuracy demanded by
the application in which
CORDIC is employed.

Pipeline CORDIC processor

Design with an Example


Data Initialization:

Base n logarithm value:

Specification of the design and Input Format


Hyperbolic CORDIC Function in rotation mode.

Data Initialization block to calculate the decimal

point position.
Data input is of 48 bit format. Of which first bit sign
bit and 1 bit integer and remaining fractional bit.

Work Completed
Implementation of Data Initialization in VHDL.

Remaining Work
CORDIC Pipelined IP Core.

Calculation of Log value for Base N .


Integration of Functional Blocks.

Conclusion
In this project, we have introduced N logarithmic values for the

data with random decimal point positions. The design has


parametric and hierarchical characteristic, by which the design
can be easily understood.
The realization of the process is relatively simple; designers only

need to determine the positions of decimal point of input data and

get correct corresponding logarithmic values

References
[1] H. Hassler and N. Takagi, Function evaluation by

table look-up and addition, in Proc.12th Symp.on


Computer Arithmetic, pp. 1016, Jul.1995
[2] D. DasSarma, D.W. Matula, Measuring the Accumcy
of ROM Reciprocal Tables, IEEE 11th Symp.on
Computer Arithmetic, pp.932-940, Aug.1994.
[3] M. Schulk, E. Swartzlander, Ezact Rounding of
Certain Elementary Functions, Arith 11,
Proceedings,pp.138-145,1993.

Contd..
[4] I. Koren, "Computer arithmetic algorithms, 2nd

edition," ISB 1- 68-108 pp2522 resources like BRAMs,


embedded multipliers, etc. ISBN 1-56881-160-8, pp. 225232.
[5] T. Fryza, Application of user-defined floating-point
formats, SPA.conference.on Signal Processing
Algorithms, Architectures, Arrangements, and
Applications, pp.9193, Sept. 2009.
D.R.LLAMCCA-OBREGON, C.P.AGURTO-RIOS,
Fixed Point Implementation of Hyperbolic Cordic
Alogrithm Latin American Applied Research- 2007.

Contd..
Shaowei Wang, Yuanyuan Shang, Hui Ding, Chen Wang and

Junming Hu, "An FPGA Implementation of the Natural


Logarithm Based on CORDIC Algorithm," Research Journal of
Applied Sciences, Engineering and Technology 6(1): 119-122,
2013.
Volder, J.E., 1959. The CORDIC trigonometric computing
technique. IRE T. Electron. Comput., EC-8(3): 330-334..
R. Ranga Teja, P. Sudhakara Reddy, IEEE, Member. Sine/Cosine Generator
Using Pipelined CORDIC Processor. IACSIT International Journal of
Engineering and Technology, Vol.3, No.4, August 2011.

Thank You

You might also like