Mitsubishi Electric MELSEC iQ-F Series Training Manual page 57

Hide thumbs Also See for MELSEC iQ-F Series:
Table of Contents

Advertisement

Notation of Values (Data)
The programmable controller CPU converts all information into on or off signals (logical 1 or 0) to store and process them.
Thus, the programmable controller executes numerical operations using the numerical values stored as logical 1 or 0 (binary
numbers = BIN).
In daily life, decimal values are commonly used. Thus, the decimal-to-binary conversion or the binary-to-decimal conversion
are required when values are read (monitored) or written from/to the programmable controller. The engineering tool and some
instructions have the functions for those conversions.
This section describes how values (data) are expressed in decimal, binary, hexadecimal or binary-coded decimal notation
(BCD), and how to convert values.
Decimal
• A decimal value consists of ten symbols, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, which represent the order and size (amount).
After a digit reaches 9, an increment resets it to 0, causing an increment of the next digit to the left.
• The following shows how a decimal value (in this case 153) is represented.
"Power of digit" can be expressed as follows.
: Digit number (0, 1, 2 ...)
n
10: Decimal value
• In the programmable controller, the symbol "K" is used to represent a value in decimal.
Binary (BIN)
• A binary value consists of two symbols, 0 and 1, which represent the order and size (amount). After a digit reaches 1, an
increment resets it to 0, causing an increment of the next digit to the left. One digit of 0 or 1 is called a bit.
Binary
Decimal
0
0
1
1
10
2
11
3
100
4
101
5
110
6
111
7
1000
8
• The following example describes how to convert a binary value into a decimal value.
"10011101"
The following figure shows the binary value with bit numbers and binary bit weights.
The binary value is broken as follows.
= 1 × 128 + 0 × 64 + 0 × 32 + 1 × 16 + 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1
= 128 + 16 + 8 + 4 + 1
= 157
A binary value can be converted into a decimal value by the addition of the weight of each bit whose code is 1.
153 = 100 + 50 + 3
= 1 × 100 + 5 × 10 + 3 × 1
= 1 × 10
+ 5 × 10
2
1
7
6
5
4
3
1
0
0
1
1
2
2
2
2
2
7
6
5
4
3
128
64
32
16
8
+ 3 × 10
0
Decimal symbol (0 to 9)
"Power of digit"
2
1
0
← Bit number
1
0
1
← Binary
← (Bit number)
2
2
2
2
1
0
← ("Binary")
4
2
1
57
Bit weight

Advertisement

Table of Contents
loading

Table of Contents