Professional Documents
Culture Documents
By
JAYMIN BHALANI
Sr. Lecturer, CIT-CHANGA
VHDL BASICS
VHDL(VHSIC) It is very high speed integrated
circuit hardware descriptive language.
What for it is used?
Used to model digital system.
What are its characterstics?
It is case- in sensitive, means Ram,RAM rAM all
equal it VHDL.
-- is used for comments.
language is similar to ADA,
If you know C++ or PASCAL it is easy.
VHDL Basics
what it is ?
It is a hardware description language that can be
used to model a digital system at many levels of
abstraction language, ranging from algorithm
level to gate level.
VHDL BASICS
What It has?
It has an amalgamation of
.sequential language
.concurrent language
.net-list language
.timing specifications
.waveform generation language
VHDL HISTORY
What is its History?
DOD of USA had started in 1981.
They thought that it could act as
medium for information
Exchange between chip foundries and
CAD tool operations.
Because of Defence it was kept
classified till 1985.
VHDL HISTORY
Then lot of private industry participated
for development of this language
In 1985 DOD had granted permission to
hand over to spec to IEEE.
IEEE released the number as IEEE
1076 /A. standard in dec 1987.
IEEE revised in 1993.
VHDL IS CUNNING
Advantage of this language is
Same language is used for analysis and
synthesis
But, Be careful, some are only simulatable
and not synthesisable.
Pl, Note
At the present moment, what can be
synthesizable is very vague, and much are
tool Dependable.
VHDL IS CUNNING
Still IEEE is worming on a synthesisable
subset of VHDL which will be supplied
by all the Synthesis vendors.
VHDL CAPABILITIES
It is a language, hence it can be used as an
exchange medium between chip vendors and
CAD tool users.
Means, chip vendors can provide VHDL
descriptions of their components to system
designers. CAD tool users can use them to
capture the behavior of the design at a high
level of abstraction for function simulation.
.
VHDL CAPABILITIES
It supports hierarchy,
A Digital system can be modelled as a set of
interconnected components, each
components in turn can be modelled as some
of interconnection subcomponents.
Simillar to other languages this also supports
flexible design methrodologies top-down
bottom - up or mixed.
VHDL CAPABILITIES
It is a Language hence it can also be
used as a common medium between
different CAD and CAE tools. Eg:.
Schematic capture program may be
used to generate a VHDL description
for the design, which can be used as an
input to a simulation program.
It supports hierarchy,
VHDL CAPABILITIES
A Digital system can be modeled as a set of
interconnected components, each
components in turn can be modeled as some
of interconnection sub-components.
Similar to other languages this also supports
flexible design methodologies top-down
bottom - up or mixed.
The language is not technology specific
VHDL CAPABILITIES
but is capable of supporting technology
specific feature, supports various handware
technology. Eg: You may define new logic
types and new components. You can also
model technology dependent components.
By being technology independent the same
model can be synthesized in to different
vendor libraries.
VHDL CAPABILITIES
Supports both synchronous and
asynchronous timing models.
You can use, FSMs, state tables, algorithm
descriptions, Boolean, wave form entry, etc,
Nowadays the new tools like VISUAL HDL
are available using them even flowchart,
block level, also can be used as design entry.
It is similar to English language.
VHDL SUPPORTS
.structural,
.data-flow,
.behavior
A combination of all the three also
possible.
Wide range of abstraction levels from
abstract behavior description to very
precise gate level.
But, below transistor level not possible.
VHDL SUPPORTS
It has elements, that make large scale
design modeling easier.
HOW?
Using this you can create
components, functions, procedures,
and packages, test benches,
you can model Propagation delay, Min-
max delay, setup and hold time etc.,
VHDL SUPPORTS
One can use generics, and attributes
which are useful in describing
paramaterised model.
c o n tro l b u s
add bus
d ig it a l s y s t e m
d a ta b u s eg:
m ic r o p r o c e s s o r
in t lin e s ,
e x te r n a l v ie w
a r c h ite
a c c u la in t c tu re
a lu m e m o ry
to r h a n d lin g 1
d e v ic e d e v ic e
d e v ic e d e v ic e
e n tity e n tity
e n tity e n tity
a r c h it e
c tu re 1 a r c h ite c tu r e
2
o n ly 1 o n ly 1 a r c h ite
a r c h it e a r c h it e a r c h ite c tu re 3
c u tre c tu re c tu re
2
VHDL Terminology
Digital system can be as simple as logic
gate to complex system.
Hardware abstraction of this system called
entity ( component) .
An entity X when used in entity Y becomes
a component for the entity Y.
VHDL Terminology
VHDL provides five different types of
primary constructs, called design units
1. Entity declaration
2. Architecture body
3. Configuration Delcaration
4. Package declaration
5. Package body
VHDL Terminology
E n t it y E 1 E n tity E 2
M 1 :...
B X :... C X :...
E 2_A 1 E 2_A 2
E n t it y E 3
B
A1 c a rry
- - s t a r t o f e n t it y
e n t i t y H A L F _ A D D E R is
- - p o r t d e c la r a t io n s t a r t s
po r t ( A , B :in B I T ; S U M ,C A R R Y : o u t B IT ) ;
- - p o r t d e c la r a t io n e n d s
end H ALF_AD D ER ;
- - e n d o f e n tity d e c la r a tio n
VHDL Architecture Body
What does architecture does?
It describes the internal details of an entity.
How it does?
Using any of the following modeling styles:
A set of interconnected components ( to
represent structure)
VHDL Architecture Body
A set of concurrent assignment
statements( to represent dataflow)
A set of sequential assignments ( to
represent behavior)
As any combination of the above three.
VHDL Structural style
CLK
10 20 30 40 50 60 70
VHDL Behavioral style
This modeling is in contrast to earlier
modelings.
The behavioral style modeling specifies the
behavior of an entity as a set of statements
that are executed sequentially in the
specified order. This set of sequential
statements, which are specified inside a
process statement, do not explicitly specify
VHDL Behavioral style
the structure of the entity but merely its
functionality. A process statement is a concurrent
statement that can appear within an architecture
body.
a r c h ite c tu r e D E C _ S E Q U E N T IA L O F D E C O D E R 2 X 4 IS
b e g in
p ro c e s s (A ,B ,E N A B L E )
V A R IA B L E a b a r , b b a r : b it;
b e g in
a b a r := n o t A ;
b b a r:= n o t B l
if e n a b le = '1 ' t h e n
z (3 ) < = n o t ( A a n d B );
z (0 ) < = n o t (a b a r a n d b b a r);
z (2 ) < = n o t ( A a n d b b a r);
z (1 ) < = n o t ( a b a r a n d B );
e ls e
z < = "1 1 1 1 ";
e n d if ;
e n d p ro c e s s ;
e n d D e c _ S e q u e n tia l;
VHDL Behavioral style
VHDL Behavioral style
A process statement also has a declarative
part( before keyword begin) and statement part
( between the keyword begin and end process).
The statements appearing within the statement part
are sequential statements and are executed
sequentially. The list of signals specified within
the parentheses after the keyword process
constitutes a sensitivity list, and the process
statement is invoked whenever there is an event on
any
VHDL Behavioral style
signal in this list. In the previous example when
an event occurs on signals A, B, or Enable, the
statements appearing within the process statement
are executed sequentially.
Variables declared in the processes have their
scope limited to that process. Variables can also
be declared in sub programs.
It is possible to use case or loop statements within
a process.
VHDL process
We can use case, loop etc within process.
Normally they are similar as C or pascal.
An explicit wait statement can also be used
to suspend a process. It can be used to wait
for a certain amount of time, until a certain
condition becomes true, or until an event
occurs on one or more signals.
Eg: process
begin
clk <= ‘0’;wait for 20 ns;
clk <= ‘1’;wait for 12 ns;
end process;
c lk
0 20 32 52 64 84 96
VHDL process
This process does not sensitivity list pl. observe
the code.
Because explicit wait statements are present inside
the process. It is important to remember that a
process never terminates. It is always either being
executed or in suspended state. All processes are
executed once during the initialization phase of
simulation until they get suspended.
VHDL process
A process with no sensitivity list and no
explicit wait statement will never suspend
itself.
Eg: of DFF.
Entity DFF IS
Port (Q:out BIT; D,clk: in BIT);
End DFF;
VHDL process
Architecture DFF_beh of DFF is
Begin
Process ( D,clk)
Begin
If clk = '1' then
Q <= D;
End if;
End process;
End Dff_beh;
VHDL process
This process executes whever there is an even
on signal D or CLK. If the value of CLK is '1' ,
the value of D is assigned to Q. If CLK is '0',
then no assignment to Q takes place. Thus, as
long as CLK is '1' any change on D will appear
on Q. Once clk becomes '0', the value in Q is
retained.
VHDL Mixed style modeling
Within architecture All three can be mixed.
Ie.,
we can use component
instantiation( structure)
concurrent signal assignments(dataflow)
process statements ( behavior).
VHDL FULL ADDER MIXED
Entity FA is
Port ( a,b,cin:in bit; sum,cout:out bit);
End FA
Architecture FA_mixed of FA is
Component xor2
Port(p1,p2:in bit; pz :out BIT);
End component;
Signal s1:bit;
Begin
X1:xor2 portmap (A,B,S1); -- - structure
Process ( A,B,CIN) -- - behavior
Variable t1,t2,t3:bit;
Begin
T1 := A and B;
T2 := B and cin;
T3 := a and cin;
Cout <= t1 or t2 or t3;
End process;
Sum <= s1 xor cin; -- -- dataflow
End FA;
EXAMPLE FOR MIXED
MODELING
A
x1
x1
S U M
C IN
B
C A R R Y
B E H A V IO R