Bubble sort is one of the simplest strategies for sorting an array of numbers. The algorithm consists of repeatedly exchanging pairs of adjacent numbers that are out of order until no such pair remains. The serial software implementation of bubble sort has a time complexity that is quadratic in the number of elements to sort. This is because only one pair of numbers can be examined at a time, and n passes must be taken through the array to ensure the elements are completely sorted, where n is the number of elements. The parallel hardware version generated by the bubble sort DCS generator sorts elements in a number of clock cycles that is linear with n, and requires an amount of hardware on the order of n. The design stores the elements in an array of n registers whose outputs feed through two levels of staggered comparators and back to the register inputs. The comparators are fully combinational modules that output the greater and lesser of its two inputs. Each comparator implements at most one swap during one clock period. The result is that the register array contains the sorted elements after n/2 clock edges.