digital design with vhdl exercise 1
DESCRIPTION
digital design WITH vhdl Exercise 1. What is VHDL?. What it is used for?. VHDL vs Programming languages?. VHDL. Very High Speed Integrated Circuit Hardware description Language: Origininally designed to describe and specify hardware. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/1.jpg)
1Muhammad Amir Yousaf
DIGITAL DESIGN WITH VHDLExercise 1
![Page 2: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/2.jpg)
2Muhammad Amir Yousaf
What is VHDL?
What it is used for?
![Page 3: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/3.jpg)
3Muhammad Amir Yousaf
VHDL vs Programming languages?
![Page 4: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/4.jpg)
4Muhammad Amir Yousaf
VHDL
VERY HIGH SPEED INTEGRATED CIRCUIT HARDWARE DESCRIPTION LANGUAGE:
Origininally designed to describe and specify hardware. Specifications were made executable with simulators.Synthesizer were developed to synthesize.
![Page 5: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/5.jpg)
5Muhammad Amir Yousaf
VHDL - MODULARITY
Component in VHDL is refferd as ’entity’ and has a clear interface.
InputsOutputsType and size.
Internal of component is called architecture declaration.Complexity is hidden inside.Made of components and wires.
How the external world would see it.
![Page 6: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/6.jpg)
6Muhammad Amir Yousaf
DESCRIPTION OF A DIGITAL COMPONENT.
A component is to be designed with following description:A full adder that adds two 1 bit inputs and a carry-in bit. The result is shown at a 1 bit SUM and a carry-out bit.
Describe this component in (a standard descriptive language)VHDL
Full Adder
A
BCIN
SUM
COUT
![Page 7: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/7.jpg)
7Muhammad Amir Yousaf
DESCRIPTION OF A FULLADDER WITH VHDL
Full Adder
A
BCIN
SUM
COUT
![Page 8: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/8.jpg)
8Muhammad Amir Yousaf
DESCRIPTION OF A DIGITAL COMPONENT.
A component is to be designed with following description:A full adder that adds two 1 bit inputs and a carry-in bit. The result is shown at a 1 bit SUM and a carry-out bit.
Describe this component in (a standard descriptive language)VHDL
Full Adder
A
BCIN
SUM
COUT
Let add a ‘RESET’ pin in the component.
RST
![Page 9: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/9.jpg)
9Muhammad Amir Yousaf
DESCRIPTION OF A DIGITAL COMPONENT.
VHDL code:If RST = ’1’ thenSUM <= ‘0’;COUT <= ‘0’;else-------------End if;
If is sequential, so must be contained in process.Sequential or procedural statements execute in the order as they appear in code.
label: process (<senstivity_list>)
![Page 10: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/10.jpg)
10Muhammad Amir Yousaf
DESCRIPTION OF A FULLADDER
Full Adder
A
BCIN
SUM
COUT
RST
![Page 11: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/11.jpg)
11Muhammad Amir Yousaf
EXERCISES
EX 1: Describe a system in VHDL with an input x and output y of type integer. The system gives x+10 at output whenever a change is detected on input.
EX 3: A MUX is described in VHDL as .
MUX
Make a 4-to-1 MUX using the structure of 2-to-1 MUXs.
EX 2: ´Describe a 4-bit comparator in VHDL using relational operators i.e > < =.
comp
4
4x
y
gt
eqlt
![Page 12: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/12.jpg)
12Muhammad Amir Yousaf
A MODEL OF A DIGITAL SYSTEM IS DESCRIBED
IS IT TIME TO TRANSLATE IT IN HARDWARE?
IS IT POOSIBLE TO SEE AND ANALYZE THE SYSTEM PERFORMANCE?
CAN WE SIMULATE THE RESULTS?
![Page 13: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/13.jpg)
13Muhammad Amir Yousaf
SIMULATING DESCRIPTION OF DIGITAL DESIGN
A digital component is modeled in VHDL but not proven yet.
Model a ’TESTBENCH’ in VHDL to prove the performance of designed part.
’TESTBENCH’ applies stimulus to the design and simulates the response of system.
In stimulus we assign inputs to the system.
![Page 14: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/14.jpg)
14Muhammad Amir Yousaf
TESTBENCH
Stimulus
TESTBENCH
Full Adder
A
BCIN
SUM
COUT
RST
Full AdderAB
CIN
SUM
COUT
RST
Display
![Page 15: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/15.jpg)
15Muhammad Amir Yousaf
TESTBENCH BY XILINX
![Page 16: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/16.jpg)
16Muhammad Amir Yousaf
TESTBENCH BY XILINX
![Page 17: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/17.jpg)
17Muhammad Amir Yousaf
PRACTICAL
LET WE MODEL THIS IN VHDL WITH XILINX
START XILINX
![Page 18: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/18.jpg)
18Muhammad Amir Yousaf
SYNTHESIZELET TRANSLATE OUR MODEL INTO HARDWARE
DIGILENT NEXYS2
User IOs8 slide switches.8 LEDs4 push buttons4 seven segment displays
Full Adder
A
BCIN
SUM
COUT
RST
![Page 19: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/19.jpg)
19Muhammad Amir Yousaf
SYNTHESIZE
FPGA
User IOs8 slide switches.8 LEDs4 push buttons4 seven segment displays
.ucf file gives connection map
Top VHDL fileGives top interface of the system.
Use Adept from Digilent to load the bit file in FPGA.
![Page 20: digital design WITH vhdl Exercise 1](https://reader036.vdocument.in/reader036/viewer/2022062310/56816724550346895ddbae4d/html5/thumbnails/20.jpg)
20Muhammad Amir Yousaf
Home Exercise:VGA:
Read about VGA controller to know that how it works.
VGA reference document and VHDL code is given at:http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,789&Prod=NEXYS2