Patent ID: 9417841
Filing Date: 2016-08-16
CPC Classification: G06F

Claim Text:
1. A method for sorting with re-configurability, adapted to a reconfigurable sorting device having a plurality of serially-connected comparison units, wherein all or part of the comparison unit of the sorting device join the storing task, each comparison unit includes two registers for buffering numerals to be sorted, before entering an input mode, the sorting device allocates a sorter group based on the number of numerals to be sorted, the sorter group joining the sorting task includes a plurality of comparison units corresponding to the number of the numerals to be sorted, and wherein the sorting device allocates one or more sorter groups according to the sorting task and the every sorter group is configured to have its own input end and output end, the method comprising: entering the input mode, comprising: (1) setting initial values of the registers in the plurality of comparison units as a maximum or a minimum, and the sorting device includes an input end and an output end; (2) sequentially inputting a plurality of numerals to be sorted via the input end; (3) buffering the input numerals via the input end to a register of a first comparison unit of the serially-connected comparison units; in which an original value in the register for buffering the input numerals is shifted to the register in another comparison unit; (4) comparing numerals buffered in the registers when the numeral in every register of every comparison unit is changed; then determining the numeral stayed in every register of every comparison unit according to the comparison; (5) repeating the steps (2), (3), and (4) until the numerals are completely inputted; entering an output mode, comprising: (6) sequentially outputting the numerals buffered in the registers of the first comparison unit via the output end; (7) comparing the numerals buffered in the register in a next comparison unit next to the first comparison unit, and shifting one of the numerals-to the register where the buffered numeral is outputted according to the comparison; (8) comparing numerals buffered in the registers when the numeral in every register of every comparison unit is changed; determining the numeral stayed in the every register of every comparison unit according to the comparison; (9) repeating the steps (6), (7), and (8) until all the numerals are outputted.