296
Conversion Instructions
Section 5-20
5-20-6 16-TO-4 ENCODER – DMPX(77)
Limitations
The rightmost two digits of Di must each be between 0 and 3.
All source words must be in the same data area.
DM 6144 to DM 6655 cannot be used for SB, R, or Di.
Description
When the execution condition is OFF, DMPX(77) is not executed. When the
execution condition is ON, DMPX(77) determines the position of the highest
ON bit in S, encodes it into single-digit hexadecimal value corresponding to
the bit number of the highest ON bit number, then transfers the hexadecimal
value to the specified digit in R. The digits to receive the results are specified
in Di, which also specifies the number of digits to be encoded.
The following is an example of a one-digit encode operation to digit number 1
of R, i.e., here Di would be 0001.
S: DM 0020
DM 0020
00
HR 1000
0
HR 1100
0
HR 1200
1
DM 0020
01
HR 1001
0
HR 1101
0
HR 1201
0
DM 0020
02
HR 1002
0
HR 1102
0
HR 1202
0
DM 0020
03
HR 1003
0
HR 1103
0
HR 1203
0
DM 0020
04
1
HR 1004
0
HR 1104
0
HR 1204
0
DM 0020
05
1
HR 1005
0
HR 1105
0
HR 1205
0
DM 0020
06
1
HR 1006
0
HR 1106
1
HR 1206
0
DM 0020
07
1
HR 1007
0
HR 1107
0
HR 1207
0
DM 0020
08
0
HR 1008
0
HR 1108
0
HR 1208
0
DM 0020
09
1
HR 1009
0
HR 1109
0
HR 1209
0
DM 0020
10
1
HR 1010
0
HR 1110
0
HR 1210
0
DM 0020
11
0
HR 1011
0
HR 1111
0
HR 1211
0
DM 0020
12
0
HR 1012
0
HR 1112
0
HR 1212
0
DM 0020
13
0
HR 1013
0
HR 1113
0
HR 1213
0
DM 0020
14
0
HR 1014
0
HR 1114
0
HR 1214
0
DM 0020
15
0
HR 1015
1
HR 1115
0
HR 1215
0
15
6
0
Not
Converted
R: HR 10
R+1: HR 11
R+2: HR 12
SB
:
First source word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR
R
:
Result word
IR, SR, AR, DM, EM, HR, LR
Ladder Symbols
Operand Data Areas
Di
:
Digit designator
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
DMPX(77)
SB
R
Di
@DMPX(77)
SB
R
Di
Result word
First source word
C
0 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0
C transferred to indicate bit number 12 as
the highest ON bit.