Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
19 Applied Instructions (Data Operation 2)
19.7 SORT2 / Sort Tabulated Data 2
515
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
11
Applied Instructions
(Data Operation)
12
Applied Instructions
(High Speed
Processing)
13
Applied Instructions
(Handy
Instruction)
14
Applied Instructions
(External FX I/O
Device)
15
Applied Instructions
(External Device
(optional device))
16
Applied Instructions
(External Device)
17
Applied Instructions
(Data Transfer 2)
18
Applied Instructions
(Floating Point)
19
Applied Instructions
(Data Operation 2)
20
Applied Instructions
(Positioning
Control)
3. Operation example
The operation is as follows when the following sorting source data is executed in "n=K2 (column number 2)",
"n=K3 (column number 3)".
The operation example is a case of 16-bit operation. In the case of 32-bit operation, the data table should be
composed of BIN 32 bits.
When a serial number such as management number is entered in the first column, it is convenient because
the original row number can be judged from its content.
Sorting source data
1) Sorting result when instruction is executed in n=K2 (column number 2) (ascending order)
2) Sorting result when instruction is executed in n=K3 (column number 3) (descending order)
Number of groups m2 (in the case of m2=K4)
Column
number
1 2 3 4
Row
number
Management
number
Height Body weight Age
In the
case of
number of
data m1=5
1
+1 +2 +3
1 150 45 20
2
+4 +5 +6 +7
2 180 50 40
3
+8 +9 +10 +11
3 160 70 30
4
+12 +13 +14 +15
410020 8
5
+16 +17 +18 +19
5 150 50 45
Column
number
1 2 3 4
Row
number
Management
number
Height Body weight Age
1
+1 +2 +3
4 100 20 8
2
+4 +5 +6 +7
1 150 45 20
3
+8 +9 +10 +11
5 150 50 45
4
+12 +13 +14 +15
3 160 70 30
5
+16 +17 +18 +19
2 180 50 40
Column
number
1 2 3 4
Row
number
Management
number
Height Body weight Age
1
+1 +2 +3
3 160 70 30
2
+4 +5 +6 +7
2 180 50 40
3
+8 +9 +10 +11
5 150 50 45
4
+12 +13 +14 +15
1 150 45 20
5
+16 +17 +18 +19
4 100 20 8