Professional Documents
Culture Documents
Abstract—FPGA based reconfigurable computing standard adder algorithm implementation [7]. In our
accelerators are increasingly being used in high performance and implementation we use the standard floating-point adder
scientific computing applications to achieve higher performance. algorithm considering its area efficiency as the prime
These applications demand high numerical stability and accuracy objective.
and hence usually use floating-point arithmetic. The floating-
point arithmetic cores available from major FPGA vendors are Section 2 of this paper describes in brief the IEEE 754
not fully IEEE 754 compliant. These cores do not support single precision floating-point format, exceptions, special
denormal numbers. In this paper we describe our numbers and rounding modes. Section 3 describes the standard
implementation of IEEE 754 compliant single precision floating- floating-point adder algorithm and Section 4 describes the
point adder that supports denormal inputs. Further, we compare architecture and hardware modules developed to implement
its performance and resource utilization against the Xilinx the algorithm. Section 5 compares our implementation of
floating-point adder IP core. Our implementation has eight IEEE 754 compliant single precision floating-point adder unit
stages of pipeline, utilizing minimal FPGA resources; it can supporting denormal inputs with the Xilinx floating-point
operate at frequencies greater than 300 MHz. adder core. Section 6 concludes the paper and highlights the
future work.
Keywords—FPGA, IEEE 754, Floating-Point, single precision,
Reconfigurable Computing
II. IEEE 754 STANDARD FOR FLOATING POINT
I. INTRODUCTION The IEEE 754 is an industry standard to represent floating
Floating-Point addition is one of the most frequently used point numbers.
floating-point operation. An analysis of real time applications A. Single Precision Floating-Point format
indicate that signal processing algorithms require, on an
The IEEE 754 single precision format is a 32 bit format.
average 40% multiplication and 60% addition operations.
This format uses 1-bit for sign, 8-bits for exponent and 23-bits
Therefore the floating-point addition forms an important
to represent the fraction as in fig. 1. The single precision
operation in math co-processors, DSP processors, embedded
floating-point number is calculated as (-1) S × 1.F × 2(E-127).
arithmetic processors, and data processing units. Almost every
The sign bit is 0 for non-negative number and 1 for negative
modern computer and compiler uses the IEEE 754 floating-
numbers. The exponent field can be used to represent both
point standard. This standard has greatly improved both the
positive and negative exponents. To do this, a bias is added to
ease of porting floating-point programs and the quality of
the actual exponent. For IEEE single-precision format, this
computer arithmetic. When a program is moved from one
value is 127. As an example, a stored value of 147 indicates an
system to another, the results of the basic operations remains
exponent of (147-127), or 20. The mantissa (significand) is
the same if both systems are compliant to the IEEE 754
composed of an implicit leading bit and the fraction bit, and
standard. This standard completely describes the behavior and
represents the precision bits of the number. Exponent values
operations on floating-point data, including advanced options
of 0xFF and 0x00 are reserved for special numbers such as
such as the use of rounding modes and other computational
zero, denormalized numbers, infinity, and Not a Number
techniques and controls [1]. Many floating-point adder
(NaN).
algorithms and design approaches have been developed and
discussed by the VLSI community [2-10]. Leading One
Predictor (LOP) and Far and Close Path algorithms achieve Sign 8 bit Exponent 23 bit Fraction
better overall latency, while the standard floating-point adder (S) (E) (F)
algorithm is considered as an area efficient algorithm. The Far
and Close algorithm consumes 88% more slices than the
Fig. 1. IEEE 754 Single Precision Floating-Point Format
*Currently not working with C-DAC. The work was performed while the
author was with C-DAC.
408
IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI-2017)
B. Normalized and Denormalized Numbers The implementer shall choose how tininess is detected, but
A floating-point number is said to be normalized if the shall detect tininess in the same way for all operations in radix
exponent field contains the real exponent plus the bias other two, including conversion operations under a binary rounding
than 0xFF and 0x00. For all the normalized numbers, the first attribute. In our implementation we are calculating underflow
bit just left of the decimal point is considered to be 1 and not after rounding.
encoded in the floating-point representation; this also called as The invalid operation exception is signalled if and only if
the implicit or the hidden bit. there is no useful definable result. In these cases the operands
To support very small numbers, IEEE introduced are invalid for the operation to be performed. These operations
denormalized numbers. The denormalized numbers represent are any general-computational or signalling-computational
numbers between zero and the lowest normalized number. A operation on a signalling NaN except for some conversions.
floating-point number is considered as denormalized, if the For example magnitude subtraction of infinities is considered
exponent field is 0x00 and the fraction field is not all 0’s. For as invalid operation.
the denormalized number, the implicit (hidden) bit is
considered to be a 0. III. STANDARD FLOATING-POINT ADDER ALGORITHM
The standard floating-point adder algorithm as shown in
C. Special Quantities fig. 2 is implemented for our design. This area efficient
In IEEE 754 standard, infinity and NaN are treated as algorithm is as described below.
special quantities. Without any special quantities, there was no
1) Compare two operands N1 and N2 and check for
good way to handle exceptional situations like calculating the
denormalization and infinity. If numbers are
square root of a negative number other than aborting the
denormalized, set the implicit bit to 0 otherwise it is
computation. In IEEE 754 arithmetic, a NaN is returned in the
Read Operand
above said situation [11]. N1 & N2
In single-precision representation, Infinity is represented
by exponent field of 0xFF and fraction field of all 0’s while
NaN is represented by exponent field of 0xFF and the fraction Denormalize Yes Set Implicit bit 0
operands?
field that is not all 0’s.
No
D. Rounding Mode and Exceptions
Three user-selectable rounding modes and a default Compare Yes
exponent Swap Operands
rounding mode are defined in the IEEE standard. The default (E1<E2)?
rounding mode (roundTiesToEven) of IEEE 754 is
implemented in our unit. In this mode the floating-point No
number nearest to the infinitely precise result is delivered; if Shift smaller operand by
|E1-E2|
the two nearest floating-point numbers bracketing an
un-representable infinitely precise result are equally near, the
one with an even least significant digit will be delivered [1]. Operation Yes Two’s Complement of smaller
Subtraction? operand
The IEEE 754 defines five types of exceptions: overflow,
underflow, invalid operation, inexact result, and division-by- No
zero. Exceptions are signalled by setting a flag. We have Add fraction parts f1 + f2
implemented overflow, underflow and invalid operation flags
in our designs.
The overflow exception is signalled if and only if the Negative Yes Two’s complement of result
Result?
destination format’s largest finite number is exceeded in
magnitudes by what would have been the rounded floating- No
point result were the exponent range unbounded. Leading One Detector
409
IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI-2017)
410
IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI-2017)
LUT- Latency
Frequency
Method Register LUT Registers ( Clock
( MHz)
Pair Cycles)
Our 577 441 433 8 263
411
IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI-2017)
[8] G. Govindu, L. Zhuo, S. Choi, and V. Prasanna, “Analysis of high- [12] V. G. Oklobdzija, “An Algorithmic and Novel Design of a Leading Zero
performance floating-point arithmetic on FPGAs,” in Proc. Parallel Detector Circuit: Comparison with Logic Synthesis.” IEEE Transactions
Distrib. Process. Symp., 2004, pp. 149–156. on Very Large Scale Integration (VLSI) Systems, Vol. 2, No.1, pp. 124-
[9] J. Liang, R. Tessier, and O. Mencer., "Floating Point Unit Generetion 128, 1994.
and Evaluation for FPGAs". In Proc. of IEEE Symposium on Field [13] Abed, K.H.; Siferd, R.E., "VLSI Implementations of Low-Power
Programmable Custom Computing Machines (FCCM’03), California, Leading-One Detector Circuits," SoutheastCon, 2006. Proceedings of
USA, April 2003. the IEEE , vol., no., pp.279,284, March 31 2005-April 2 2005.
[10] A. Malik, D. Chen, Y. Choi, M. H. Lee, and S.B. Ko, “Design tradeoff [14] Xilinx Logicore. Floating-Point operator v7.0. http://www.xilinx.com/
analysis of floating-point adders in FPGAs,” Canadian Journal of [15] Shao Jie, Ye Ning , Zhang Xiao-Yan “An IEEE compliant Floating-
Electrical and Computer Engineering, vol. 33, pp. 169–175, 2008. point Adder with the deeply Pipelining paradigm on FPGAs” 2008
[11] What Every Computer Scientist Should Know About Floating-Point International Conference on Computer Science and Software
Arithmetic, published in the March, 1991 issue of Computing Survey. Engineering.
412