X8 Instruction Set Reference Manual
11-2
Converion Instructions
The conversion instructions multiplex and de-multiplex data and perform
conversions between binary and decimal values.
DECD - Decode 4 to 1-of-16
Instruction Type: output
The DECD instruction uses the lower four bits of the source word to set
mu
l
tiplex 16 bit of the destination word.
The 4 bits of the source to destination shown in the table below:
Instruction
Description
DECO
Decodes 4 to 1-of-16
Decodes a 4-bit value , turning on the corresponding bit in
the 16-bit destination.
ENCO
Encode 1-of-16 to 4.
Encodes a 16-bit source to a 4-bit value.
BIN
Convert From Binary Coded Decimal
Convert BCD source to decimal values.
TOD - Convert to Binary
Coded Decimal
Converts the integer source value to BCD format and
stores it in the destination.
GCD - Gray Code
Converts Gray code data (Source) to an integer value and
stores it in the destination.
Parameter
Data Table
SFR
Address
Mode
Address
Level
Y
X
SR
B
TM
, C
T, C
R
N
F
ST
A
L
MG,
PD
RP
PS
RTC
HSC
PTO, PWM
STI
EII
BHI
MM
I
CS
-C
om
ms
DLS-Dat
aLog
Immediate
Direct
Ind
irec
t
Bi
t
Wo
rd
Lo
ngW
ord
El
em
en
t
Source
√
√
√
√
√
√
√
√
√
Destination
√
√
√
√
√
√
√
√
√
DECO
EN
ENO
IN
N4.31 -
OUT - N4.32
0002h <
> 0000000000000100
Decode 4 to 1-of-16
Source Bits
Destination Bits
15 to 04
03
02
01
00
15
14
13
12
11
10
09
08
07
06
05
04
03
02
01
00
X
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
X
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
Summary of Contents for X8 Series
Page 1: ...Catalog Number s X8 M14DDT X8 M16DDR X8 M32DDT X8 Instruction Manual Reference Manual ...
Page 16: ......
Page 64: ...X8 Instruction Set Reference Manual 2 12 X8 Series PLC Memory and Data Table ...
Page 166: ...X8 Instruction Set Reference Manual 7 8 Relay Type Bit Instructions ...
Page 180: ...X8 Instruction Set Reference Manual 8 14 Timer and Counter Instructions ...
Page 205: ...X8 Instruction Set Reference Manual Math Instructions 10 17 ...
Page 206: ...X8 Instruction Set Reference Manual 10 18 Math Instructions ...
Page 212: ...X8 Instruction Set Reference Manual 11 6 Converion Instructions ...
Page 218: ...X8 Instruction Set Reference Manual 12 6 Logical Instructions ...
Page 236: ...X8 Instruction Set Reference Manual 15 8 Shift and FIFO LIFO Instructions ...
Page 242: ...X8 Instruction Set Reference Manual 16 6 Sequencing Instructions ...
Page 252: ...X8 Instruction Set Reference Manual 18 4 Input and Output Instructions ...
Page 280: ...X8 Instruction Set Reference Manual 20 12 PID Control ...
Page 296: ...X8 Instruction Set Reference Manual 21 16 ASCII Instructions ...
Page 308: ...X8 Instruction Set Reference Manual 22 12 Communications Instructions ...
Page 312: ...Appendix A 4 System Error Code ...
Page 313: ...Appendix B MSG Instruction Error Code MSG Instruction Error Code ...
Page 322: ...Appendix B 10 MSG Instruction Error Code ...
Page 325: ...ASCII Character Set Appendix C 3 ...
Page 326: ...Publication number X8 RM001A EN September 2012 ...
Page 327: ...Copyright 2012 RS Automation Co Ltd All rights reserved ...