Programming instructions

42
Bit Value
8 4 2 1 8 4 2 1
0 0 1 0 0 1 1 0
7 6 5 4 3 2 1 0
Bit Number
4.4 Binary Coded Decimal
Binary coded decimal has the same counting sequence as Decimal, 0~9, but has
the same format as binary. Break down each decimal digit into 4 binary bits.
When converting BCD to Binary, break down each decimal digit into 4 binary
bits.
Decimal 26 =
2 6
BCD was developed with the use of decimal devices in mind, like thumbwheels
and seven segment displays. Decimal devices only count from 0~9, and require
the use of 4 binary bits to do so.
The difference between Binary and BCD is apparent when converting from
decimal.
Converting decimal 12 to binary, bits 3 (value of 8), and 2 (value of 4) are ‘1’.
Converting BCD 12 to binary, bits 4 (value of 8), and 1 (value of 4) are ‘1’.
In the FX-Series PLC there are dedicated commands to convert between BCD
and BINARY.
The BCD command converts from BINARY to BCD.
The BIN command converts from BCD to BINARY.
DECIMAL 2 9 12 30
BCD 0000 0010 0000 1001 0001 0010 0011 0000