429
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Conversion Instructions
3
GRAY_BIN/GRAY_BINL
Function
z GRAY_BIN(478)
GRAY_BIN(478) converts one word of gray code to one word of binary data. S specifies the source
word containing the gray code and the binary data is output to D.
z GRAY_BINL(479)
GRAY_BINL(479) converts two words of gray code to two words of binary data. S specifies the first of
the two words containing the gray code and the binary data is output to D and D+1.
Example Programming
z GRAY_BIN
When CIO 0.00 turns ON in the following example, the gray code in D0 is converted to binary data and
stored in D10.
z GRAY_BINL
When CIO 0.00 turns ON in the following example, the gray code in D0 and D1 is converted to binary
data and stored in D10 and D11.
1 0 1 0 0 1 0 1
Gray code
Binary code
1 1 0 0 0 1 1 0
GRAY_BIN
D0
D10
0.00
D0
#1930
D10
#11DF
Result of executing
GRAY_BIN
GRAY_BINL
D0
D10
0.00
D0 and D1
#12150918
D10 and D11
#1C19F1EF
Result of executing
GRAY_BINL