![Omron CJ1G-CPUxx Instructions Manual Download Page 485](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491485.webp)
464
Conversion Instructions
Section 3-12
C = 0003 (Input Data Range: –1999 to 9999 BCD)
The following table shows the possible BCD values for each signed BCD for-
mat and the corresponding signed binary values.
Flags
Examples
BCD Format 0 (C=#0000)
When CIO 000000 is ON in the following example, the signed BCD data for-
mat and range in D00100 are checked against the format specified in the con-
trol word (0000). The source data is correct, so the signed BCD data in
D00100 is converted to signed binary and output to D00200.
BCD Format 0 (C=#0003)
When CIO 000001 is ON in the following example, the signed BCD data for-
mat and range in D00100 are checked against the format specified in the con-
trol word (0003). The source data is correct, so the signed BCD data in
D00300 is converted to signed binary and output to D00400.
Setting
Signed BCD values
Signed binary values
C=0000 –999 to –1 and 0 to 999
FC19 to FFFF and 0000 to 03E7
C=0001 –7999 to –1 and 0 to 7999
E0C1 to FFFF and 0000 to 1F3F
C=0002 –999 to –1 and 0 to 9999
FC19 to FFFF and 0000 to 270F
C=0003 –1999 to –1 and 0 to 9999
F831 to FFFF and 0000 to 270F
3 digits BCD, 12 bits
0 to 9: Fourth digit BCD
A: Negative (
−
1)
F: Negative (
−
)
B to E: Error
Name
Label
Operation
Error Flag
ER
ON if C is not within the specified range of 0000 to 0003.
ON if C=0002 and the leftmost digit of S is A to E.
ON if C=0003 and the leftmost digit of S is B to E.
ON if the content of S is not BCD.
OFF in all other cases.
Equals Flag
=
ON if D is 0000 after execution.
OFF in all other cases.
Negative Flag
N
ON if bit 15 of D is ON after execution.
OFF in all other cases.
Signed BCD data (–123)
S: D00100
1 1 2 3
Signed binary data
D: D00200
F F 8 5
Signed BCD data
(–1,369)
S: D00300
A 3 6 9
Signed binary data
D: D00400
F A A 7
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...