b) in a data block:
You want to define the number N = - 0.005 as a floating point
constant.
Input:
6: KG = - 5 - 2
Numbers in BCD code
Decimal numbers are represented as numbers in BCD code. With their
sign and three digits, they occupy 16 bits (1 word) in an accumulator
as shown in the following example:
15 12 11 8 7 4 3 0
V V V V hundreds tens ones
The individual digits are positive 4-bit binary numbers between 0000 and
1001 (0 and 9 decimal).
The left bits are reserved for the sign as follows:
Sign for a positive number: 0000
Sign for a negative number: 1111
Permissible numerical range
-999 to +999
PG display after you enter the line:
:L KG + 1234567 + 02
Mantissa with sign Exponent (base 10)
with sign
Value of the number input: +0.1234567 x 10
+2
= 12.34567
PG display after you enter the line:
6: KG =- 5000000 - 02
Mantissa with sign Exponent (base 10)
with sign
Value of the number input : - 0.5 x 10
-2
= 0.005
STEP 5 Programming Language
CPU 948 Programming Guide
C79000-G8576-C848-04
2 - 11