
Chapter 5. Application instructions
5-80
2) Program example
-
Program that encode the 8- bits (bit 0 ~ bit 7) of P06 word and stores the encoding result to the P06
word when P020 is switched on.
-
Program that encode the current value of counter C000 and stores the encoding result at the P05
word. The counter C000 is increased at every 1 sec.
ENCOP P02 P06 3
P020
0
0
1
1
1
0
1
0
1
1
0
1
0
0
1
1
P02
D
C
F
E
9
8
B
A
5
4
7
6
1
0
3
2
The highest
position ‘1’ is
bit 7
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
P06
D
C
F
E
9
8
B
A
5
4
7
6
1
0
3
2
Encoding
result = h0007
When n = 3,
8 (=2
n
) bits are effective