• Part: AN575
  • Description: IEEE 754 Compliant Floating-Point Routines
  • Manufacturer: Microchip Technology
  • Size: 349.35 KB
Download AN575 Datasheet PDF
Microchip Technology
AN575
AN575 is IEEE 754 Compliant Floating-Point Routines manufactured by Microchip Technology.
.Data Sheet.co.kr IEEE 754 pliant Floating-Point Routines IEEE 754 pliant Floating-Point Routines Author: Frank Testa INTRODUCTION This application note presents an implementation of the following floating point math routines for the PIC16/17 microcontroller family: INTxx( A ) float to integer conversion FLOxx( A ) NRMxx( A ) FPAxx( A , B ) FPMxx( A , B ) FPDxx( A , B ) integer to float conversion normalize add/subtract multiply divide Decimal 1.0 0.15625 0.1 1.23x10 Using biased exponents permits parison of exponents through a simple unsigned parator, and further results in a unique representation of zero given by f = eb = 0. Algorithms for radix conversion are discussed in APPENDIX A, and can be used to produce the binary floating point representation of a given decimal number. Examples of sign-magnitude floating point representations of some decimal numbers are as follows: e 1 -2 -3 11 f .10000000 .10100000 .10011001110 Routines for the PIC16/17 families are provided in a modified IEEE754 32 bit format together with versions in 24-bit truncated format. FLOATING POINT ARITHMETIC Although fixed point arithmetic can usually be employed in many numerical problems through the use of proper scaling techniques, this approach can bee plicated and sometimes result in less efficient code than is possible using floating point methods[1]. Floating point arithmetic is essentially equivalent to arithmetic in scientific notation relative to a particular base or radix. In the special case of base two or binary arithmetic, a number A has the floating point representation: n A = f - (2 ) , f = e ∑ { a(k) - (2-k) } It is important to note that the only numbers that can be represented exactly in binary arithmetic are those which are sums of powers of two, resulting in non-terminating binary representations of some simple decimal numbers such as .1 as shown above, and leading to truncation errors regardless of the value of...