Siemens CPU 948 Programming Manual page 41

Simatic s5 s5-155u
Table of Contents

Advertisement

Numbers in BCD code
Permissible numerical range
CPU 948 Programming Guide
C79000-G8576-C848-04
b)
in a data block:
PG display after you enter the line:
:L
KG + 1234567 + 02
Mantissa with sign
Value of the number input: +0.1234567 x 10
You want to define the number N = - 0.005 as a floating point
constant.
Input:
6:
KG
= - 5 - 2
PG display after you enter the line:
6:
KG
=- 5000000 - 02
Mantissa with sign
Value of the number input :
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
V V V V
hundreds
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:
Sign for a negative number:
-999 to +999
STEP 5 Programming Language
Exponent (base 10)
with sign
+2
= 12.34567
Exponent (base 10)
with sign
-2
- 0.5 x 10
= 0.005
8 7
4 3
tens
0000
1111
0
ones
2 - 11

Advertisement

Table of Contents
loading

Table of Contents