19 bcd conversion instruction (bcd) – Yaskawa Ladder Works Programming Manual User Manual
Page 49

2.19 BCD CONVERSION Instruction (BCD)
2-32
2.19 BCD CONVERSION Instruction (BCD)
[Outline]
The BCD instruction converts a binary value in the Source into a BCD value (BCD conversion) and
the result is stored in the Dest. If the 4 - digit decimal value in the Source is abcd, the output value
(Dest) of the BCD instruction can be determined by the following formula:
Dest = (a × 4096) + (b × 256) + (c × 16) + d
Although the above formula is applicable even if the value in the Source cannot be expressed in BCD
notation (e.g. numbers greater than 9999 or negative numbers), correct results are obtained in such
cases.
[Format]
Symbol : BCD
Full Name : Convert to BCD
Category : MATH
Icon :
[Parameter]
Parameter Name
Setting
Source
· Any integer type and double-length integer type register
· Any integer type and double-length integer type register with subscript
· Subscript register
Dest
· Any integer type and double-length integer type register (except for # and
C registers)
· Any integer type and double-length integer type register with subscript
(except for # and C registers)
· Subscript register
[Program Example]
Integer type data
Double-length integer type data