Binary Code - Mitsubishi Q-Series User Manual

Programmable logic controller
Hide thumbs Also See for Q-Series:
Table of Contents

Advertisement

4 SEQUENCE PROGRAM CONFIGURATION & EXECUTION
CONDITIONS
4.8.1 BIN (Binary Code)
4 - 22

(1) Binary code

In binary code, numeric values are expressed by numerals "0" (OFF) and "1"
(ON) numerals.
When counting in the decimal system, a carry to the "tens" column occurs
following 9 (8 to 9 to 10).
In the binary system, this carry occurs following 1 (0 to 1 to 10). The binary "10"
therefore represents the decimal "2".
Binary values and their respective decimal values are shown in Fig.4.2 below.
Table 4.2 Binary and Decimal Numeric Value Comparison
DEC (Decimal)
0
1
2
3
4
5
6
7
8
9
10
11
(2) Binary numeric expression
(a)
Basic model QCPU registers (data registers, link registers, etc.) consist of
16 bits, with a "2
The most significant bit (initial bit) is used to discriminate between "positive"
and "negative".
1)
When most significant bit is "0"...Positive
2)
When most significant bit is "1"...Negative
The numeric expressions for the Basic model QCPU registers are shown in
Fig.4.12 below.
b15
Bit name
2
Decimal value
-32768
Fig.4.12 Numeric Expressions for Basic model QCPU Registers
(b)
Usable numeric data for Basic model QCPU
As shown in Fig.4.11, the numeric expression range is -32768 to 32767.
Therefore, numeric data within this range can be stored in the Basic model
QCPU registers.
BIN (Binary)
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
n
" value is allocated to each of the register bits.
Most significant bit (for positive/negative discrimination)
b14 b13 b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
15
2
14
2
13
2
12
2
11
2
10
2
9
16384
8192
4096 20481024 512 256 128 64 32 16 8
"Negative value" when most significant bit is "1".
MELSEC-Q
Carry
Carry
Carry
2
8
2
7
2
6
2
5
2
4
2
3
2
2
4
2
1
2
0
2
1
4 - 22

Advertisement

Table of Contents
loading

Table of Contents