Advanced Function Instruction
7 -3 2
FUN56
D
P
G
→
B
GRAY - CODE TO BINARY - CODE CONVERSION
FUN56
D
P
G
→
B
S
:
Starting of source
D
:
Starting address of destination
S
,
D operand can combine V
、
Z
、
P0~P9 for index addressing
WX
WY
WM
WS
TMR CTR
HR
IR
OR
SR
ROR
DR
K
XR
Range
Ope-
rand
WX0
∣
WX240
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3840
∣
R3903
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
0~FFFFH
0~FFFFFFFFH
V
、
Z
P0~P9
S
○
○
○
○
○
○
○
○
○
○
○
○
○
○
D
○
○
○
○
○
*
○
○
●
When operation control "EN"=1 or "EN
↑
"(
P
instruction) changes from 0
→
1, it will perform the code conversion; where S
is the source (Gray code), and D is the destination (Binary code) for storing the result.
●
The conversion method shown as below
:
Example 1: When M0 changes from 0
→
1, it will perform the 16-bit code conversion
M0
EN
S :
D : D100
D0
56P.G B
˙
Converting the 16-bit Gray-code in D0 into
Binary-code, and then storing the result into D100.
D0
=
1001010101010011B
Î
D100
=
1110011001100010B