A Novel Approach of Merging Serial and Parallel Sort Algorithms to Enhance Performance on FPGA Ms

A Novel Approach of Merging Serial and Parallel Sort Algorithms to Enhance Performance on FPGA Ms

Zeichen Journal ISSN No: 0932-4747 A Novel Approach of Merging Serial and Parallel sort Algorithms to Enhance Performance on FPGA Ms. Joella Lobo1 and Prof. Sonia Kuwelkar2 1 Student of Maters (Microelectronics), Goa college of Engineering, Farmagudi, Goa India. 2Assistant Professor, Goa college of Engineering, Farmagudi, Goa India. Abstract: Sorting of data is an operation employed in numerous applications and plays a vital role in determining the overall performance, speed, and power. Sorting arranges the data in a particular order. Most previous research on sorting units has focused on implementing the algorithms on software. These require a lot of operational cycles and a large number of iterations. This emphasizes the need for an external sorting unit. FPGA is one of the most commonly used hardware unit for highspeed applications. Numerous sorting techniques have been studied such as the Bubble Sort, Quick Sort, Selection Sort, Insertion Sort, Merge Sort, Heap Sort, etc. Out of these, the Merge sort works the best when sorting huge data sets and bubble sort works best for a small data set. In this paper, some of these sorting algorithms namely serial merge sort, parallel merge sort, bitonic merge sort, oddeven merge sort, the modified merge sort, serial bubble sort, and odd-even transportation sort are analyzed and comparison based on resource utilization, delay, clock cycles, power and area are made by implementing them on the FPGA. Based on the requirement of the application, the appropriate algorithm can be selected. Keywords: FPGA, sorting algorithm, sort algorithms, parallel soring, 1. Introduction Sorting operation arranges a list of data in a particular order which is required by most of the computing applications nowadays [1] . It is easier to manipulate and search data that is in order, thus many other algorithms require that the data is sorted [15]. Sorting is frequently used in modern scientific computing and in commercial data processing. Some of the examples are transaction processing [29], linguistics [30], combinatorial optimization [5], image processing [8], Color sorting [19] weather prediction [14], astrophysics, etc. For many year’s computer science is facing computational problems in sorting of a huge amount of data [4]. Many applications having large databases require faster and better sorting algorithms to yield optimum results. Therefore, we need to increase parallelism so that we can implement efficient sorting primitives [13][20]. Numerous sorting techniques have been studied such as the Bubble Sort, Quick Sort, Selection Sort, Insertion Sort, Merge Sort, Heap Sort, Bucket sort etc. Out of these, the Merge sort works the best when sorting huge data sets and bubble sort works best for a small data set. [11] [12] [21]. Various effective algorithms are known which offer trade- offs in performance, simplicity, cost, memory use, resources used and other factors. But these algorithms do not take into account the features of parallelism on FPGA that significantly affect performance [24]. Reconfigurable gate arrays also referred to as field-programmable gate arrays (FPGA), are extensively utilized in the industry for implementing various digital circuits. FPGA is an integrated circuit that uses gate-level parallelism which multi-core GPPs cannot. It has a large memory that can be approached using a few numbers of pins [28]. Using FPGA has become beneficial to the real-time application [15]. To select among a large number of parallel sorting algorithms, it becomes difficult to select the best algorithm for a particular problem instance [6]. Since there is no identified theoretical model that can be implemented to accurately predict an algorithm's performance, it becomes difficult to make a choice. In the past few years, several implementation studies have been reported in the literature. However, more studies are Volume 6, Issue 7, 2020 Page No:223 Zeichen Journal ISSN No: 0932-4747 needed before we can approach the point where a certain algorithm can be recommended for a particular application with any degree of confidence. 2. Algorithms Sort Type Time Complexity Serial Bubble sort O(n2) Parallel Bubble sort O(n) Serial Merge sort O(n log n) Parallel Merge sort O(log n) Batcher’s bitonic merge sort O(log n)2 Batcher’s odd-even merge sort O(log n)2 Modified merge sort O(log n)2 Table 1. Table Label 2.1. Bubble sort algorithms [2] To select among a large number of parallel sorting algorithms, it Bubble Sort is a simple algorithm that uses internal sorting to sort a given set of 'n' elements provided in the form of an array with 'n' number of elements. It is known as bubble sort, because the largest element with each complete iteration, bubbles up towards the last position or the highest index, similar to how water bubbles rise up to the water surface. Sorting takes place by hopping over all the elements one at a time and comparing it with the neighbouring element and interchanging them if required. 2.1.1 Serial Bubble sort Bubble Sort is a basic sorting algorithm that performs the sorting operation by iteratively comparing the adjacent pair of the given data items and swaps the items if their order is reversed. There is a repetition of the passes through the list is sorted and no more swaps are needed. It is a simple algorithm, but it lacks in efficiency when the given input data set is large. The worst-case as well as the average-case complexity of Bubble Sort is О (n2 ). It is a simple and straightforward sorting algorithm used in computer science. Consider the array with ‘n’ elements, we will start with the first two elements in the array. Since they are not in order, they are exchanged and move on comparing the second and third elements and then the rest of the elements. This completes pass1. Again, we start with the second element and perform the same operation for n-1 elements. If we have 100 elements then the total number of comparisons is 10000. So, in general, if we have total n elements, then we need to repeat this process for n-1 times. Following are the steps involved in bubble sort (for sorting a given array in ascending order): Starting with the first element (index = 0), compare the current element with the next element of the array. 1. If the current data element is greater than the next element of the array, swap them. Volume 6, Issue 7, 2020 Page No:224 Zeichen Journal ISSN No: 0932-4747 2. If the data element is less compared to the next element, then move ahead with the next element and repeat Step 1 Figure 1. Serial Bubble sort 2.1.2 Odd-even transportation sort/ parallel bubble sort Parallelization is a well-known solution to improve performance. Figure 2 shows a hardware design for parallel bubble sort, here comparison blocks in one column are executed in parallel. Odd-Even Transposition Sort is a form of parallel Bubble Sort algorithm. In this method, two adjacent data elements are compared and exchanged, if the first element is found to be greater than the second element. The opposite scenario applies when sorting in descending order. It compares two adjacent numbers and exchanges them, if the first number is greater than the second number to get an ascending order list. Odd-Even transposition sort functions in two phases namely, odd phase and even phase. In both of these phases, adjacent elements are exchanged in the right. Figure 2. Parallel Bubble sort 2.2. Merge sort algorithms [3] When large amounts of data need to be sorted and cannot fit into the main memory of a computing device (usually RAM) it needs to reside within the slower memory which is external to the device (usually a hard drive), in such a situation external sorting is used. Thus, term external sorting is used for a class of sorting algorithms that can manage large amounts of data. It employs a hybrid sort-merge approach. Chunks of data that are small enough to fit in main memory are first read, then sorted, and lastly written out to a temporary file during the sorting phase. In the merge phase, the sorted sub-files are combined into an individual larger file. The merge sort algorithm is an excellent example Volume 6, Issue 7, 2020 Page No:225 Zeichen Journal ISSN No: 0932-4747 of external sorting. We start by splitting the file into small pieces such that the size of each piece is small enough to fit into the main memory. Then each piece is sorted individually in the main memory employing a merge sort sorting algorithm. Lastly, the resulting pieces are merged together into larger pieces, until the file is completely sorted. 2.2.1. Serial merge Merge sort sorting algorithm is a very prominent and efficient sorting algorithm. It is a stable sorting algorithm and is very efficient to handle big numbers. It is based on the following three steps: 1. Divide the given list or record into a number of sub lists in such a way that every list or sub list is half divided 2. Conquer the sub list by the recursion method 3. Combine the sorted sub list simply by merging Figure 3. Serial Merge sort 2.2.2. Parallel merge With FPGA problems can be solved in a parallel fashion. This sort is very similar to serial merge, only difference is that here all sub arrays are executed in parallel. The number of steps required for computation is much lesser than serial merge sort. A parallel merge algorithm performs a merge operation on two sorted sequences of length. To produce a single sorted sequence of length equal to its input sequence.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    17 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us