High−level Instructions
3 − 209
Explanation of example
Encodes contens of data register DT11 and DT10 according to the n: H5 when trigger R20 turns on. The
encoded result is stored in 8 bits of data register DT20 starting from bit position 0.
00 00 00 00
····
Bit position
·····
DT11
15
000
12
0
11
000
8
0
7
000
4
0
3
000
0
0
·· ·
Bit position
·····
DT20
15
0
12
0
11
0
8
0
7
0
4
0
3
1
0
0
Destination
Source
[S]
[D]
When n: H0005
Number of bits to be encoded: 2
5
= 32 bits
Starting bit position to be encoded for destination data: bit position 0
····
Bit position
·····
DT10
15
000
12
0
11
000
8
1
7
000
4
0
3
000
0
0
Decimal
K8
The 8th bit of 32-bit
data is in the on state.
32 bits specified by H5
The encoded result K8
(decimal) is stored in DT20.
Bit position 8 to 15
are filled with 0.
Encoded result:K8
Starting bit position
Description
Encodes the contents of data specified by S according to the contents of n. The encoded result is stored in the
16-bit area specified by D starting from the specified bit position.
If more than one bit is on in a segment being decoded, the uppermost bit is effective.
The contents of the 2nL segment at the beginning of the area specified by the S are encoded. The encoded
results are stored as decimal data, in the eight bits starting from the bit specified as the nH bit.
Invalid bits in the specified area for the result are set to 0.