SlideShare ist ein Scribd-Unternehmen logo
1 von 19
1
FPGA APPLICATIONS USING HDL
Report by,
Sankarshan D PES1201700495
Santhosh S PES1201700501
Nikhilesh M PES1201700538
Under the guidance of,
Dr. Venugopal N EEE Department
Prof. Sumanth ECE Department
2
Introduction
Hardwaredescription language
(HDL) is a specialized computer
language used to program
electronic and digital logic circuits.
The structure, operation and design
of the circuits are programmable
using HDL. HDL includes a textual
description consisting of operators,
expressions, statements, inputs and
outputs. Instead of generating a
computer executable file, the HDL
compilers provide a gate map. The
gate map obtained is then
downloaded to the programming
device to check the operations of
the desired circuit. The language
helps to describeany digital circuit
in the formof structural,
behaviouraland gate level and it is
found to be an excellent
programming languagefor FPGAs
and CPLDs.
Structurallevel logic is used when
knowledgeregarding the equations
is present. Behavioral level logic is
used when knowledgeregarding the
process is known. Gate level logic is
used when the circuit is available.
Differencebetween FPGA and
microcontrollers
Microcontrollers
Custom built minicomputers in an
IC. Consumeless power. Can’t be re
programmed. Built for specific
functionality Cheap and less flexible.
FPGA
Comprised of logic blocks that can
be rewired. They consumemore
power and can be reprogrammed.
They are costly but more flexible.
Very VHDL projectshould comprise
of two basic modules,
1) Design module
2) Test bench
Design module comprises of the
entity and the architecture of the
entity. The entity declares the ports
and the architecture determines the
function of the ports and the
module.
Test bench module includes the
module to be tested, there are no
input or output ports for test bench
Functional
Specification
HDL
Synthesis Place & Route
Download&
Verifythe circuit
3
entity, reduces the functional
verification of design module.
Approach
 Initialize all input
 Set the clk signal
 Send test vectors
 Specify when to end the
simulation
Project 1.
Salt & Pepper noise removal
using Sort optimization
algorithm of median filtering
based on FPGA – IEEE PAPER.
(Lu, Dai, Jiang, & Li, 2010)
In the name, salt refers to the white
noises and pepper refers to the
black noises. In a grey scale image,
each pixel comprises of 8 bits,
whereis 0 black and 256 is white.
Consider the following diagram
below
10 256 10
15 0 15
10 10 10
The figure represents a small 3x3
pixel where256,0 arethe noises. By
considering the median in each row
we can remove256, 0 back to their
rightful values ( 10 and 15
respectfully ).
We shall be doing it for a large scale
of 256x256 pixel image.
Designing an optimized median
sort filter.
The traditional sorting algorithm of
median
filtering is optimized according to
the hardwarestructure
features of FPGA. FPGA is used to
acquire the data
parallelly for comparing the data of
the samecolumn in the
median filtering window. Comparing
results shared by
adjacent filter window are saved
temporarily to match the
new round of median filtering by
using FPGA internal
resources. This method can reduce
the comparing times
from current 21 down to 13, and
improvethe algorithm
efficiency nearly 40%.The
experimental results provethat
the optimized algorithm can filter a
1K×1K gray-levelimage
in about 20ms, which ensurethe
proposed algorithm can be
applied in the real-time image
median filtering system.
Test
Bench
Design
Module
4
The workflow of the median
filtering module is that: firstly, three
lines of data are wrote into the
internal FIFO of FPGA, and when the
third FIFO turn into half full state,
the median filtering system begin to
work. The data in the 3 FIFO willbe
sent to the ordering comparator
ordinally for data ordering, and the
results will be send to next different
comparators. Beforethe second
comparing, the data need 2 circle
delay to distinguish the circle order
of input data by two D flip-flops.
The second comparing results will
be sent tothe final median
comparator to get the final result.
Designing ordering comparator
The figure above shows the
ordering comparator. WhereD
refers to the D flipflop and PE refers
to a normal comparator. A B C are
the inputs. After the firstclock
cycle, the 3 inputs enter the
ordering comparator. Inputs A and
B are compared in the firstPE
comparator which we have called
U1 in the file. C is fed to a D flip flop
which we refer to U2. After the first
clock cycle we get MAX (s1) , MIN(
s2 ) and C respectively. Next the 3
outputs go through the D ( U3) F/F
(MAX goes through this), MIN& C
go through PE ( U4 ). The outputs
,MAX (s4) , MAX(s5) and MIN(s6)
are obtained at the 2nd
clock cycle.
Similarly after the 3rd
clock cycle we
get outputs MAX MID and MINfrom
PE ( U5 ) and D F/F (U6).
To design this ordering comparator
we need to design 2 files first, 1 D
F/F and 1 PE comparator and then
finally port map these two multiple
time with the help of signals.
Figure 1Hardware structure of median filtering after arranging in ascending order
5
Designing D F/F
Design Module
Inputs ared, clk, reset.
Output is q.
Test bench
Designing PE comparator
Design Module
Test bench
6
Simulation
Port mapping D F/F and PE
comparator
Design Module
Test bench
7
Simulation
Designing MIN comparator module
This module requires, PE min
comparator ( U1,U3 ) and D F/F
(U2). The output will be obtained
after 3 clock cycles.
Designing PE min module
Test Bench
Simulation
8
Portmapping for Min comparator
module
Design Module
Test Bench
Simulation
Designing Medcomparator module
This module requires PE comparator
(U1 & U4 ) , D F/F ( U2 , U3) and PE
Min comparator (U5). The output is
obtained after 4 clock cycles.
Since all the modules have been
previously designed, wecan directly
go for port mapping.
Portmapping the modules
Test bench
9
Simulation
Designing Max comparator
module
The above figure represents max
comparator. The max comparator
comprises of 3 inputs and 1 output.
Internally 1 D F/F ( U1) , 2 PE max
comparators ( U2,U3). Theoutput
max number is obtained after 3
clock cycles.
Designing PE Max comparator
Design Module
Test bench
Simulation
Designing the final port map for
the filter
Refer to figure 1.
Design Module
10
Test bench
Simulation
Designing Input mechanism
Each pixel from the image is taken
in from the data in port. FIFO is a
253 bit register. 3 outputs are taken
from this input mechanism and sent
to the filter. That is D3, D2 and Data
out. The D F/F can be considered as
3x3 pixel matrix. Which is whatwe
require as discussed earlier.
Design Module for moving window.
Designing port map for the
whole project
Now a portmap for the whole
projectmust be designed wherethe
moving window ( U1) and the
Median Filter ( U2 ) are linked by
signals S1,S2,S3 ( o/p of U1 and i/p
to U2)
11
Design module for portmapping
System generator interfacing
with Matlab
Now an interface mustbe made to
link the HDL code with the input
and to obtain the o/p. We mustalso
dump the code onto the FPGA.
The general steps are
Step 1: Open Systemgenerator and
configurematlab 2012 with it.
Step2: Open systemgenerator file,
Matlab will open
Step3: Click on simulink icon, then
click on Xilinx library and drag
systemgenerator icon followed by
blackboxonto simulink workspace
Step4: Xilinx will open now, Add
subfiles of Xilinx project
Step5: Edit Workspaceas per
requirement
Step6: Make connections from
FPGA to laptop and simulate
12
Matlab File
Input
Output
Itcan be observed that the salt and
pepper noises are removed from
the input image. Hence the image
filtering has been successfully
implemented.
13
Project 2
PWM Generator
A Pulse Width Modulation (PWM)
Signal is a method for generating an
analog signalusing a digital source.
A PWMsignal consists of two main
components that define its
behavior: a duty cycle and a
frequency. The duty cycle describes
the amountof time the signalis in a
high (on) state as a percentage of
the total time of it takes to
complete one cycle. The frequency
determines how fast the PWM
completes a cycle (i.e. 1000 Hz
would be 1000 cycles per second),
and therefore how fastit switches
between high and low states. By
cycling a digital signaloff and on at
a fast enough rate, and with a
certain duty cycle, the output will
appear to behave like a constant
voltage analog signal when
providing power to devices.
PWMsignals are used for a wide
variety of control applications. Their
main use is for controlling DC
motors but it can also be used to
control valves, pumps, hydraulics,
and other mechanical parts. The
frequency that the PWMsignal
needs to be set at will be dependent
on the application and the response
time of the systemthat is being
powered. Below are a few
applications and sometypical
minimum PWM frequencies
required:
 Heating elements or systems
with slow responsetimes: 10-
100 Hz or higher
 DC electric motors: 5-10 kHz
or higher
 Power supplies or audio
amplifiers: 20-200 kHz or
higher
14
Generating PWM
0 1 2 3 4 5 6 7
PWM’s can be generated with the
help of clock signals.For every
positiveedge of the clock signal
with the help of a counter, we
can begin the counting.
To control the duty cycle we’ll
need a comparatorwhose output
values are either one and 0. For a
25 percent duty cycle we can set
the output to be 1 from 0 count
to count 2 and 0 from 2 to 7. This
is the way we can generate PWM
waves.
Hardware Structure
For PWM generation we need one
counter (U1) that is related to clock
and one comparator ( U2 ) that is
linked to the counter through a
signal S1.
Designing the counter
Design Module
Test bench
Counter
Comparator
CLK Reset
Duty Cycle
Count PWM
15
Simulation
From the abovefigure we can see
that for every clock cycle the
counter counts,after the counter
reaches ”111” the counter goes
back to 0.
Designing comparator
The role of the comparator here is
to dictate the duty cycle. Based on
the input given by the user, the
comparator takes in this value and
compares the counter output.
Based on this comparison the
counter gives output of either one
or zero, hence generating PWM’s.
Designmodule
The comparator has one output i.e.
the PWMand 2 inputs reset and
counter output.
16
Test bench
Simulation
Creating port map & final
module
The port map comprises of
one counter(U1),one
comparator(U2),clk, reset
and pwm output.
Design module
Test bench
17
Simulation
MATLAB MODEL
18
Output
25 percent duty cycle pwm has
been generated by giving data in
as 2.
19
RTL Rules for coding
RTL rule no 1 : always give priority for
reset pin.
RTL rule no 2: always use active high reset
pin. – In order to avoid an extra inverter.
RTL rule no 3 : Use only priority variables
in the sensitivity list, avoid inputs.
RTL rule no 4 : Always use if else
statement that creates mux on hardware.
RTL rule no 5: For many conditions and
many outcomes avoid if else if and use
case statement.
RTL rule no 6 : Variable’s are cache
memory and don’t create connections
use := while assigning , but signals create a
dedicated wires in the hardware.
Difference in if statements
Simple if : Creates an inverter.
If + else statement : Creates a
mux.
If + elsif : Creates encoder.

Weitere ähnliche Inhalte

Was ist angesagt?

SDR channelizer by sooraj
SDR channelizer by soorajSDR channelizer by sooraj
SDR channelizer by sooraj
sooraj yadav
 
Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Yazeed Khalid
 

Was ist angesagt? (20)

Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Synthesis & FPGA Implementation of UART IP Soft Core
Synthesis & FPGA Implementation of UART IP Soft CoreSynthesis & FPGA Implementation of UART IP Soft Core
Synthesis & FPGA Implementation of UART IP Soft Core
 
SDR channelizer by sooraj
SDR channelizer by soorajSDR channelizer by sooraj
SDR channelizer by sooraj
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Introduction to Microcontrollers
Introduction to MicrocontrollersIntroduction to Microcontrollers
Introduction to Microcontrollers
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Microcontroller part 4
Microcontroller part 4Microcontroller part 4
Microcontroller part 4
 
Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02Microprocessorandmicroconrollermcq3 121116120640-phpapp02
Microprocessorandmicroconrollermcq3 121116120640-phpapp02
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
 
Assembly programming
Assembly programmingAssembly programming
Assembly programming
 
Lec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processorLec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processor
 
Ab PLC Cables Drivers Sample
Ab PLC Cables Drivers SampleAb PLC Cables Drivers Sample
Ab PLC Cables Drivers Sample
 
Embedded system lab work
Embedded system lab workEmbedded system lab work
Embedded system lab work
 
C211824
C211824C211824
C211824
 
FPGA-based Digital Baseband Transmission System Performance Tester Research a...
FPGA-based Digital Baseband Transmission System Performance Tester Research a...FPGA-based Digital Baseband Transmission System Performance Tester Research a...
FPGA-based Digital Baseband Transmission System Performance Tester Research a...
 
8051 microcontroller notes continuous
8051 microcontroller notes continuous 8051 microcontroller notes continuous
8051 microcontroller notes continuous
 
AN EFFICIENT BASE-4 LEADING ZERO DETECTOR DESIGN
AN EFFICIENT BASE-4 LEADING ZERO DETECTOR DESIGNAN EFFICIENT BASE-4 LEADING ZERO DETECTOR DESIGN
AN EFFICIENT BASE-4 LEADING ZERO DETECTOR DESIGN
 
Microcontrollers 80 Marks Sample Question Paper
Microcontrollers   80 Marks Sample Question PaperMicrocontrollers   80 Marks Sample Question Paper
Microcontrollers 80 Marks Sample Question Paper
 
Assembler Programming
Assembler ProgrammingAssembler Programming
Assembler Programming
 
8051 Presentation
8051 Presentation8051 Presentation
8051 Presentation
 

Ähnlich wie Fpga applications using hdl

The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging System
Melissa Luster
 
FIR_Filters_with_FPGA
FIR_Filters_with_FPGAFIR_Filters_with_FPGA
FIR_Filters_with_FPGA
Irvn Rynning
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
Akash Mhankale
 
Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...
TELKOMNIKA JOURNAL
 

Ähnlich wie Fpga applications using hdl (20)

An Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLLAn Effective Design and Verification Methodology for Digital PLL
An Effective Design and Verification Methodology for Digital PLL
 
40120140504012
4012014050401240120140504012
40120140504012
 
Design and Implementation of Pulse Width Modulation Using Hardware/Software M...
Design and Implementation of Pulse Width Modulation Using Hardware/Software M...Design and Implementation of Pulse Width Modulation Using Hardware/Software M...
Design and Implementation of Pulse Width Modulation Using Hardware/Software M...
 
Fpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loopFpga implementation of power efficient all digital phase locked loop
Fpga implementation of power efficient all digital phase locked loop
 
The Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging SystemThe Principle Of Ultrasound Imaging System
The Principle Of Ultrasound Imaging System
 
I010315760
I010315760I010315760
I010315760
 
Bidirect visitor counter
Bidirect visitor counterBidirect visitor counter
Bidirect visitor counter
 
Low power and efficiency test pattern generator
Low power and efficiency  test pattern generatorLow power and efficiency  test pattern generator
Low power and efficiency test pattern generator
 
Basic signal processing system design on fpga using lms based adaptive filter
Basic signal processing system design on fpga using lms based adaptive filterBasic signal processing system design on fpga using lms based adaptive filter
Basic signal processing system design on fpga using lms based adaptive filter
 
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGAIRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
 
High speed customized serial protocol for IP integration on FPGA based SOC ap...
High speed customized serial protocol for IP integration on FPGA based SOC ap...High speed customized serial protocol for IP integration on FPGA based SOC ap...
High speed customized serial protocol for IP integration on FPGA based SOC ap...
 
FPGA Verilog Processor Design
FPGA Verilog Processor DesignFPGA Verilog Processor Design
FPGA Verilog Processor Design
 
Seminar on field programmable gate array
Seminar on field programmable gate arraySeminar on field programmable gate array
Seminar on field programmable gate array
 
FIR_Filters_with_FPGA
FIR_Filters_with_FPGAFIR_Filters_with_FPGA
FIR_Filters_with_FPGA
 
Introduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSPIntroduction to Blackfin BF532 DSP
Introduction to Blackfin BF532 DSP
 
CRC AND TRANSMIT ERROR REPORT
CRC AND TRANSMIT ERROR REPORTCRC AND TRANSMIT ERROR REPORT
CRC AND TRANSMIT ERROR REPORT
 
Radio Astronomy and electronics
Radio Astronomy and electronicsRadio Astronomy and electronics
Radio Astronomy and electronics
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
 
Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...Embedded processor system for controllable period-width multichannel pulse wi...
Embedded processor system for controllable period-width multichannel pulse wi...
 

Mehr von Sankarshan D

Mehr von Sankarshan D (8)

Automatic Night Light/ Street Light
Automatic Night Light/ Street LightAutomatic Night Light/ Street Light
Automatic Night Light/ Street Light
 
Lego - Design brief ( Strategy )
Lego - Design brief ( Strategy )Lego - Design brief ( Strategy )
Lego - Design brief ( Strategy )
 
Personas and its importance
Personas and its importancePersonas and its importance
Personas and its importance
 
Design Thinking : Ideation
Design Thinking : IdeationDesign Thinking : Ideation
Design Thinking : Ideation
 
Design Thinking : Prototyping & Testing
Design Thinking : Prototyping & TestingDesign Thinking : Prototyping & Testing
Design Thinking : Prototyping & Testing
 
Design Thinking : Define
Design Thinking : Define Design Thinking : Define
Design Thinking : Define
 
Design Thinking : Empathising
Design Thinking : Empathising Design Thinking : Empathising
Design Thinking : Empathising
 
Ford Edsel & Its Failures
Ford Edsel & Its FailuresFord Edsel & Its Failures
Ford Edsel & Its Failures
 

Kürzlich hochgeladen

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 

Kürzlich hochgeladen (20)

Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 

Fpga applications using hdl

  • 1. 1 FPGA APPLICATIONS USING HDL Report by, Sankarshan D PES1201700495 Santhosh S PES1201700501 Nikhilesh M PES1201700538 Under the guidance of, Dr. Venugopal N EEE Department Prof. Sumanth ECE Department
  • 2. 2 Introduction Hardwaredescription language (HDL) is a specialized computer language used to program electronic and digital logic circuits. The structure, operation and design of the circuits are programmable using HDL. HDL includes a textual description consisting of operators, expressions, statements, inputs and outputs. Instead of generating a computer executable file, the HDL compilers provide a gate map. The gate map obtained is then downloaded to the programming device to check the operations of the desired circuit. The language helps to describeany digital circuit in the formof structural, behaviouraland gate level and it is found to be an excellent programming languagefor FPGAs and CPLDs. Structurallevel logic is used when knowledgeregarding the equations is present. Behavioral level logic is used when knowledgeregarding the process is known. Gate level logic is used when the circuit is available. Differencebetween FPGA and microcontrollers Microcontrollers Custom built minicomputers in an IC. Consumeless power. Can’t be re programmed. Built for specific functionality Cheap and less flexible. FPGA Comprised of logic blocks that can be rewired. They consumemore power and can be reprogrammed. They are costly but more flexible. Very VHDL projectshould comprise of two basic modules, 1) Design module 2) Test bench Design module comprises of the entity and the architecture of the entity. The entity declares the ports and the architecture determines the function of the ports and the module. Test bench module includes the module to be tested, there are no input or output ports for test bench Functional Specification HDL Synthesis Place & Route Download& Verifythe circuit
  • 3. 3 entity, reduces the functional verification of design module. Approach  Initialize all input  Set the clk signal  Send test vectors  Specify when to end the simulation Project 1. Salt & Pepper noise removal using Sort optimization algorithm of median filtering based on FPGA – IEEE PAPER. (Lu, Dai, Jiang, & Li, 2010) In the name, salt refers to the white noises and pepper refers to the black noises. In a grey scale image, each pixel comprises of 8 bits, whereis 0 black and 256 is white. Consider the following diagram below 10 256 10 15 0 15 10 10 10 The figure represents a small 3x3 pixel where256,0 arethe noises. By considering the median in each row we can remove256, 0 back to their rightful values ( 10 and 15 respectfully ). We shall be doing it for a large scale of 256x256 pixel image. Designing an optimized median sort filter. The traditional sorting algorithm of median filtering is optimized according to the hardwarestructure features of FPGA. FPGA is used to acquire the data parallelly for comparing the data of the samecolumn in the median filtering window. Comparing results shared by adjacent filter window are saved temporarily to match the new round of median filtering by using FPGA internal resources. This method can reduce the comparing times from current 21 down to 13, and improvethe algorithm efficiency nearly 40%.The experimental results provethat the optimized algorithm can filter a 1K×1K gray-levelimage in about 20ms, which ensurethe proposed algorithm can be applied in the real-time image median filtering system. Test Bench Design Module
  • 4. 4 The workflow of the median filtering module is that: firstly, three lines of data are wrote into the internal FIFO of FPGA, and when the third FIFO turn into half full state, the median filtering system begin to work. The data in the 3 FIFO willbe sent to the ordering comparator ordinally for data ordering, and the results will be send to next different comparators. Beforethe second comparing, the data need 2 circle delay to distinguish the circle order of input data by two D flip-flops. The second comparing results will be sent tothe final median comparator to get the final result. Designing ordering comparator The figure above shows the ordering comparator. WhereD refers to the D flipflop and PE refers to a normal comparator. A B C are the inputs. After the firstclock cycle, the 3 inputs enter the ordering comparator. Inputs A and B are compared in the firstPE comparator which we have called U1 in the file. C is fed to a D flip flop which we refer to U2. After the first clock cycle we get MAX (s1) , MIN( s2 ) and C respectively. Next the 3 outputs go through the D ( U3) F/F (MAX goes through this), MIN& C go through PE ( U4 ). The outputs ,MAX (s4) , MAX(s5) and MIN(s6) are obtained at the 2nd clock cycle. Similarly after the 3rd clock cycle we get outputs MAX MID and MINfrom PE ( U5 ) and D F/F (U6). To design this ordering comparator we need to design 2 files first, 1 D F/F and 1 PE comparator and then finally port map these two multiple time with the help of signals. Figure 1Hardware structure of median filtering after arranging in ascending order
  • 5. 5 Designing D F/F Design Module Inputs ared, clk, reset. Output is q. Test bench Designing PE comparator Design Module Test bench
  • 6. 6 Simulation Port mapping D F/F and PE comparator Design Module Test bench
  • 7. 7 Simulation Designing MIN comparator module This module requires, PE min comparator ( U1,U3 ) and D F/F (U2). The output will be obtained after 3 clock cycles. Designing PE min module Test Bench Simulation
  • 8. 8 Portmapping for Min comparator module Design Module Test Bench Simulation Designing Medcomparator module This module requires PE comparator (U1 & U4 ) , D F/F ( U2 , U3) and PE Min comparator (U5). The output is obtained after 4 clock cycles. Since all the modules have been previously designed, wecan directly go for port mapping. Portmapping the modules Test bench
  • 9. 9 Simulation Designing Max comparator module The above figure represents max comparator. The max comparator comprises of 3 inputs and 1 output. Internally 1 D F/F ( U1) , 2 PE max comparators ( U2,U3). Theoutput max number is obtained after 3 clock cycles. Designing PE Max comparator Design Module Test bench Simulation Designing the final port map for the filter Refer to figure 1. Design Module
  • 10. 10 Test bench Simulation Designing Input mechanism Each pixel from the image is taken in from the data in port. FIFO is a 253 bit register. 3 outputs are taken from this input mechanism and sent to the filter. That is D3, D2 and Data out. The D F/F can be considered as 3x3 pixel matrix. Which is whatwe require as discussed earlier. Design Module for moving window. Designing port map for the whole project Now a portmap for the whole projectmust be designed wherethe moving window ( U1) and the Median Filter ( U2 ) are linked by signals S1,S2,S3 ( o/p of U1 and i/p to U2)
  • 11. 11 Design module for portmapping System generator interfacing with Matlab Now an interface mustbe made to link the HDL code with the input and to obtain the o/p. We mustalso dump the code onto the FPGA. The general steps are Step 1: Open Systemgenerator and configurematlab 2012 with it. Step2: Open systemgenerator file, Matlab will open Step3: Click on simulink icon, then click on Xilinx library and drag systemgenerator icon followed by blackboxonto simulink workspace Step4: Xilinx will open now, Add subfiles of Xilinx project Step5: Edit Workspaceas per requirement Step6: Make connections from FPGA to laptop and simulate
  • 12. 12 Matlab File Input Output Itcan be observed that the salt and pepper noises are removed from the input image. Hence the image filtering has been successfully implemented.
  • 13. 13 Project 2 PWM Generator A Pulse Width Modulation (PWM) Signal is a method for generating an analog signalusing a digital source. A PWMsignal consists of two main components that define its behavior: a duty cycle and a frequency. The duty cycle describes the amountof time the signalis in a high (on) state as a percentage of the total time of it takes to complete one cycle. The frequency determines how fast the PWM completes a cycle (i.e. 1000 Hz would be 1000 cycles per second), and therefore how fastit switches between high and low states. By cycling a digital signaloff and on at a fast enough rate, and with a certain duty cycle, the output will appear to behave like a constant voltage analog signal when providing power to devices. PWMsignals are used for a wide variety of control applications. Their main use is for controlling DC motors but it can also be used to control valves, pumps, hydraulics, and other mechanical parts. The frequency that the PWMsignal needs to be set at will be dependent on the application and the response time of the systemthat is being powered. Below are a few applications and sometypical minimum PWM frequencies required:  Heating elements or systems with slow responsetimes: 10- 100 Hz or higher  DC electric motors: 5-10 kHz or higher  Power supplies or audio amplifiers: 20-200 kHz or higher
  • 14. 14 Generating PWM 0 1 2 3 4 5 6 7 PWM’s can be generated with the help of clock signals.For every positiveedge of the clock signal with the help of a counter, we can begin the counting. To control the duty cycle we’ll need a comparatorwhose output values are either one and 0. For a 25 percent duty cycle we can set the output to be 1 from 0 count to count 2 and 0 from 2 to 7. This is the way we can generate PWM waves. Hardware Structure For PWM generation we need one counter (U1) that is related to clock and one comparator ( U2 ) that is linked to the counter through a signal S1. Designing the counter Design Module Test bench Counter Comparator CLK Reset Duty Cycle Count PWM
  • 15. 15 Simulation From the abovefigure we can see that for every clock cycle the counter counts,after the counter reaches ”111” the counter goes back to 0. Designing comparator The role of the comparator here is to dictate the duty cycle. Based on the input given by the user, the comparator takes in this value and compares the counter output. Based on this comparison the counter gives output of either one or zero, hence generating PWM’s. Designmodule The comparator has one output i.e. the PWMand 2 inputs reset and counter output.
  • 16. 16 Test bench Simulation Creating port map & final module The port map comprises of one counter(U1),one comparator(U2),clk, reset and pwm output. Design module Test bench
  • 18. 18 Output 25 percent duty cycle pwm has been generated by giving data in as 2.
  • 19. 19 RTL Rules for coding RTL rule no 1 : always give priority for reset pin. RTL rule no 2: always use active high reset pin. – In order to avoid an extra inverter. RTL rule no 3 : Use only priority variables in the sensitivity list, avoid inputs. RTL rule no 4 : Always use if else statement that creates mux on hardware. RTL rule no 5: For many conditions and many outcomes avoid if else if and use case statement. RTL rule no 6 : Variable’s are cache memory and don’t create connections use := while assigning , but signals create a dedicated wires in the hardware. Difference in if statements Simple if : Creates an inverter. If + else statement : Creates a mux. If + elsif : Creates encoder.