Beruflich Dokumente
Kultur Dokumente
Abstract-This research and development on conversion co chose single and double precision floating point formats for
processor presents an abstract- level hardware implementation of conversion from one format to another. Based on IEEE
the conversion between various number formats for FPGAs in standard specification, the floating point number representation
modular way. Replacing the floating point expressions with
contains three data fields: - Sign, exponent and mantissa. Fig1
specialized integer or fixed point operations can greatly improve
shows the bit-wise representation of single and double
the system performance in several applications. The replacement
precision floating point number.
requires several types of conversions from one format to another
hidden part
format. The proposed conversion co-processor accelerator can
work in parallel with HOST machine to accept a large amount of 31 3
3O
22 ______
input data and convert to another format and apply fixed point 01 1111111t. 111
sign exponent (a-bit) mantissa (23-bit)
I I
or integer arithmetic operations and the result is converted back radix point
Index Terms-IEEE 754 floating point standard, floating point Figl: Single and Double precision floating point number
co-processor, integer conversions, fixed point conversions,
representation
conversion co-processor and FPGA.
A real number can be represented using one of the floating
point format specified in the IEEE standard [1]. Present work
I. INTRODUCTION accepts all type of the number formats such zero, infinity, quite
High end applications like weather forecasting and image Not a Number,(QNaN), Signaling Not a Number(SNaN), de
processing requires a conversion of a floating point number normalized number and Normalized numbers which is
from one format to another format to perform complex specified in the standard. Design supports rounding modes,
algorithmic calculations. IEEE754-2008 standard [I] specifies such as "round to zero", "round up" (round towards positive
the conversion from floating point to fixed point and infmity), "round down" (round towards negative infmity),
conversion between single to double, double to single precision "round ties to odd" and round ties to even.
floating point formats and integer conversions. Most of the
II. RELATED WORKS
general purpose and special purpose micro-processors are
having the support for the conversion operations as IEEE-754 2008 standard [1] specifies the conversion of a
instructions. To support the instructions, hardware based floating point number to fixed point and integer and vice versa,
floating point conversions units are added to the processor core also it specifies the conversion between the floating point
pipeline to enhance the application performance. numbers. An automatic software approach [4], to convert the
In some cases, especially in complex systems; for instance floating point to fixed point conversion is in-efficient for the
in a very large simulation system or in a complex algorithmic high-performance computing. Main conflicting objective of
codes, we have to make the conversion between different the conversion between different formats are: - complexity and
number formats. Application developers prefer to implement accuracy loss. The paper [8] proposed a high-complexity-high
conversion algorithms in hardware level instead of software. accuracy and low-complexity-Iow-accuracy implementation of
Because the hardware implementations causes remarkable the floating point to fixed point conversion targeted on micro
speedup compared with software implementation [7, 9, 10, 11]. controllers. Most of the implementation of the conversion is
For this research work, we chose Field Programmable Gate targeted on micro-controllers (uses an integer instructions to
Array (FPGA) to implement hardware conversion algorithms. implement the floating point instructions) .Field Programmable
FPGAs are a very popular type of reconfigurable hardware Gate Array based conversion co-processor approach is not that
combining the flexibility, inherent parallelism and the speed of much been explored by the researchers. Our research brings out
specialized hardware [15, 16]. the FPGA based implementation of a co-processor for
IEEE-754 2008 standard [I] specifies the four set of conversions and their tradeoffs in terms of complexity and
floating point number formats: - single, double, extended and throughput.
quad precision floating point formats. In this research work, we
978-1-4799-7926-4115/$31.002015 IEEE
2015 International Conference on VLSI Systems, Architecture, Technology and Applications (VLSI-SATA)
III. Top LEVEL ARCHITECTURE OF FLOATING POINT output. The conversion co-processor has 5-exception signal to
CONVERSION CO-PROCESSOR raise the exceptions in the operation. The "comp" signal is to
indicate the completion of the conversion. The exceptions are
The co-processor supports 12-type of conversion functions
raised according the IEEE 754 standard. Table I lists the
(4-bit encoding scheme) from one format to another. The IEEE
opcode and pipeline stage for the conversion operation.
754 standard specifies different types of conversions: - single
precision to double precision, double to single precision
conversion, fixed point to floating point conversion, floating Opcode Conversion Pipeline stage
point to fixed point conversion and integer conversions. Fig. 2 0000 Single precision to double 5
shows the micro-architecture of the conversion co-processor. precision
0001 Double precision to single 5
Data in Round mode opocode op' en rst clk precision
0011
Single precision
point (QI6.15)
to
5
Opcode Decoder (4-bit opcode)
point (Q32.31)
(Enable, Data. Round mode] (Enable, Data. Round mode]
0100 Fixed point(QI6.15) to 6
Signed
Signed
Integer
Integer
----+ to IV. MICRO-ARCHITECTURE OF FLOATING POINT CONVERSIONS
to
Double
Sine:le
A. Single precision to double precision conversion
Double
Single The single to double precision conversion accepts the data
to ....
to
Signed input in the single precision floating point format and outputs
Signed
Intee:er the result in double precision floating point format. The micro
Intee:er
., r
architecture of as-stage pipelined single to double precision
1 1 1 1 1
Five stage pipelined single precision to double precision
conversion accepts a 32-bit single precision floating point data
input and produces a 64-bit double precision floating point
Data out Comp Zero Invalid Inexact Overf1ow Underflow
output. Number format analyzer classifies the data input as
Fig. 2: Top level architecture of conversion co-processor zero, infmity, QNaN, SNaN, de-normalized number and
Normalized number. Output of the format analyzer is passing
The floating conversion co-processor accepts the data through either "path1" or "path2" based on the data input
inputs through the "data in" pin and a 3-bit as rounding mode classification. If the single precision data input is a de
for operation. The "opcode" (4-bit) field specifies which normalized number, uses the "path1" of the micro-architecture.
conversion to be carried with the data input and rounding Else, if the data input is other than de-normalized number it
mode. The input decoder decodes the opcode and enables the uses the "path2" of the micro-architecture.
single_prec_data_in (32-bit)
architecture of a 5-stage pipelined double to single precision
l
conversion is shown in Fig 4.
1
.. ..., . . . . . . . . . . . . . J. . . . . . . . . . . . . . l
Number format Analyzer
Leading one Single precision
algorithm Bias remove
. . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . .
,
1 1 Leading one
algorithm
Double precision
Bias remove
Leading position Double precision
1 1
calculation Bias addition
1 1 Leading position
calculation
Double precision
Bias addition
Double precision Bypass stage
Bias addition
1 1
oath] t. . . . . . . . . . . . . . . Path2 t. . . . . . . . . . . . . . Rounding De-
normalized
Round
Normalized
J
Double precision number formation
Path]
1 Path2
l
................................. ................................
..
Data_in(32 or 64)
Preprocessing stage
Exponent calculation
Rounding
Data_out(single or double)
Data_out((Q16.15) or Q(32.31)) Absolute value calculation stage accepts the fixed point
input data in 2's complement form and performs the 2's
Fig 5: Micro-architecture of floating point to fixed-point complement operation on input data to make the absolute
conversion value. Format analyzer, analyses the input data in-terms of
zero, de-normalized number and normalized number and sign
Pre-processing stage accepts either single preclSlon or of the data input and provides a 3-bit status register indicator to
double precision floating point data input, and analyses data the consecutive stages. The 2-stage leading one algorithm and
input such as zero, infinity, QNaN, SNaN, de-normalized and leading one position computes the leading one in the input
normalized number. Also this stage separates the sign, fixed point data and calculates the position of the leading one
exponent and Mantissa. Shift amount calculation stage in the data. Exponent calculation stage adds or subtracts the
removes the bias from the exponent (127 for single precision bias value (127 for single precision and 1023 for double
and 1023 for double precision). Number decoding stage precision) to leading one position. If the input data is de
separates the integer part and fractional parts from mantissa normalized number leading one position value is subtracted
based on the shift amount. Rounding operation is performed to from bias value or, if the input data is normalized number bias
make the output in either Q16.15 format or Q32.31 format. value will be added to leading one position. Also in parallel
Post-processing stage check the status of the number and with exponent calculation stage, it will calculate the mantissa
results the appropriate results in 2's complement form. All the of the output from the fixed point data input. The post
results from floating point to fixed point conversions are processing stage forms the single or double precision floating
displayed in 2's complement form. point data by using mantissa, exponent and sign.
sign of the input floating point data is negative, the fmal result
Data_in(32-bit) is represented in 2's complement form. Also this stage
generates a valid signal to indicate whether the 32-bit data is
valid or not.
Pre-processing unit
Oata_in(32 or 64)
Rounding unit
Rounding stage
Data_out (Single/Double)
extracts the sign, exponent and mantissa according to the IEEE Nuzub c:: r
Nuntb ", r
01" S 1i c c:
u "' .. d
LOT.,.:
... ,.. LO<;Jic::
67 6 3 313660
754 standard. Integer formation stage removes the bias from 5 1 1 C'"
Nuznb.er
Log.i.C:
01" LOT
Di "" tribut.i.on:
F.l.;1.p F.1. op pair", u", ,,,, d:
the exponent and generates a 31-bit data (mantissa with hidden Nllltlb .. r with a.... unu """,d F1ip F1op: 600
Number with an unu sed LOT: .1374 B 1 37 .16"
Nunlber 01" 1"ul..J..y u ::s ed LOT-FF pai
. r!"J: .l. B7.l. 8 3. 37
bit and 3-bit offset for rounding) also in this stage generates
inexact and overflow exceptions. Rounding stage performs the
1:0 Ueil.i. z .. e i.on:
NlllDb",r- 01" 1:0",,:
rounding based on the rounding inputs. Post processing stage Sp ..c:i1"ic: F.. ... tur '" Ut 1 1 .i. zation:
Nunlb .. r 01" BUFG/ BUFG CT R L ", :
The implemented individual conversion modules are [1] IEEE standards Board and ANSI. IEEE Standards for Binary
operating above 350 MHZ and integrated conversion co Floating-point Arithmetic, 2008, IEEE Std 754-2008.
processor has achieved a frequency of 350 MHZ. The [2] D. Menard, D. Chillet , F. Charot, O. Sentieys, "Automatic
maximum throughput of the proposed conversion-coprocessors Floating point to Fixed-point Conversion for DSP Code
is 350MFLOPs per second. For the selected FPGA (Virtex 6 generation", in proc. of the International Conference on
Compilers, Architectures, and synthesis for Embedded systems,
xc6vlx550t-2ffl759), a maximum of 4- conversion coprocessor
Oct. 2002.
can fit into one FPGA and can achieve a maximum throughput
[3] C. Shi, R. W. Brodersen. "An Automated floating point to Fixed
lAGFLOPs per second. The Xilinx library individual
point Conversion methodology", in proc. Of IEEE International
Conversion modules (on speed grade -3) are operating around
Conferences on Acoustics, speech and signal processing, Vol. II
350 MHZ only (individual cores). Since researchers have
529-32,
explored conversions either in high level language or assembly
[4] Pavle Belanovic, Markus Rupp "Automated Floating-point to
languages, and hardware implementations of conversions has
Fixed-point conversion with the fixify environment", in proc. of
not been explored much, publications are limited in number. I 6th international workshop on Rapid System Prototyping, 2005.
[5] Alexandru Barleanu, Vadim Baitoiu, Anderi satn. "Floating
The major areas of application of conversion co-processors point to fixed-point code conversion with variable trade-off
are in weather forecasting, linear algebraic routines, robotics, between computational complexity and accuracy loss".in proc.
Digital Signal Processing and image processing. In image of 15th international conference on system theory, control and
processing applications such as feature extraction, computing, 2011.
segmentation requires a large floating point matrix to multiply. [6] T. Sahin, C.S. Gloster, C.Doss, "Feasibility Floating-Point
The floating point operations are time consuming, so convert Arithmetic in Reconfigurable Computing System",MAPLD
the input operands to the fixed point form and perform the International Conference, Maryland USA 2000.
arithmetic operations and convert this result back to floating [7] Marius Cornea, John Harrison, Cristina Anderson, Ping Tak
point form. These conversions are easily doable with the Peter Tang, Eric Schneider, Evgeny Gvozdev, "A software
conversion co-processor in FPGA. Most of the Digital signal implementation of the IEEE 754R decimal floating point
Arithmetic using the binary encoding format", IEEE
processing applications such as FFT, DFT requires fixed point
transactions on computers, vol. 58. No.2, February 2009.
numbers, the pro-processed conversion co-processor is suitable
[8] D Williamson, "Dynamically scaled fixed-point arithmetic,"
for the converting the input floating point number to fixed
Proc. IEEE Pacific Rim Conf on Commun. Comput. and Sig.
point format and vice versa.
Proc. , vol. I , pp-315-318, 1991
algorithms were considered for implementation to achieve the Journal of Computer Research & Development, Vol. 38, No. 9,
sep 2001.
present throughput. In future we may explore more
optimization technique to achieve better throughput with less [13] Nhon T. Quach and Michael J. Flytm, "An Improved Algorithm
For High-speed Floating-point Addition" , Technical Report
FPGA resource utilization.
CSL-TR-90-442, Stanford University, August 1990.
VIII. ACKNOWLEDGEMENT [14] C. Hinds, "An Enbanced Floating Point Coprocessor for
Embedded Signal Processing and Grapbics Applications,"
The research work presented here was supported by Centre
Conference Record of the Thirty-Third Asilomar Conference on
for Development and Advanced Computing (C-DAC),
Signals, Systems, and Computers, pp. 147-151, 1999
Knowledge Park, Sengaluru. The authors would like to thank
[15] Altera Floating Point Megafunctions.
Dr. N. Sarat Chandra Sabu (Executive Director) for giving the
http://altera.com/products/ipidsp/arithmetic/m-alt-float
opportunity to carry out the research work. point.html.