Appendix Programming Information
1251
40.4 Real Numbers
Instructions used with the FP10SH and the FP2 series allow the use of real numbers for calculation. Real
number types available are floating point constants and BCD constants.
40.4.1 Floating Point Constant (f)
Floating point constants consist of two words processed by single precision floating point logic. There are up to
seven effective digits. The mantissa is 23 bits and the exponent is 8 bits. (Based on IEEE754)
31 30 29 23 22 16
... ...
14 13 12 3 2 1 015
...
Bit position
Exponents (8-bit)
Mantissa (23-bit)
0 positive
1 negative
Sign bit:
Numbers which can be used are: ±(1.175494 x 10
-38
to 3.402823 x 10
38
).
40.4.2 BCD Type Constant
BCD-type floating-point constants are processed as three words as shown below.
Example
DTx
DTx+1
DTx+2
Sign: 0 when positive
1 when negative
Integer:
Decimal:
Numbers which can be used are as follows: -9999.9999 to 9999.9999
The principal instructions which allow use of BCD constants are:
F300 BSIN BCD type sine operation
F301 BCOS BCD type cosine operation
F302 BTAN BCD type tangent operation
F303 BASIN BCD type arcsine operation
F304 BACOS BCD type arccosine operation
F305 BATAN BCD type arctangent operation
In FPWIN Pro use 16# to specify a BCD constant. This data type is implemented as ARRAY 0..2 OF WORD.