Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
24 Applied Instructions (Others)
24.4 CRC / Cyclic Redundancy Check
594
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
2) 8-bit conversion mode [M8161 = ON]
In this mode, the operation is executed only for low-order 8 bits (low-order byte) of device specified by
.
With regard to the operation result, low-order 8 bits (byte) are stored to a device specified by , and
high-order 8 bits (byte) are stored to a device specified by +1.
2. Related devices
*1. Cleared when the PLC mode is changed from RUN to STOP.
Cautions
1) In this instruction, "X
16
+ X
15
+ X
2
+ 1" is used as a polynomial for generating the CRC value (CRC-16).
There are many other standard polynomials for generating the CRC value. Note that the CRC value
completely differs if an adopted polynomial is different.
Reference: Major polynomials for generating the CRC value
2) Some restrictions to applicable devices
S1: Be sure to specify four digits for the bit devices (K4
).
Example: = D100
=D0
n=6
Device Contents of target data
Device storing data
for which the CRC
value is generated
Low-order byte Low-order bits of D100 01H
+1
Low-order byte Low-order bits of D101 03H
+2
Low-order byte Low-order bits of D102 03H
+3
Low-order byte Low-order bits of D103 02H
+4
Low-order byte Low-order bits of D104 00H
+5
Low-order byte Low-order bits of D105 14H
...
-
+n-1
Low-order byte -
Device storing the
generated CRC
value
Low-order byte Low-order bits of D0 E4H
+1
Low-order byte Low-order bits of D1 41H
Related devices Description
M8161
*1
ON CRC instruction operates in the 8-bit mode.
OFF CRC instruction operates in the 16-bit mode.
Name Generating polynomial
CRC-12
X
12
+ X
11
+ X
3
+ X
2
+ X + 1
CRC-16
X
16
+ X
15
+ X
2
+ 1
CRC-32
X
32
+ X
26
+ X
23
+ X
22
+ X
16
+ X
12
+ X
11
+ X
10
+ X
8
+ X
7
+ X
5
+ X
4
+ X
2
+ X + 1
CRC-CCITT
X
16
+ X
12
+ X
5
+ 1
Command input
M8161
M8000
8-bit conversion mode
CRC
EN ENO
d
s
n
*1
*2
*3
Device storing the generated CRC value*3.
Number of 8-bit (byte) data for which the CRC value is
generated or the device storing the number of data
*2.
Head device storing data for which the CRC value
is generated
*1.