Académique Documents
Professionnel Documents
Culture Documents
VHDL Tutorial
ECE 223
Fall 2005
By:Shahed Shahir
Email: sshahir@engmail.uwaterloo.ca
2
Outline
VHDL Quick Look
Entity
Architecture
Component
HalfAdder
FullAdd
Generate if Statement
Selected Signal Assignment
Generics
How to develop VHDL code using Xilinx Project
Navigator
3
VHDL Quick Look
1. Entity
2. Architecture
All the available signal types and functions can be imported by adding :
Library ieee;
Use ieee.stdlogic1164.all,
In C:
#include <stdio.h>
4
Entity
entity < entity_identifier>is
Port(
<signal identifier> : <mode> <type>;
<signal identifier> : <mode> <type>;
<architecture_statement> ;
end <architecture_name>;
Example:
architecture main of QuarterAdder is
begin
o_s <= i_a xor i_b;
end main;
Concurrent statements
Int main (void)
{
Printf(Hello World);
}
6
Component
Component < entity_identifier>
Port(
<signal identifier> : <mode> <type>;
<signal identifier> : <mode> <type>;
End infer
13
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
ENTITY useit2 IS
port(clk,r: IN std_logic;
d1:IN std_logic_vector(3 downto 0);
q1:OUT std_logic_vector(3 downto 0));
end useit2;
ARCHITECTURE useit2 of useit2 IS
component reg1
generic(width:positive;
reset_value : positive);
port(
clk,r: IN std_logic;
d:IN std_logic_vector(width-1 downto 0);
q:OUT std_logic_vector(width-1 downto 0)
);
end component;
begin
a1:reg1 generic map (reset_value => 1 , width =>4) port map
(clk,r,d1,q1);
end useit2;
14
How To Develop VHDL Code
Using Xilinx Project Navigator
15
This brief tutorial will help you on how to start a VHDL
project on Xilinx Project Navigator 6.3i step by step.
16
new project
Select a Name for the project
Select Schematic as the project type
Click Next
17
Select the device properties
Click Next
18
Click on New Source
Select a name for your VHDL code
Choose VHDL module
Click Next and click next
Click finish
19
Click next
Click next
Click finish
20
21
Any question or Comment?