Beruflich Dokumente
Kultur Dokumente
CERTIFICATE BY STUDENT
\This is to certify that PRATUL NIJHAWAN has undergone the training on "VLSI DESIGN
and Illustrated a project on Implementation of Image Edge Detection Techniques using
Verilog HDL and displayed it on Screen using FPGA", under my guidance and supervision.
He is the sole author of this report and the work carried out by him in the field of Digital Image
Processing using Verilog HDL presents an idea of how one field of Electronics may work with
the other producing efficient and accurate results. He has given best of his efforts in carrying out
his work with the available resources.
This is also to certify that the matter embodied in this dissertation has not been submitted earlier
in any institute/university for the award of degree/diploma to the best of my knowledge and
belief.
I wish him all the best for his future career.
II
ORGANIZATION PROFILE
DKOP Labs Pvt. Ltd. ( Earlier Design KOP Labs ) is a Research and Training company in VLSI
Design, Software & Embedded Systems. It is founded by a team of highly experienced and
qualified Semiconductor & EDA Industry Professionals. The Training Division of DKOP Labs
Pvt Ltd conducts various industrial training programs in VLSI Design, Software Development &
Embedded Technology. They conduct Summer Training in VLSI Design, Six Months Industrial
Training in VLSI Design, Summer Training in Software Development, Six Months Industrial
Training in Software Development, and Six Months Industrial Training in Embedded
Technology. They had observed for quite some time that the interview-to-selection ratio was
drastically going down. Companies screen 100s of candidates to fill one single position. Lot of
human resource is wasted in the process and it is primarily because the candidates are not
industry-ready although they may have scored good marks in the academics. They had observed
for quite some time that the interview-to-selection ratio was drastically going down. Companies
screen 100s of candidates to fill one single position. Lot of human resource is wasted in the
process and it is primarily because the candidates are not industry-ready although they may have
scored good marks in the academics.
III
ACKNOWLEDGEMENT
It is my pleasure to acknowledge the help that I received from different individuals during the
completion of my project.
I would like to acknowledge the continuous guidance and incessant support rendered by Prof.
Bijender MDia, Head of the Department, Electronics and Communication Engineering not
only for this project but also in my overall career development.
Also, it gives me immense pleasure to express my sincere and wholehearted sense of gratitude to
my esteemed training supervisor Er. Devender Saini (Assistant Professor, ECE
Department,GITM) for his invaluable and untiring guidance and supervision throughout this
session. To derive benefits of the enormous experience of above listed people, it is a matter of
great privilege for me.
I am grateful to Mr. NITIN KUMAR TIWARI (Project Manager, DKOP Labs Pvt Ltd.) for his
guidance and suggestions that helped me in the preparation of this project. Also, I would also like
to extend my thanks to Mr. Manu Lauria (Chairman & Director, Strategic Partnerships, DKOP
Labs Pvt. Ltd.) , Mr.Devender Khari(CEO & Director, Business Development , DKOP Labs
Pvt. Ltd.) for providing me with the an atmosphere of healthy learning through their well
equipped labs with latest tools available.
Morale boosting and support from the family , all the faculty members and friends is also
acknowledged.
-Pratul Nijhawan
(12-ECE-135)
IV
ABSTRACT
The advancement in the VLSI technology has led to innovations in almost every other field in the
Electronics and Communication. Digital Image Processing lays a prominent example where the
algorithms which were earlier limited to the software implementations only were slow due to the
limited processor speed which has been significantly enhanced by the advancements in VLSI
Technology. The project presents three fundamental edge detection algorithms : (i)XOR operator
, (ii) Sobel operator and (iii) Prewitt Operator for the detection of edges of a given input image,
which is coded using Verilog HDL and synthesized using XILINX ISE Design Suite and finally
implemented on FPGA (Digilent Nexys 2 - XC3S500e using the XILINX Spartan 3e Board with
gate count of 500K). Here, due to limitations of the pins of FPGA and for simplicity of
calculations I have converted the input image to 90*90 using MATLAB.
V
DECLARATION
I hereby certify the work which is being presented in the TRAINING REPORT on VLSI
DESIGN(Illustrating a project on Implementation of Image Edge Detection Techniques using
Verilog HDL and displaying it on Screen using FPGA) by Pratul Nijhawan in partial fulfillment
of requirements for the award of degree B.Tech (Electronics and Communication
Engineering) has been submitted in the Department of ELECTRONICS &
COMMUNICATION ENGINEERING, Gurgaon Institute of Technology and Management,
Gurgaon (affiliated to Maharashi Dayanand University, Rohtak) is carried out during a period
from Feb 8 2016 to June 2016 under the supervision of Er Devender Saini(Assistant Professor,
Department of Electronics And Communication Engineering, GITM, Gurgaon). The matter
presented in this project has not been submitted by anyone in any University/ Institute for the
award of any Degree/ diploma.
-Pratul Nijhawan
(12-ECE-135)
VI
TABLE OF CONTENTS
CERTIFICATE ......................................................................................................................... I
CERTIFICATE BY STUDENT ............................................................................................... II
ORGANIZATION PROFILE ................................................................................................... III
ACKNOWLEDGEMENT ......................................................................................................... IV
ABSTRACT ................................................................................................................................ V
DECLARATION ........................................................................................................................ VI
TABLE OF CONTENTS ................................................................................... VII
LIST OF FIGURES .......................................................................................... XIII
LIST OF EXAMPLES .................................................................................
LIST OF TABLES AND FORMULAE .............................................................
CHAPTER 1 INTRODUCTION................................................................................................. 1
1.1 VLSI ..................................................................................................................................... 1
1.2 EDA ...................................................................................................................................... 2
1.3 VERILOG HDL ................................................................................................................... 1
1.4 IMAGE PROCESSING ....................................................................................................... 2
1.5 EDGE DETECTION ............................................................................................................ 2
1.6 MOTIVATION ..................................................................................................................... 2
1.7 FIELD PROGRAMMABLE GATE ARRAY (FPGA) ........................................................ 3
VII
2.2.1.2 Birth of Commercial EDA ..........................................................................................
2.2.2 Current Status of EDA ........................................................................................................
2.2.3 Software Focuses of EDA Industry ...................................................................................
2.2.3.1 Design ........................................................................................................................
2.2.3.2 Simulation ..............................................................................................
2.2.3.3 Analysis and verification ...........................................................................
2.2.3.4 Manufacturing preparation ..........................................................................
VIII
4.6.1 GATE LEVEL MODELING
4.6.1.1 GATE PRIMITIVES
4.6.1.1.1 BASIC LOGIC GATE PRIMITIVES
4.6.1.1.2 TRANSMISSION GATE PRIMITIVES
4.6.2 DATAFLOW MODELING
4.6.2.1 USAGE OF ASSIGN STATEMENT
4.6.2.2 OPERATORS IN DATAFLOW MODELLING
4.6.3 BEHAVIORAL MODELING
4.6.3.1 INITIAL AND ALWAYS BLOCKS IN VERILOG
4.6.3.1.1 Initial Blocks
4.6.3.1.2 Always Blocks
4.6.3.1.2.1 Asynchronous always block
4.6.3.1.2.2 Synchronous always block
4.6.3.1.2.3 Implementations of an always block
4.6.3.1.2.4 Edge-Triggers
4.6.3.1.2.5 Restrictions on always blocks
4.6.3.2 Begin-end
4.6.3.3 If, If-Else and Case statements in Verilog
4.6.3.3.1 If-Else
4.6.3.3.2 Case Statement
4.6.3.4 Loop Statements in Verilog
IX
5.10.1.6 User I/O
5.10.1.7 Basys 2 Interfaces used by me during coding
5.10.1.7.1 Seven Segment Display
5.10.1.7.2 Keyboard
5.10.1.8 Basys 2 Extenal Connection Ports
5.10.1.8.1 FPGA Pin Definitions
5.10.2 Digilent Nexys 2
5.10.2.1 Overview
5.10.2.2 Features
5.10.2.3 Power Supplies
5.10.2.4 Clocks
5.10.2.5 The peripheral used during coding (VGA Port)
5.10.2.5.1 VGA System Timing
X
8.2.1.1.2 MATLAB Code to get the output image file from the text file obtained as output of
verilog code(Prewitt Gradient)
8.2.1.1.3 Verilog Code to display the text file as output on VGA screen through FPGA for
Prewitt Gradient
8.2.1.2 Approximate Prewitt Gradient
8.2.1.2.1 Verilog coding for approximate prewitt gradient and obtaining output text file and
displaying output
8.2.1.2.2 MATLAB Code to get the output image file from the text file obtained as output of
verilog code (Approximate Prewitt Gradient)
8.2.1.2.3 Verilog Code to display the text file as output on VGA screen through FPGA for
Approximate Prewitt Gradient
8.2.2 Sobel Operator
8.2.2.1 Sobel Gradient
8.2.2.1.1 Verilog code for sobel gradient and obtaining output text file
8.2.2.1.2 MATLAB Code to get the output image file from the text file obtained as output of
verilog code (Sobel Gradient)
8.2.2.1.3 Verilog Code to display the text file as output on VGA screen through FPGA for
Sobel Gradient
8.2.2.2 Approximate Sobel Gradient
8.2.2.2.1 Verilog coding for approximate sobel gradient and obtaining output text file and
displaying output
8.2.2.2.2 MATLAB Code to get the output image file from the text file obtained as output of
verilog code (Approximate Sobel Gradient)
8.2.2.2.3 Verilog Code to display the text file as output on VGA screen through FPGA(For
Approximate Sobel Gradient)
8.2.3 XOR Operator
8.2.3.1 Verilog code for XOR Operator and obtaining output text file
8.2.3.2 MATLAB Code to get the output image file from the text file obtained as output of
verilog code (XOR Operator)
8.2.3.3 Verilog Code to display the text file as output on VGA screen through FPGA for XOR
Operator
8.3 Results and Conclusion
8.4 Future Scope
XI
LIST OF FIGURES
XII
Figure 5.30 VGA System Signals ..................................................................................................
Figure 5.31 VGA system timing diagram ........................................................................................
Figure 5.32 Schematic for a VGA controller circuit ..........................................................................
Figure 7.1 The Electromagnetic Spectrum .........................................................................................
Figure 7.2 The Prewitt kernels ....................................................................................................
Figure 7.3 The Sobel kernels ....................................................................................................
Figure 8.1 Image edge detection steps
Figure 8.2 Input Image File
Figure 8.3 90 * 90 grayscale image for given input image
Figure 8.4 Image after applying im2bw function
Figure 8.5 Output after applying threshold 0.50
Figure 8.6 Output after applying threshold 0.49
Figure 8.7 Output after applying threshold 0.48
Figure 8.8 Output after applying threshold 0.47
Figure 8.9 Output after applying threshold 0.39
Figure 8.10 Output after applying threshold 0.38
Figure 8.11 Output after applying threshold 0.379
Figure 8.12 Output after applying threshold 0.378
Figure 8.13 Output after applying threshold 0.377
Figure 8.14 Output after applying threshold 0.376
Figure 8.15 Text file of image with optimum threshold(0.376)
Figure 8.16 MATLAB Command Window for Section 8.1.2
Figure 8.17 Simulation results for Prewitt Gradient
Figure 8.18 Initial values of output text file after performing prewitt gradient
Figure 8.19 Matlab Command window for conversion of text file to image(Prewitt Gradient)
Figure 8.20 Prewitt gradient output(As from MATLAB)
Figure 8.21 Design summary for implementing prewitt gradient operation on FPGA
Figure 8.22 VGA output of Prewitt Gradient implemented through Digilent Nexys 2 FPGA
Figure 8.22 MATLAB Command window for conversion of text file to image(Approximate Prewitt
Gradient)
Figure 8.23 Simulation results for approximate prewitt gradient
Figure 8.24 Initial values of output text file after performing approximate prewitt gradient
Figure 8.25 Prewitt approximate gradient output(As from MATLAB)
Figure 8.26 Design summary for implementing approximate prewitt gradient operation on FPGA
Figure 8.27 VGA output of Approximate Prewitt Gradient implemented through Digilent Nexys 2 FPGA
Figure 8.28 Simulation results for sobel gradient
Figure 8.29 Initial values of output text file after performing sobel gradient
Figure 8.30 MATLAB Command window for conversion of text file to image(Sobel Gradient)
Figure 8.31 Sobel gradient output(As from MATLAB)
Figure 8.32 Design summary for implementing sobel gradient operation on FPGA
Figure 8.33 VGA output of Sobel Gradient implemented through Digilent Nexys 2 FPGA
Figure 8.34 Simulation results for approximate sobel gradient
XIII
Figure 8.35 Initial values of output text file after performing approximate sobel gradient
Figure 8.36 MATLAB Command window for conversion of text file to image(Sobel Approximate
Gradient)
Figure 8.37 Sobel approximate gradient output(As from MATLAB)
Figure 8.38 Design summary for implementing approximate sobel gradient operation on FPGA
Figure 8.39 VGA output of Approximate Sobel Gradient implemented through Digilent Nexys 2 FPGA
Figure 8.40 Simulation results for XOR Operator
Figure 8.41 Initial values of output text file after performing XOR Operator
Figure 8.42 MATLAB Command window for conversion of text file to image(XOR Operator)
Figure 8.43 XOR Operator output(As from MATLAB)
Figure 8.44 Design summary for implementing XOR operator on FPGA
Figure 8.45 VGA output of XOR Operator implemented through Digilent Nexys 2 FPGA
XIV
LIST OF EXAMPLES
XV
LIST OF TABLES AND FORMULAE
TABLES
FORMULAE
XVI