(100)
BIN D00010 D00011
0000
00
219
5-17 Conversion Instructions
The Conversion Instructions convert word data that is in one format into another
format and output the converted data to specified result word(s). All of these
instructions change only the content of the words to which converted data is be-
ing moved, i.e., the content of source words is the same before and after execu-
tion of any of the conversion instructions. Refer to
5-26 Time Instructions
for
instructions that convert between different time formats.
5-17-1 BCD-TO-BINARY: BIN(100)
(100)
BIN S R
R: Result word CIO, G, A, DM, DR, IR
S: Source word CIO, G, A, T, C, DM, DR, IR
Operand Data AreasLadder Symbol
Variations
j BIN(100)
When the execution condition is OFF, BIN(100) is not executed. When the
execution condition is ON, BIN(100) converts the BCD content of S into the nu-
merically equivalent binary bits, and outputs the binary value to R. Only the con-
tent of R is changed; the content of S is left unchanged.
S
R
BCD
Binary
BIN(100) can be used to convert BCD to binary so that displays on Peripheral
Devices will appear in hexadecimal rather than decimal. It can also be used to
convert to binary to perform binary arithmetic operations rather than BCD arith-
metic operations, e.g., when BCD and binary values must be added.
S must be BCD.
Note Refer to page 115 for general precautions on operand data areas.
Flags ER (A50003): S or content of *DM word is not BCD when set for BCD.
EQ (A50006): 0 has been placed in R
N (A50008): OFF
Example When CIO 000000 is ON in the following example, the content of D00010 is con-
verted from BCD to binary and stored into D00011. The content of D00010 is left
unchanged.
Address Instruction Operands
00000 LD 000000
00001 BIN(100)
D00010
D00011
4D00010 0 9 5
0D00011 0 0 0
4D00010 0 9 5
0D00011 F F F
befor
execution
after
execution
Description
Precautions
Conversion Instructions Section 5-17