Title: A Comparison of Floating Point and Logarithmic Number Systems on FPGAs
1A Comparison of Floating Point and Logarithmic
Number Systems on FPGAs
Michael Haselman Michael Beauchamp, Aaron Wood,
Scott Hauck University of Washington K. Scott
Hemmert, Keith Underwood Sandia National
Laboratories
Sandia is a multiprogram laboratory operated by
Sandia Corporation, a Lockheed Martin Company,
for the United States Department of Energys
National Nuclear Security Administration under
contract DE-AC04-94AL85000.
2Introduction
- Floating point
- standard for microprocessors
- many FPGA implementations
- Logarithmic Number System (LNS)
- few FPGA implementations
- similar range
- similar error
- less complexity for some computations
- Create guide for designers
3Number Systems
- Floating Point
- exceptions (NAN, 0, 8) encoded in exponent and
significand - i.e. zero -gt exp.0, sig.0
- implicit 1 before significand
- 1.significand -gt mantissa
4Implicit Leading 1
- Different ways to express same number
- Standard requires a 1 before radix point
5Implicit Leading 1
- Different ways to express same number
- Standard requires a 1 before radix point
normalization
6Number Systems
- LNS
- flags encode exceptions
- 2s comp fixed point number
- dynamic range?
7IEEE Standard
FP
LNS
8FP Multiplication
9FP Multiplication
10FP Multiplication
11Renormalization and Rounding
- (1,2 x (1,2 (1,4
- implicit leading 1 requires possible renorm
- n bit x n bits 2n bits
- round
12FP Multiplication
1,2)
1,2)
1,4)
1
gtgt1
round
13LNS Multiplication
comb. logic
14LNS Multiplication
15LNS Multiplication
no renormalization! no rounding!
16FP Division
17FP Division
18FP Division
19FP Division
1,2)
1,2)
.5,2)
1
?
ltlt1
round
20LNS Division
comb. logic
21LNS Division
22LNS Division
no renormalization! no rounding!
23FP Addition
(greater number)
24FP Addition
(greater number)
25FP Addition
(greater number)
gtgt
26FP Addition
(greater number)
gtgt
27LNS Addition
comb. logic
28LNS Addition
(greater number)
??
29LNS Addition
- Calculating non-linear function
- Look up table
- single precision 8GB
- Interpolation
- Lewis, D.M., An Accurate LNS Arithmetic Unit
Using Interleaved Memory Function Interpolator
30Lewis Interpolation
- Stored function values in ROM
- 3 closest points
- 2nd order polynomial
31Lewis Interpolation
- Stored function values in ROM
- 3 closest points
- 2nd order polynomial
- 3KB single, 6KB double
32Conversions FP-LNS
comb. logic
33Conversions FP-LNS
- Evaluating log2(mantissa)
- lookup table
- 24MB for single precision
- linear interpolation
- increased error
- approximations
1.
log2
34Conversions FP-LNS
- log2(significand) approximations through division
(Chin-Long Wey) - One division
- 8KB for single
- 300MB for double
- Many divisions
35Conversions FP-LNS
- Evaluating 2fraction
- lookup table
- 24MB for single precision
- linear interpolation
- increased error
- Partition and multiply
comb. logic
2fr
36Conversions FP-LNS
- Evaluating 2fraction
- partition and multiply
- example
37Conversions FP-LNS
- Evaluating 2fraction
- partition and multiply
- example
38Conversions FP-LNS
- Evaluating 2fraction
- partition and multiply
- example
- reduce memory by cube root
- introduces multiplies
39Implementation
- Parameterized LNS and conversion library written
in Verilog - Floating point library from Sandia
- Mapped to VirtexII 2000
40Area Metric
- BRAM 28 slices
- Mults 18 slices
mult
BRAM
slices
41Multiplier Sizes
27x
18x
42Divider Size
94x
46x
43Adder Sizes
4x
3x
44Converter Sizes
45Applications
multiplies and divides
/
LNS
/
46Applications
addition
FP
47Applications
mixed
/
??
48Area Break Even Point mult/div vs. add
LNS
LNS
LNS
LNS
FP
FP
FP
FP
single
double
49Applications
LNS operations FP I/O
FP
FP
Convert
/
??
Convert
LNS
50Conversion Area Overhead
LNS
FP
51Conversion Area Overhead
LNS
FP
52Conversion Area Overhead
LNS
FP
53Performance Metric
- Latency of Circuit
- Time from input to output
- Acyclic circuits
- Circuit dependent
54Latency Data
mult
div
add
55Applications
mixed circuit critical path
/
??
/
56Performance Break Even Point mult/div vs. add
LNS
LNS
LNS
LNS
FP
FP
FP
FP
single
double
57Conclusion
- Area
- No conversion
- gt70 mults vs. adds to make LNS smaller
- gt45 div vs. adds to make LNS smaller
- With Conversion (FP-LNS-FP)
- Benefits must outweigh converter overhead
- Ex
- At most 1 convert per 4 ops in mult-single
- At most 1 convert per 10 ops in mult-double
58Conclusion
- Performance
- Single precision
- gt46 mults vs. adds to make LNS faster
- gt25 div vs. adds to make LNS faster
- Double precision
- gt36 mults vs. adds to make LNS faster
- gt10 div vs. adds to make LNS faster
59A Comparison of Floating Point and Logarithmic
Number Systems on FPGAs
Michael Haselman Michael Beauchamp, Aaron Wood,
Scott Hauck University of Washington K. Scott
Hemmert, Keith Underwood Sandia National
Laboratories
Sandia is a multiprogram laboratory operated by
Sandia Corporation, a Lockheed Martin Company,
for the United States Department of Energys
National Nuclear Security Administration under
contract DE-AC04-94AL85000.