2.1.4
Number Representation
To allow the CPU to logically combine, modify or compare numerical
values, these values must be located in the accumulators (working
registers of the CPU) as binary numbers.
Depending on the operations to be carried out, the following number
representations are permitted in STEP 5:
Binary numbers:
16-bit fixed point numbers
32-bit fixed point numbers
32-bit floating point numbers (with a 24-bit
mantissa)
Decimal numbers: BCD-coded numbers (sign and 3 digits)
Numerical input on the PG
When you use a programmer to input or display number values, you
set the data format on the programmer (e.g. KF or fixed point) in
which you intend to enter or display the values. The programmer
converts the internal representation into the form you have requested.
Permitted operations
You can carry out all arithmetic operations with the 16-bit fixed
point numbers and floating point numbers, including comparison,
addition, subtraction, multiplication and division.
Note
Do not use BCD-coded numbers for arithmetical operations, since
this leads to incorrect results.
Use 32-bit fixed point numbers to execute comparison operations.
These are also necessary as an intermediate level when converting
numbers in BCD code to floating point numbers. With the operations
+D and -D they can also be used for addition and subtraction.
The STEP 5 programming language also has conversion operations that
enable you to convert numbers directly to the most important of the other
numerical representations.
STEP 5 Programming Language
CPU 948 Programming Guide
2 - 8
C79000-G8576-C848-04
Содержание CPU 948
Страница 10: ...Contents CPU 948 Programming Guide 1 2 C79000 G8576 C848 04 ...
Страница 32: ...Contents CPU 948 Programming Guide 2 2 C79000 G8576 C848 04 ...
Страница 72: ...Data Blocks CPU 948 Programming Guide 2 42 C79000 G8576 C848 04 ...
Страница 74: ...Contents CPU 948 Programming Guide 3 2 C79000 G8576 C848 04 ...
Страница 154: ...Contents CPU 948 Programming Guide 4 2 C79000 G8576 C848 04 ...
Страница 200: ...Contents CPU 948 Programming Guide 5 2 C79000 G8576 C848 04 ...
Страница 308: ...Contents CPU 948 Programming Guide 7 2 C79000 G8576 C848 04 ...
Страница 324: ...Examples of Parameter Assignment CPU 948 Programming Guide 7 18 C79000 G8576 C848 04 ...
Страница 326: ...Contents CPU 948 Programming Guide 8 2 C79000 G8576 C848 04 ...
Страница 370: ...Addressable System Data Area CPU 948 Programming Guide 8 46 C79000 G8576 C848 04 ...
Страница 372: ...Contents CPU 948 Programming Guide 9 2 C79000 G8576 C848 04 ...
Страница 404: ...Operations with the Base Address Register BR Register CPU 948 Programming Guide 9 34 C79000 G8576 C848 04 ...
Страница 486: ...Contents CPU 948 Programming Guide 11 2 C79000 G8576 C848 04 ...
Страница 522: ...PG Functions via the S5 Bus CPU 948 Programming Guide 11 38 C79000 G8576 C848 04 ...
Страница 524: ...Contents CPU 948 Programming Guide 12 2 C79000 G8576 C848 04 ...
Страница 538: ...Contents CPU 948 Programming Guide 13 2 C79000 G8576 C848 04 ...
Страница 546: ...List of Key Words CPU 948 Programming Guide Index 6 C79000 G8576 C848 04 ...