Hardware Implementatioon of Sorting Algorithm Using FPGA Ijariie7623
Hardware Implementatioon of Sorting Algorithm Using FPGA Ijariie7623
ABSTRACT
Sorting is one of the most fundamental topics in computer science, It is the basic process in data analysis
and in an enormous application.Software sorting doesn't provide efficiency so hardware sorting is used.In this
proposed system the different hardware sorting is compared and the best sorting is justified.The register
transfer level of each sorting is schematic by this paper.The model simulation also provided so, it is easy to
compare the sorting.The bitonic merge sort and Bitonic odd even sort using parallelism concept are proposed in
this paper.
Keyword:- Bitonic merge,Bitonic odd even merge sort, Comparator, Bubble sort, Parallelism, Register
transistor level,Comparison,Simulation.,4 bit,8 bit,16 bit,32 bit.
1.Introduction
The process of sorting is one of the most fundamental problems in computer science, and sorting
algorithms are vital for computer engineering [1]. A large number of applications employ sorting operations,
including scientific computing [2], [3], image processing [4], multimedia [5], and network processing . For
decades, numerous sorting algorithms have been studied and optimized. For a small input of size n, bubble sort
and insertion sort are fast in-place sorting methods, but both algorithms require execution time in the worst
case. The widely known quick sort algorithm applies the divide-and-conquer strategy, which has an average
execution time of Q (n log2 n) asymptotically, but in the worst case, that is, the input elements are originally
placed in a completely reverse order, it increases to Q(n2). Merge sort and heap sort are asymptotically optimal
because the upper bound of running time O(n log2 n)matches the worst-case lower bound O(n log2 n) of
comparison based sorting algorithm as shown in figure 1.
Figure. 1. The increasing (a) and decreasing (b) comparing block. (c) and(d) are the detail architectures
In existing system they implemented some sorting techniques in software which is not feasible to achieve high
speed and software sorting techniques are bubble sort,merge sort,quick sort. This can be enhanced by using
hardware sorting using FPGA. This paper implements the hardware sorting in bubble sort, bitonic merge
sort,bitonic odd even merge sort which enhanced using comparators and bitonic merge sort and bitonic odd even
merge sort is invented by batcher.
2 Proposed scheme
This paper enhances the speed of various sorting techniques by using comparators and This compares the results
for each sorting techniques with its delay and parallelism concept is used in this paper for various sorting
techniques.
For small inputs, bubble sort is a feasible solution and is also easy to implement. In each round, the
largest (or smallest) sample is selected by a series of comparisons. The algorithm requires M comparison and
switching events in the first round when the input size is M, M-1 events in the second round, M-2 events in the
third round and so on until the complete sorted result is generated. The running time is O(M^2)where M is the
input size. Parallization is a well-known solution to enhance the performance. Fig. 2 shows ahardware design for
parallel bubble sort, where comparisonblocks in the same column are executed in parallel. Although the total
number of comparing units is as same as that in the sequential version, a few operations could be executed
simultaneously in a certain pipeline stage. The overall pipeline stage is defined as 2M-3, and the run time can
bereduced to O(m)
To sort a data set with 2P samples, there are 2P-1OE-2s in the first stage, 2^P-2 OE-4sin the second
stage, and soon, until there is one OE-2^P in the final stage. Further-more, an OE-2^P merging unit could be
subdivided into P stages. The time complexity of an odd-even merging net-work with M inputs can be
represented by O(log2^2 M)because there are 1 + 2 +…+ log2 M stages in total, and the area complexity is O(M
log2^2 M)Fig. 3 illustrates an example of an eight-input odd-even merge sorting network composed of four
parallel OE-2s, two parallel OE-4s, and one OE-8. The pipeline levels are 6 and there are 19 increasing
comparison blocks.
The 2^P-input bitonic sorting network consists 2^P-1 parallel.BM-2s in the first level, 2^P-2 parallel
BM-4s in the second level .and one BM-2^P in the final level. The time complexity and area cost are the same
as those of the odd-even sorting network. Fig. 4 illustrates an example of an eight-input bitonic sorting network
composed of four parallel BM-2s, two parallel BM-4s, and one BM-8. The pipeline levels are 6 and there are 24
comparison blocks. A few of the comparing blocks produce increasing sequences, whereas others produce
decreasing results, which is the most notable difference between the odd-even and the bitonic sorting
Table.1.Comparison between the existing and proposed method for input 4-bit width
Table. 2.Comparison between the existing and proposed method for input 8-bit width
Table 3 Comparison between the existing and proposed method for input 16-bit width
Table.4.Comparison between the existing and proposed method for input 32-bit width
1200
1000
800
400
200
0
4bit 8bit 16bit 32bit
Figure 5:Slices
Simulation output is obtained by running Verilog code in modelsim software.Figure 9 shows the
simulation results of bubble sort implementation.The Figure 10,11 shows the RTL diagrams obtained from
Xilinx.
Figure 11: RTL Schematic for bitonic odd even merge sort
4.Conclusion
From the comparison of hardware sorting that is bubble sort, Bitonic odd-even sorting and Bitonic
merge sorting using parallelism concept.It is concluded that the bitonic odd-even is fast with less delay but the
structure is not fixed.Bitonic merge is more or less equal delay as bitonic odd even, but it provides fixed
structure.Therefore tradeoff plays a specific role because bitonic odd even uses less space than bitonic
merge.Depending on the application the sorting must be chosen.
5. REFERENCE
[1] K. E. Batcher, “Sorting networks and their applications,” in Proc.AFIPS Proc. Spring Joint Computer Conf.,
1968, pp. 307–314.
[2] L. Njejimana, et al., “Design of a real-time FPGA-based dataacquisition architecture for the LabPET II: An
APD-based scannerdedicated to small animal PET imaging,” IEEE Trans. Nucl. Sci.,vol. 60, no. 5, pp. 3633–
3638, Oct. 2013.
[3] A. Colavita, E. Mumolo, and G. Capello, “A novel sorting algorithmand its application to a gamma-ray
telescope asynchronousdata acquisition system,” Nuclear Instruments Methods Phys. Res.Section A:
Accelerators, Spectrometers, Detectors Associated Equipment,vol. 394, no. 3, pp. 374–380, 1997.
[4] A. Gabiger-Rose, M. Kube, R. Weigel, and R. Rose, “An FPGAbasedfully synchronized design of a bilateral
filter for real-timeimage denoising,” IEEE Trans. Ind. Electron., vol. 61, no. 8,pp. 4093–4104, Aug. 2014.
[5] G. Dimitrakopoulos, C. Mavrokefalidis, K. Galanopoulos, andD. Niolos, “Sorter based permutation units for
media enhancedprocessors,” IEEE Trans. Very Large Scale Integr. Syst., vol. 15, no.[6], pp. 711–715, Jun.
2007.