278
Programming Appendix A
Note Signed BCD Data
Signed BCD data is a special data format that is used to express negative numbers in BCD. Although
this format is found in applications, it is not strictly defined and depends on the specific application. The
FQM1 supports four data formats and supports the following instructions to convert the data formats:
SIGNED BCD-TO-BINARY: BINS(470) and SIGNED BINARY-TO-BCD: BCDS(471). Refer to the
Instructions Reference Manual (Cat. No. O011) for more information.
Decimal Hexadecimal Binary BCD
0 0 0000 0000
1 1 0001 0001
2 2 0010 0010
3 3 0011 0011
4 4 0100 0100
5 5 0101 0101
6 6 0110 0110
7 7 0111 0111
8 8 1000 1000
9 9 1001 1001
10 A 1010 0001 0000
11 B 1011 0001 0001
12 C 1100 0001 0010
13 D 1101 0001 0011
14 E 1110 0001 0100
15 F 1111 0001 0101
16 10 10000 0001 0110
Decimal Unsigned binary (4-digit hexadecimal) Signed binary (4-digit hexadecimal)
+65,535 FFFF Cannot be expressed.
+65,534 FFFE
.
.
.
.
.
.
+32,769 8001
+32,768 8000
+32,767 7FFF 7FFF
+32,766 7FFE 7FFE
.
.
.
.
.
.
.
.
.
+2 0002 0002
+1 0001 0001
0 0000 0000
–1 Cannot be expressed. FFFF
–2 FFFE
.
.
.
.
.
.
–32,767 8001
–32,768 8000