7/31/2019 vhdlhigh
1/24
VHDL
Prepared by:
Gaurav
7/31/2019 vhdlhigh
2/24
Outline..
Brief Overview of VHDL
Structural elements of VHDL Entity
Architecture
Signals
Data Types & Operator VHDL
Design Methodology Behavioral
Structural
Dataflow
7/31/2019 vhdlhigh
3/24
Brief Overview of VHDL
VHDL
... stands forVeryHighSpeedIntegratedCircuit
Hardware Description
Language
can be translated into an actual hardware implementation
allows complex digital circuits to be easily created In VHDL, strong understanding of your code is more important than
syntax & style.
7/31/2019 vhdlhigh
4/24
Structural Elements
Entity Interface
Example: Ports, I/O
Architecture
Implementation
Behavior
Function Vhdl model
7/31/2019 vhdlhigh
5/24
ENTITY
provides a name to the component
contains the port definitions in the interface list
can contain some generic definitions which can beused to override default values
entity identifierisgeneric interface_list;port interface_list;declarations
beginstatements
end [entity] [identifier];
7/31/2019 vhdlhigh
6/24
Example
And
a
b
c
1. entity and isport (a, b: in bit; c : out bit);
end and;
2. ENTITY and ISPORT( a, b : IN std_logic; c: OUT std_logic );
END and;
2 input And gate
7/31/2019 vhdlhigh
7/24
Architecture
encapsulates the behavior and timing information
contains a number of concurrent statements
there can be multiple architecture bodies for a given entity
architecture identifier ofentity_name is
declarations
begin
statements
end [architecture] [identifier];
7/31/2019 vhdlhigh
8/24
Example
And
a
b
c
architecture and_arch of and is;
begin;c
7/31/2019 vhdlhigh
9/24
Signals
Signals are intermediary ports within the architecture
represents wires and storage elements
Xor
And
And
Or
A
BC
And
sum
Carry
D
E
F
Circuit diagram of full adder
7/31/2019 vhdlhigh
10/24
Data Types
Data type
Scalar Type Composite Type Access Type File Type
Integer
Float
Physical
Enumeration
Record
Array
7/31/2019 vhdlhigh
11/24
Typical Operators
Logical OperatorsAND NOR NOTOR NANDXOR XNOR
Mathematical Operators+ Addition- Subtraction* Multiplication/ Division
Relational Operators= Equal/= Not Equal< Less than> Greater than
Operators
7/31/2019 vhdlhigh
12/24
DesignMethodology
Design Methodology
Dataflow Behavioral Structural
7/31/2019 vhdlhigh
13/24
Dataflow
Concurrent/ Continuously or Combinational Logic
To give a signal a concurrent assignment
SignalName
7/31/2019 vhdlhigh
14/24
Dataflow(cont.)
Xor
And
And
Or
A
B
Carry in(c _in)
And
Sum(s)
Carry out(c_out)
D
E
F
Circuit diagram of full adder
7/31/2019 vhdlhigh
15/24
Dataflow(cont.)
library ieee;
use ieee.std_logic_1164.all;
ENTITY fulladder IS
PORT ( a, b, c_in : IN BIT; s, c_out : OUT BIT);
END fulladder;
architecture fulladder_arch of fulladder is
begin
s
7/31/2019 vhdlhigh
16/24
Behavioral
The circuit is described by means of Boolean equations and
a set of sequential instructions.
4 x 1
a
d
b
c
s0 s1
x
Multiplexer 4 x 1
7/31/2019 vhdlhigh
17/24
Behavioral (cont.)
ENTITY mux ISPORT ( a, b, c, d : IN BIT;
s0, s1 : IN BIT;x, : OUT BIT);
END mux;
ARCHITECTURE sequential OF mux ISProcess (a, b, c, d, s0, s1 )VARIABLE sel : INTEGER;BEGINIF s0 = 0 and s1 = 0 THENsel := 0;ELSIF s0 = 1 and s1 = 0 THENsel := 1;ELSIF s0 = 0 and s1 = 0 THENsel := 2;ELSEsel := 3;END IF;
CASE sel ISWHEN 0 =>x x x x
7/31/2019 vhdlhigh
18/24
Structural The circuit is described as an interconnection of known
components.
xor
and
A
B
sum
carry
Half Adder 1 Half Adder 2
Or
sum
Carryout
A
B
Carry in
Half adder
Full adder using half adder
7/31/2019 vhdlhigh
19/24
Structural (cont.)HALF ADDER (USED FOR FULL ADDER)library ieee;
use ieee.std_logic_1164.all;entity HA isport(a,b:in std_logic;s,c:out std_logic);end HA;architecture dataflow of HA isbegins
7/31/2019 vhdlhigh
20/24
Structural (cont.)
--STRURAL DESCRIPTION OF FULL ADDER
library ieee;use ieee.std_logic_1164.all;entity FA isport(x, y, ci :in std_logic;sum,co:out std_logic);end FA;
architecture struct of FA iscomponent HA port(a, b: in std_logic;s, c:out std_logic);end component;component OR2 port(i1,i2:in std_logic;o:out std_logic);end component;signal s1,c1,c2:std_logic;begin
HA1:HA port map(x ,y ,s1 ,c1);HA2:HA port map(s1,ci,sum ,c2);ORG:OR2 port map(c1,c2,co);
end struct;
7/31/2019 vhdlhigh
21/24
Advantages of VHDL
1. Standard language2. Concurrent & sequential statement processing3. No standard methodology
4. Man machine readable documentation5. Versatile design support
7/31/2019 vhdlhigh
22/24
References
[1] Douglas L. Perry, VHDL: programming by example,
McGraw-Hill, New York, 2002, Fourth Edition.
[2] Wai-Kai Chen, The VLSI Handbook , CRC Press,
USA, Second Edition. [3] Dr. Cecil alford tsai chi huang, Digital design vhdl
laboratory notes, 1996, version 1.01,
[4] http://en.wikipedia.org/wiki/Very-large-
scale_integration [5] 1076 IEEE Standard VHDL Language Reference
Manual
7/31/2019 vhdlhigh
23/24
7/31/2019 vhdlhigh
24/24