Omron SYSMAC CS Series Instruction & Reference Manual page 348

Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

3. Instructions
 256-to-8 bit Conversion
When the fourth (leftmost) digit of C is 1, DMPX(077) finds the locations of the leftmost (highest bit
address) or rightmost (lowest bit address) ON bits in one or two 16-word ranges of source words. The
locations of these bits are written to R beginning with the specified byte.
l =0 (Convert one 16-word range.)
Finds leftmost bit
(Highest bit address)
256-to-8 bit decoding
(The location of the leftmost bit in the
16-word range (m) is written to R.)
R
Hint
As shown at right, 16 to 4 encoding consists of
converting the bit number (m) of the leftmost or
rightmost bit that has 1 set among the 16 bits to a
4-bit binary value.
As shown at right, 256 to 8 encoding consists of
converting the bit number (m) of the leftmost or
rightmost bit that has 1 set among the 256 bits to
an 8-bit binary value.
Precaution
 16-to-4 bit conversion
When two or more digits are being converted, DMPX(077) will write the values to the digits in R from
right to left and will wrap around to the rightmost digit after the leftmost digit, if necessary.
 256-to-8 bit conversion
When two bytes are being converted, DMPX(077) will write the values to the bytes in R from right to left
and will wrap around to the rightmost byte if the leftmost byte (byte 1) has been specified as the starting
byte.
 If one word is 0 (no bit to encode) in any of the conversion data specified in S (First
Source Word), the error flag turns ON.
On the CS1G/H-CPU@@(-V1), the error flag turns ON, but Words that are not 0 in the conversion data
specified in S are converted and output to the corresponding digits of R (Result Word).
In models other than the above, the error flag turns ON and nothing is output to R.
314
C
Leftmost
Rightmost
bit
bit
n=1 (Start with byte 1.)
15
0
Rightmost ON bit
255
0
Rightmost ON bit
m
0
0 1
0
0
Leftmost ON bit
m
4 bits
m
0 1
0
8 bits
CS/CJ/NSJ Series Instructions Reference Manual (W474)
0
0
Leftmost ON bit
m

Advertisement

Table of Contents
loading

Table of Contents