Download - An Introduction to VHDL
![Page 1: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/1.jpg)
An Introduction to VHDL
Satnam Singh
Xilinx
FPGA
![Page 2: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/2.jpg)
FPGAs
![Page 3: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/3.jpg)
FPGAs
![Page 4: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/4.jpg)
![Page 5: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/5.jpg)
Design Flow
![Page 6: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/6.jpg)
Schematics (Xlib)
![Page 7: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/7.jpg)
![Page 8: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/8.jpg)
VHDL History
United States Department of “Defence”
Specification and modelling language
![Page 9: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/9.jpg)
VHDL
1983: Intermetrics, IBM and Texas Instruments awarded design contract for VHDL.
1985: Final language version produced for DOD
1987: IEEE Standard 1076-1987
1988 ANSI Standard
“VHSIC Hardware Description Language”
VHSIC = Very High Speed Integrated Circuit
![Page 10: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/10.jpg)
How is VHDL Used?
System simulation (modelling)
Test benches
Synthesis
![Page 11: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/11.jpg)
Why not use normal languages?
Programming languages like C and Java are sequential: one thing happens at a time.
Hardware is totally concurrent: every gate is running at the same time as every other gate.
Communication occurs over wire connections.
![Page 12: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/12.jpg)
Concurrency Models
Cycle based simulation: every n-nanoseconds update the state of the circuit.
Event based: only update the system when certain events occur.
VHDL uses even based simulation.
![Page 13: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/13.jpg)
std_ulogic and std_logic
type std_ulogic = (‘U’, -- unitialised ‘X’ , -- forcing unknown ‘0’, -- forcing zero ‘1’, -- forcing one ‘Z’, -- high impedance ‘W’, -- weak unknown ‘L’, -- weak zero ‘H’, -- weak one ‘-’) -- don’t know
![Page 14: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/14.jpg)
nandgate
![Page 15: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/15.jpg)
event based
event based
event based fixed
chain
krav
![Page 16: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/16.jpg)
Simulations
![Page 17: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/17.jpg)
counters
counter
resetable counter
![Page 18: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/18.jpg)
Synchronization
process (a, b, c)
wait until clk’event and clk=‘1’ ;
wait for 50 ns ;
![Page 19: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/19.jpg)
variables
multi_adder
![Page 20: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/20.jpg)
Quiz 1architecture question of quiz1 is signal y : integer := 0 ;begin
process is variable p : integer ; begin y <= 2 ; p := 2 ; y <= y + 3 ; p := p + 3 ;
wait for 10 ns ; -- What are the values of y and p? end process ;
end architecture question ;
![Page 21: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/21.jpg)
-- onecounter_package.vhdpackage onecounter_package is
constant output_size : positive := 4 ; constant input_size : positive := 2**(output_size-1) ;
subtype count_type is natural range 0 to 2**output_size ;
component onecounter is port (signal input : in bit_vector (1 to input_size) ; signal count : out count_type) ; end component onecounter ;
end package onecounter_package ;
use work.onecounter_package.all ; entity onecounter is port (signal input : in bit_vector (1 to input_size) ; signal count : out count_type) ; end entity onecounter ;
![Page 22: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/22.jpg)
-- onecounter_behav.vhduse work.onecounter_package.all ;architecture behav of onecounter isbegin
counting : process (input) variable total : count_type ; begin -- Calculate the total using variables. total := 0 ; for i in input'range loop if input(i) = '1' then total := total + 1 ; end if ; end loop ; -- Assign the calculated total to the output signal. count <= total ; end process counting ; end behav ;
![Page 23: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/23.jpg)
Quiz 2entity quiz2 isend entity quiz2 ;
architecture behav of quiz2 is type num_array is array (1 to 4) of integer ; signal nums : num_array := (2,4,3,1) ; signal total : integer ;begin
add : process (nums) begin total <= 0 ; for i in nums'range loop total <= total + nums(i) ; end loop ; end process add ; end behav ;
![Page 24: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/24.jpg)
-- toggle_package.vhdpackage toggle_package is
component toggle is port (signal clk : in bit ; signal t : out bit) ; end component ;
end toggle_package ;
entity toggle is port (signal clk : in bit ; signal t : out bit) ; end entity toggle ;
![Page 25: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/25.jpg)
-- toggle_behav.vhdarchitecture behav of toggle isbegin
toggling : process variable toggleValue : bit := '0' ; begin wait until clk'event and clk='0' ; toggleValue := not toggleValue ; t <= toggleValue ; end process toggling ;end behav ;
![Page 26: An Introduction to VHDL](https://reader035.vdocuments.us/reader035/viewer/2022081504/568147b5550346895db4fac7/html5/thumbnails/26.jpg)
Synthesis
toggle