430 likes | 555 Views
LNS Subtraction Using Novel Contransformation and/or Interpolation. Panagiotis Vouzis 1 , Sylvain Collange 2 , and Mark Arnold 1 {vouzis@lehigh.edu, sylvain.collange@ens-lyon.fr, maab@lehigh.edu} 1 Computer Engineering, Lehigh University, Bethlehem, USA 2 É cole Normale Sup é rieure de Lyon
E N D
LNS Subtraction Using Novel Contransformation and/or Interpolation Panagiotis Vouzis1, Sylvain Collange2, and Mark Arnold1 {vouzis@lehigh.edu, sylvain.collange@ens-lyon.fr, maab@lehigh.edu} 1Computer Engineering, Lehigh University, Bethlehem, USA 2École Normale Supérieure de Lyon 46 Allée d’Italie 6934 Lyon Cedex 07, France ASAP 2007
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
Input (16 bits) 16-bit µP Core Matrix Coprocessor + LNS Output (16 bits) Write Read CS Data or Status Use of LNS on Embedded Control FPGA Plant Set point u(k) _
Use of LNS on Embedded Control • Drug Delivery • Robotics • Microfluidic control
The Logarithmic Number System (LNS) • x is a two’s complement representation with • k integer bits • l fractional bits l k I. Koren, Computer Arithmetic Algorithms, MA: Brookside Court Publishers, 1998. Chapter 10: Logarithmic Number System
Addition/Subtraction with z>0 x (|x-y|,zs) f(|x-y|),zs) Preprocessing y t + min(x,y)
Addition/Subtraction with z<0 10% – 20% Memory Savings x (-|x-y|,zs) f(-|x-y|),zs) Preprocessing y t + max(x,y)
Addition/Subtraction x (z,zs) f(z,zs) Preprocessing y t + w
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
Addition/Subtraction Optimization • Tabulate only for z ≤ 0 E. E. Swartzlander and A. G. Alexopoulos, “The Sign/Logarithm Number System,” IEEE Transactions on Computers, No. 24, vol. 12, pp. 1238–1242, Dec. 1975.
Addition/Subtraction Optimization • Tabulate only for z ≤ 0 • Tabulate only for sb(z)>2–l, db(z)<–2–l T. Stouraitis. Logarithmic Number System Theory, Analysis, and Design. PhD thesis, Univ. of Florida, Gainesville, Florida, 1986.
Addition/Subtraction Optimization • Tabulate only for z ≤ 0 • Tabulate only for sb(z)>2–l, db(z)<–2–l • Interpolate—Multipartite Tables D. M. Lewis, “An Architecture for Addition and Subtraction of Long Word Length Numbers in the Logarithmic Number System,” IEEE Transactions on Computers, vol. 39, no. 11, pp. 1325–1336, 1990. F. de Dinechin, and A. Tisserand, “Some Improvements on Multipartite Table Methods,” In Proceedings of the 15thSymposium on Computer Arithmetic, pp. 128–135, Vail, Colorado, 11–13 June 2001.
Addition/Subtraction Optimization • Tabulate only for z ≤ 0 • Tabulate only for sb(z)>2–l, db(z)<–2–l • Interpolate—Multipartite Tables • Cotransformation: db(z)=f(sb(t)) M. G. Arnold, “An Improved Cotransformation for Logarithmic Subtraction,” In Proceedings of the International Symposium on Circuits and Systems, pp. 752–755, Scottsdale, AZ, 26–29 May 2002.
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
No Cotransformation x z < 0 -|x-y| max + s/d y Advantages z < 0 means narrower s(z) width Fastest logic Disadvantages size of d(z) > size of s(z) Large d(z) table
Coleman’s Cotransformation x z < 0 -|x-y| max Coleman t1 t2 + s/d y Advantages z < 0 means s(z) width slightly narrower size of d(z) size of s(z) Disadvantage still need d(z)
Arnold’s Cotransformation x z > 0 +|x-y| min Arnold t1 t2 + s y Advantage Can eliminate d(z): low cost fast s(z) table Disadvantage z > 0 means slightly wider s
Vouzis’ Cotransformation x z < 0 -|x-y| max Vouzis t1 t2 t3 + s y Advantages Can eliminate d(z): low cost fast s(z) table z < 0 means s(z) width slightly narrower Easiest HDL coding/fix bug in 2002 “improved” Arnold Disadvantage Need extra cotransformation table
Novel Cotransformation x z < 0 +|x-y| min/max Novel t1 t2 + y s Advantages Can eliminate d(z): low cost fast s(z) table z < 0 means s(z) width slightly narrower No extra cotransformation table Disadvantage Tiny extra mux logic
Coleman’s Cotransformation z1 z2 J. N. Coleman, “Simplification of Table Structure in Logarithmic Arithmetic,” IEE Electronic Letters, vol 31, no. 22, pp. 1905-1906, 26 Oct. 1996.
Coleman’s Cotransformation z1 db(z1) x + (-|x-y|) sb(z) Mux 1 0 Preprocessing db(z2) (-|x-y|) y t + zs max(x,y)
Arnold’s Cotransformation z1 z2 M. G. Arnold, T. A. Bailey, J. R. Cowles, and M. D. Winkel, “Arithmetic Cotransformations in the Real and Complex Logarithmic Number Systems,” IEEE Transactions on Computers, vol. 47, pp. 777-786, July 1998.
Improved Cotransformation zh (k+(l –j) bits) zl (j bits) 100 . . . 0 (h=2j –l, i.e., smallest zh 0) M. G. Arnold, “An Improved Cotransformation for Logarithmic Subtraction,” In Proceedings of the International Symposium on Circuits and Systems, pp. 752–755, Scottsdale, AZ, 26–29 May 2002.
Vouzis’ Cotransformation P. Vouzis, S. Collange, and M. Arnold, “Cotransformation providesArea and Accuracy Improvements in an HDL library for LNS Subtraction,” Accepted for The 10th EuroMicro Conference on Digital Systems and Design, Lübeck, Germany, 27–31 August, 2007.
Graphics Example Corrected by using a 2-value LUT Caused by absence of new special case k=5, l=8, j=5
Novel Cotransformation Combination • Addition Precondition: z < 0 • Subtraction Precondition: z > 0 Special cases needed for z1= 0 and z2= 0. Special cases can be eliminated by storing appropriate values in the LUTs.
Eliminating Special Cases l • Let • Case A: z1 = 0, z2 > 0 • It is proven that t = min(x,y)+db(z2) • Case A: z1 > 0, z2 = 0 • It is proven than t = min(x,y)+db(z1) zH (k+n bits) zL (l−n bits) k n
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
Area and Latency of Vouzis’ vs. Novel Cotransformation l l Area Latency
Guard-bit Simulation Minimal cotransformation guard bits and next-nearest probabilities. Effect of (g) interpolator- and (h) cotransformation-guard bits on error and rounding for l=12. l
Optimized Interpolation/Cotransformation Hybrid l k 11…110 zH zL Assume power-of-two partitioning n Partial Interpolation (k+l-2m)2n Cotransformation 2∙2m Full Interpolation (k+l-n)2n
Error Behavior sb(z) by 2nd-ord. multip. db(z) by vouzis’ cotran. sb(z) by 1st-ord. interp. db(z) by novel cotran. sb(z) by 2nd-ord. multip. db(z) by 2nd-ord. multip. sb(z) by multip. db(z) by multip. sb(z) by multip. db(z) by cotran.
Outline • Logarithmic Number System • Addition/Subtraction Optimization • Cotransformations • Synthesis, Simulation and Error Behavior • Conclusions
Conclusions • LNS is useful for application-specific systems • Overview of existing techniques for LNS addition/subtraction • Overview of existing cotransformation techniques • New cotransformation proposed • New cotransformation studied in terms of area, latency, and error behavior • Cotransformation improves error behavior and area, with a slight cost for latency
Acknowledgements • Nicolas Frantzen and Jesus Garcia for their contributions • The ASAP organizing committee for the shared best-paper award
Thank you for your attention Questions? ASAP 2007