4-21
4 Understanding Programming
CP2E CPU Unit Software User’s Manual(W614)
4-4 Programming Instructions
4
4-4-6 Data Formats
* Data range for single-precision floating-point decimal: -3.402823 × 10
38
≤ Value ≤ -1.175494 × 10
-38
, 0, +1.175494 ×
10
-38
≤ Value ≤ 3.402823 × 10
38
Type Data format
Decimal
equivalent
4-digit
hexadeci-
mal
BCD (binary
coded deci-
mal)
#0 to #9999 #0000 to
#9999
Single-preci-
sion floating-
point decimal
This format conforms to the IEEE 754 standard for single-precision floating-
point data. It is used only with instructions that convert or calculate floating-
point data.
• Input using operands in the CX-Programmer as signed decimal or 32-bit
hexadecimal with the # symbol.
• When inputting operands in the I/O Memory Edit/Monitor Window of the CX-
Programmer as signed decimal values with seven digits or less, the value will
be automatically converted to scientific notation (mantissa× 10
Exponent
) for
setting and monitoring. Inputs must be made using scientific notation for val-
ues with eight or more digits.
Example: When -1234.00 is input, it will become -1.234000e+003 in scientific
notation. For the mantissa×10
Exponent
, the value before the e is the man-
tissa and the value after the e is the signed exponent.
* −
2
3
2
2
2
1
2
0
BCD →
Decimal →
15 14
13 12 11 10 9 8 7 6 5 4 3 2 1 0
2
3
2
2
2
1
2
0
2
3
2
2
2
1
2
0
2
3
2
2
2
1
2
0
0 to 9 0 to 9 0 to 9 0 to 9
Sign of
mantissa
Exponent Mantissa
Value = (-1)
sign
×1.[Mantissa] × 2
Exponent
· Sign bit (bit 31): 1: Negative, 0: Positive
· Mantissa: The 23 bits from bit 00 to bit 22 contain the mantissa, i.e., the portion
below the decimal point in 1. .....,in binary.
Indicates this value.
3031 29 23 2122 20 19 2 1 0
Binary
· The 8 bits from bit 23 to bit 30 contain the exponent. The exponent
is expressed in binary as the n in 2
n
. The actual value is 2
n-127
.