Sorting networks can be visualized as combinatorial circuits where a set of denoted compare-swap (CS) circuits can be connected in accordance to a specific network topology. This way the CS circuit is formed by a full adder configured as a subtractor and a pair of multiplexers, the carry of the subtractor is used for the selection of the multiplexer.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | Number 1 | Highest number | none |
1 | Number 2 | Second highest number | none |
2 | Number 3 | Third highest number | none |
3 | Number 4 | Fourth highest number | none |
4 | none | Not used | none |
5 | none | Not used | none |
6 | none | Not used | none |
7 | Control | Not used | none |