SW006010 Microchip Technology, SW006010 Datasheet - Page 112

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
MPLAB
apRNOVS^-page 108
C17 C Compiler Libraries
The sign bit is stored in the MSB of the mantissa. To allow the full 24-bit precision of
the mantissa, the MSB is assumed to be 1 explicitly, once the sign bit is stripped out.
To calculate A
Since the MSB is explicitly 1, the expansion will always contain the term 2
EQUATION 5-5:
As in AN575, we will use the example of the decimal number 50.2654824574. which
has a floating point representation of 0x84490FDB, with the biased exponent being
0x84 and the mantissa (including sign bit) being 0x490FDB. The unbiased exponent
is calculated to be Exp = 0x84 - 0x7F = 0x05. To process the mantissa, it is first
translated to binary format and the MSB is set to prepare for the expansion.
0x490FDB =
0100 1001 0000 1111 1101 1011
1100 1001 0000 1111 1101 1011
The expansion is then performed according to Equation 5-5.
A
2
A
Finally, to calculate the actual floating point number, the exponent and expanded
mantissa are plugged into the conversion formula (Equation 5-4).
A
A
The result of these calculations are accurate out to about 5 decimal places, with
rounding and calculation errors creating some degree of uncertainty for the remaining
decimal places. For more details on the sources of error, please consult AN575.
A
-19
2
2
10
10
2
=
=
=
=
+ 2
=
-20
2
2
1.570796371
2
50.26548387
0
0
0
+ 2
+ 2
• 1.570796371
+
(
2
-22
-1
Bit22
, a simple binary expansion is used, as shown in the formula below.
+ 2
+ 2
-4
-23
) 2
+ 2
-7
1 –
+ 2
+
-12
(
Bit21
2
2
+ 2
-13
) 2
+ 2
2 –
-14
+
+ 2
-15
+
+ 2
(
Bit0
-16
 2002 Microchip Technology Inc.
+ 2
) 2
-17
23
+
0
.

Related parts for SW006010