Fpga Implementation of Binary Search 1
Fpga Implementation of Binary Search 1
Fpga Implementation of Binary Search 1
PROPOSED SYSTEM:
A binary search locates an item in a sorted
array by repeatedly dividing the search interval in
half. The initial interval includes the entire array. If
the value of the search key is less than the item in the
middle of the interval, then the next interval will be
the lower half of the current interval. If the value of
the search key is greater than the middle item, then
the next interval will be the upper half. The search
process repeats until the item is found or the search
interval is empty. Binary Search is an O (log
n) algorithm, which is more efficient than a linear
search for large arrays.
It is an efficient algorithm for finding a sorted
array. Suppose a search is begun by comparing the
key with the value in the middle location of a sorted
array. If the middle value is too large then all values
in the last half are too large; hence, the search can be
limited to the first half. Similarly if the middle value
is too small, then the search can be limited to the
BLOCK
DIAGRAM:
MAGNITUDE COMPARATOR:
It is a combinational circuit. Here we are
using a 4 bit magnitude comparator. The two inputs
to the magnitude comparator are the starting and the
ending address of the memory where we are going to
search the targeted data. The starting address and the
ending address of the memory are given to the
comparator. It compares the two addresses and gives
an output. If the output is less than or equal, it is
given to the adder or else it decides that the target to
be searched is not in the memory.
ADDER:
Here we are using a 4 bit adder. The adder now
adds both the starting and ending addresses and
produces an output. This output is given to the
divider.
DIVIDER:
Here the output of the adder is divided by
2.The output of the divider is the middle value
that is the middle address of the memory where the
searching is done. Using this middle value we can
divide the memory into two halves.
MEMORY:
A 16 bit RAM memory is used. The two inputs
to the memory are address and the clock input and
the output is the data output. The middle value is
considered as the address of our targeted data and it
is given as the input to the memory. The second input
to the memory is the CLOCK input which is used for
synchronization. The output of the memory is the
data which is stored in the middle address.
MASK REGISTER:
It is nothing but a register which is used to
store the targeted data which we are searching in
the memory.
MAGNITUDE COMPARATOR:
The two inputs to this magnitude
comparator are the data output from the memory and
targeted data from the mask register. If the two inputs
are equal, it indicates that the target data was found
in the memory and it is the required output. If the
targeted data is greater than the data output from
memory ,then it will be given to an adder and here
again a starting address is calculated using [Starting
address=middle value+1].Then this result is given to
the first magnitude comparator and if the targeted
data is lesser than the data output, then it is given
to the subtraction and again an ending address is
calculated using [Ending address=middle value-1],
then this will given to the first magnitude comparator.
And this procedure will be repeated until our targeted
data is found in memory.
SOFTWARE TECHNIQUES:
The software used here is Xilinx XSE
9.2i. After design entry and optional simulation, you
run synthesis. The ISE software includes Xilinx
Synthesis Technology (XST), which synthesizes
VHDL, Verilog, or mixed language designs to create
Xilinx-specific net list files known as NGC files.
Unlike output from other vendors, which consists of
an EDIF file with an associated NCF file, NGC files
contain both logical design data and constraints. XST
places the NGC file in your project directory and the
file is accepted as input to the Translate (NGDBuild)
step of the Implement Design process.
HARDWARE TECHNIQUES:
FPGAs are programmable semiconductor devices
that are based around a matrix of Configurable Logic
Blocks (CLBs) connected through programmable
interconnects. As opposed to Application Specific
ACKNOWLEDGEMENT:
We would like to thank Prof V.
Suresh, HOD and
Prof C. Jasmine Project guide for their valuable
guidance and support throughout this project.
REFERENCES:
Anargyros Krikelis, Charles C. Weems (editors)
(1997). Associative Processing and Processors, IEEE
Computer Science Press. ISBN 0-8186-7661-2