You are on page 1of 3

Number Representation

To allow the CPU to logically combine, modify or Compare numerical values, these values must be loaded in the accumulators.
Different types of Data format possible for SIMATIC S5 CPUs

Binary Format
L KM 0111 0000 1111 1010 // Binary Pattern (16 bits)

Hexadecimal Numbers
L KH FFFF //Hexadecimal Pattern (Max. 4 digits)

Unsigned Decimal For Each Byte


L KY 12,34 // For two absolute numbers,one byte each.
1-3 SIMATIC S5

Text (ASCII Chact.) Format


L KS ?s //ASCII chact. text

Fix-Point Numbers( INT numbers)


L KF + 345 //Decimal number with sign.

Range :- -32768 to +32768. Structure : 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0


Sign Bit
0 = Positive 1 = Nagative

Value
Value : 5 4 3 2 1 0 2 +2 +2 +2 +2 +2 2-3 SIMATIC S5

Hexadecimal Number with Double Word:


L KD FFFF FFFF //Hexadecimal Pattern (Max. 8 digits)

Floating-Point Numbers( Real numbers)


L KG + 345e 02 //Real number with sign.

Structure :
31 22 0

0 0 0 0 0 0 0 0 0 01 0 1 1 1 0 0 0 0 0 0 0 0 0 0 01 0 1 1 1 0
Sign Bit of exp. Exponent
0 = Positive 1 = Nagative

Mantissa Sign Bit of Mantissa


2-5 SIMATIC S5

You might also like