519
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.
S: D00100
1 1 2 3
D: D00200
F F 8 5
Signed binary data
Signed BCD data (–123)
S: D00300
A 3 6 9
D: D00400
F A A 7
Signed BCD data
(–1,369)
Signed binary data