Two-tone sequencing network based on Batcher comparator

Source: Internet
Author: User

1. Batcher Comparator

The Batcher comparator refers to the maximum value of max{x,y} and the minimum value min{x,y} if the input x, Y is given at the two inputs and the output is at two outputs. As shown in 1, we specify a minimum output value for the upper output of the Batcher comparator and a maximum output value at the output end.

2. Double-tone sequence

A so-called double-tone sequence (Bitonic Sequence) is a sequence, such as a sequence (23,10,8,3,5,7,11,78), consisting of a non-strict sequence x and a non-strict minus sequence Y (where the smallest element of x is exactly the largest element of Y). 23,10,8 is the subtraction sequence, the 8,3,5,7,11,78 is the increment sequence, and 8 is the intermediate element. The specific mathematical definition is Jiangzi de:

Definition: A sequence a1,a2,..., an is a double-tone sequence (Bitonic Sequence), if

(1) There is an AK (1≤k≤n) that makes a1≥ ... ≥ak≤ ... ≤an is established, or

(2) sequence capable of cyclic displacement satisfying conditions (1)

In general, the two-tone sequence has an intermediate element, the left side of which is an increment sequence (or subtraction sequence), and the right side is a minus sequence (or an increment sequence). 2 (the downward and upward slashes represent the subtraction sequence and the increment sequence, respectively):

3. Batcher theorem

  The Batcher theorem is to say that any one of the double-tone series of 2n is cut in half from the middle, divided into equal length two sequences x and Y, and then x and y in the same position of the element Xi and Yi, small to the min sequence, large put to the max sequence. The resulting max sequence and min sequence are also two-tone sequences. And each element of the min sequence is less than or equal to each element of the max sequence. 3 is shown below:

4. Double-tuned merging network based on Batcher theorem

Using the Batcher theorem, we can divide any two-tone sequence A, which is 2n long, into a min sequence and a max sequence, then divide the min sequence and the max sequence, and so on, until N=1. Finally, all sub-sequences containing two elements are then merged into a fully ordered sequence. 4 is shown below:

5. Two-Tone sorting network

The input of a double-tuned merge network must be a double-tone sequence. If you want to turn it into a sort network for any input sequence, you first need to convert the input sequence to a double-tone sequence. The main idea is: the sequence of length 2n is regarded as an ordered sequence of n 2 elements, and any two ordered sequence can be composed of a 4-element double-modulation sequence, then a double-modulation sequence of N/2 4 elements can be obtained, and the double-modulation sequence of 4 element is obtained by merging the network with a 4-input double-tune. The ordered sequence of two 4 elements can be composed of a 8-element two-tone sequence, and then a sequential sequence of 8 elements is obtained by a 8-input double-tuned network; and so on, until the end of an ordered sequence of 2n elements. 5 is shown below:

Reference documents:

1. Batcher Merge Network

2. Double-tone sequencing

3. Selection and sequencing of comparator networks

4. Parallel computing-structure, algorithm, and Programming (3rd edition) Guoliang Chen

Two-tone sort network based on the Batcher comparator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.