You are on page 1of 5

SIEMENS

NUMBERING SYSTEM

SIEMENS
SIMATIC S7 1/9 March 27, 2024
SIEMENS LTD EGYPT 2007
All Rights Reserved
SIEMENS

Objectives

- Know The Different Numbering System.


- Know The Integer, Double Integer, Real Formats & How It Is Used.

SIMATIC S7 2/9 March 27, 2024


SIEMENS LTD EGYPT 2007
All Rights Reserved
SIEMENS

The Numbering Systems

The Decimal Number System uses base 10. It


includes the digits from 0 through 9.
Name Base
The Binary Number System uses base 2
includes only the digits 0 and 1. Binary Base 2

The Hexadecimal Number System uses base Decimal Base 10


16 includes only the digits 0 through 9 and
the letters A, B, C, D, E, and F. Hexadecimal Base 16

Binary Number Formats


The Bit:
The smallest "unit" of data on a binary
computer is a single bit. Size
The Byte Name (bit Example
A byte contains eight bits, it can s)
represent 2^8, or 256, different values. Bit 1 1
The Word
A word contains exactly two bytes, or 16 Byte 8 0000 0101
bit, it can represent 2^16, or 65,536 Word 16 0000 0000 0000 0101
different values.
The Double Word Double 0000 0000 0000 0000
Word
32
A double word contains exactly two 0000 0000 0000 0101
words, or 32 bit, it can represent 2^32,
or 4,294,967,295, different values
SIMATIC S7 3/9 March 27, 2024
SIEMENS LTD EGYPT 2007
All Rights Reserved
SIEMENS
Data Type Data Size S7-Format Min. No. Max. No.

Bool One Bit 2# 2#0 2#1


Binary Format
Byte 8 Bit B#16# B#16#00 B#16#FF
Hex Format
Word 16 Bit B#16# B#16#0000 B#16#FFFF

DWord 32 Bit B#16# B#16#0000_000 B#16#FFFF_FFF


0 F

INT 16 Bit -32767 +32768

DINT 32 Bit L# L# -2147483647 L# +2147483648

Real 32 Bit 0.000000e+000 ±1.175495e+38 ±3.402823e+38

SIMATIC S7 4/9 March 27, 2024


SIEMENS LTD EGYPT 2007
All Rights Reserved
SIEMENS

Integer (INT, 16-Bit Integer)


DEC: + 813 BIN.: 2# 0 0 0 0 0 0 1 1 0 0 1 0 1 1 0 1

DEC: - 813 BIN.: 2# 1 1 1 1 1 1 0 0 1 1 0 1 0 0 1 1


Value Range -32768 to +32767 (without sign: 0 to 65535)

Arithmetic Operations such as + I, * I, <I, ==I

Double Integer (DINT, 32-Bit Integer)


DEC: L# +302019 BIN.: 2# 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 1 1 0 0 0 0 1 1

DEC: L# -302019 BIN.: 2# 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 0 1

Value Range L# -2147483648 to L#+2147483647(without sign: 0 to 4294967295)

Arithmetic Operations: such as + D, * D, <D, ==D

REAL (Floating-point Number, 32 Bit)


Sign of
Real No. e = Exponent (8 Bit) f = Mantissa (23 Bit)

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Value Range -1.175495e-38 to 3.402823e+38

Arithmetic Operations: such as + R, * R, <R, ==R ,sin, acos, ln, exp, SQR

SIMATIC S7 5/9 March 27, 2024


SIEMENS LTD EGYPT 2007
All Rights Reserved

You might also like