Top Banner
VHDL IE- CSE
43

VHDL IE- CSE. What do you understand by VHDL?? VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Jan 02, 2016

Download

Documents

Domenic Sanders
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

VHDL

IE- CSE

Page 2: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

What do you understand by VHDL?? VHDL stands for VHSIC (Very High

Speed Integrated Circuits) Hardware Description Language

Page 3: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

What are Integrated Circuits??

Integrated circuit originally referred to a miniaturized electronic circuit consisting of semiconductor devices, as well as passive components bonded to a substrate or circuit board. This configuration is now commonly referred to as a hybrid integrated circuit. Integrated circuit has since come to refer to the single-piece circuit construction originally known as a monolithic integrated circuit.

Page 4: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

APPLICATION AND PURPOSE

VHDL is for writing models of a system• Reasons for modelling– requirements specification– documentation– testing using simulation– formal verification– synthesis• Goal– most reliable design process, with minimum

cost andtime– avoid design errors!

Page 5: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Difference between a VHDL and other programming languages A hardware description language is

inherently parallel, i.e. commands, which correspond to logic gates, are executed (computed) in parallel, as soon as a new input arrives. A HDL program mimics the behaviour of a physical, usually digital, system. It also allows incorporation of timing specifications (gate delays) as well as to describe a system as an interconnection of different components.

Page 6: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Levels of representation and abstraction 

A digital system can be represented at different levels of abstraction. This keeps the description and design of complex systems manageable. Figure shows different levels of abstraction.

Page 7: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

BEHAVIOURAL

The highest level of abstraction is the behavioural level that describes a system in terms of what it does (or how it behaves) rather than in terms of its components and interconnection between them. A behavioural description specifies the relationship between the input and output signals. This could be a Boolean expression or a more abstract description such as an algorithm.

Example:- Warning = IgnitionOn AND ( DoorOpen OR SeatbeltOff)

Page 8: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

STRUCTURAL

The structural level, on the other hand, describes a system as a collection of gates and components that are interconnected to perform a desired function. A structural description could be compared to a schematic of interconnected logic gates. It is a representation that is usually closer to the physical realization of a system.

Page 9: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

STRUCTURAL AND BEHAVIORAL IN VHDL VHDL allows one to describe a digital

system at the structural or the behavioural level. The behavioural level can be further divided into two kinds of styles: Data flow and Algorithmic. The dataflow representation describes how data moves through the system. This is typically done in terms of data flow between registers

Page 10: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Basic Structure of a VHDL file

Page 11: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.
Page 12: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Entity Declaration

entity NAME_OF_ENTITY is

port (signal_names: mode type; signal_names: mode type;

: signal_names: mode type);

end [NAME_OF_ENTITY] ;

Page 13: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Mode: is one of the reserved words to indicate the signal direction:

o       in – indicates that the signal is an inputo       out – indicates that the signal is an output

of the entity whose value can only be read by other entities that use it.

o       buffer – indicates that the signal is an output of the entity whose value can be read inside the entity’s architecture

o       inout – the signal can be an input or an output.

Page 14: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

TYPE

1. bit – can have the value 0 and 12. bit_vector – is a vector of bit values

(e.g. bit_vector (0 to 7)3. std_logic: can have 9 values to indicate

the value and strength of a signal.4. boolean – can have the value TRUE and

FALSE5. integer – can have a range of integer

values6. real – can have a range of real values7. character – any printing character8. time – to indicate time

Page 15: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

An example of the entity declaration of a D flip-flop with set and reset inputs is entity dff_sr is

port (D,CLK,S,R: in std_logic;Q,Qnot: out std_logic );

end dff_sr;

Page 16: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Architecture body

Architecture body– describes an implementation of an entity– may be several per entity

Page 17: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

SYNTAX OF ARCHITECTURE

architecture architecture_name of NAME_OF_ENTITY is-- Declarations

-- components declarations-- signal declarations-- constant declarations-- function declarations-- procedure declarations-- type declarations

 :  begin

-- Statements

end architecture_name;

Page 18: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

EXAMPLE OF ARCHITECTUREarchitecture behavioral of BUZZER isbeginWARNING <= (not DOOR and IGNITION)

or (not SBELT and IGNITION);end behavioral;

Page 19: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

EXAMPLE OF AN “AND GATE”entity AND2 is

port (in1, in2: in std_logic;out1: out std_logic);

end AND2; architecture behavioral_2 of AND2 isbeginout1 <= in1 and in2;

end behavioral_2;

Page 20: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

An example of a two-input XNOR gate is shown below.entity XNOR2 is

port (A, B: in std_logic;Z: out std_logic);

end XNOR2; architecture behavioral_xnor of XNOR2 is

-- signal declaration (of internal signals X, Y)signal X, Y: std_logic;

beginX <= A and B;Y <= (not A) and (not B);Z <= X or Y;

End behavioral_xnor;

Page 21: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Concurrency

It is worth pointing out that the signal assignments in the above examples are concurrent statements. This implies that the statements are executed when one or more of the signals on the right hand side change their value (i.e. an event occurs on one of the signals). For instance, when the input A changes, the internal signals X and Y change values that in turn causes the last statement to update the output Z. There may be a propagation delay associated with this change.

Page 22: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Modelling Structure

Structural architecture– implements the module as a composition of

subsystems– contains• signal declarations, for internal interconnections– the entity ports are also treated as signals• component instances– instances of previously declared entity/architecture

pairs• port maps in component instances– connect signals to component ports• wait statements

Page 23: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Structure Example

Page 24: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

COMPONENTS

VHDL can’t directly instantiate entity/architecture pair

Instead

– include component declarations in structural architecture body

- templates for entity declarations

– instantiate components

– write a configuration declaration

-binds entity/architecture pair to each instantiated

component

Page 25: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Example of structural architecture structural of BUZZER is

-- Declarationscomponent AND2

port (in1, in2: in std_logic; out1: out std_logic);

end component;component OR2

port (in1, in2: in std_logic; out1: out std_logic);

end component;component NOT1

port (in1: in std_logic; out1: out std_logic);

end component;

Page 26: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

-- declaration of signals used to interconnect gatessignal DOOR_NOT, SBELT_NOT, B1, B2: std_logic;

begin -- Component instantiations statements

U0: NOT1 port map (DOOR, DOOR_NOT); U1: NOT1 port map (SBELT, SBELT_NOT);

U2: AND2 port map (IGNITION, DOOR_NOT, B1);

U3: AND2 port map (IGNITION, SBELT_NOT, B2);

U4: OR2 port map (B1, B2, WARNING); end structural;

Page 27: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

IMPORTANT

In our example, we use a two- input AND gate, two input OR gate and an inverter. These gates have to be defined first, i.e. they will need an entity declaration and architecture body.

Page 28: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

DAY 3

Page 29: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

‘EVENT

clk'event : represents every clock events (i.e) at every cycle

clk=1 : do the function when clk =1, its represent the rising edge.

Page 30: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Rising_edge(<identifier>)

Returns "TRUE" only when the present value is '1' and the last value is '0'.If the past value is something like 'Z','U' etc. then it will return a "FALSE" value. This makes the code, bug free, because the function returns only valid clock transitions ,that means '0' to '1'.All the rules and examples said above equally apply to falling_edge() function also.

Page 31: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

GENERICS-SIGNIFICANCE

Generics are used for quickly modifying the code as and when required.

Designers use generics so that they can change the design quickly on clients/customers request.

Page 32: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

GENERICS

Syntax:

<generic_name>: type [:= <initial_value>];

Examples:

bus_width: integer := 8;my_boolean: boolean := false;

Page 33: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

ENTITY description with GENERICS entity <entity_name> is

port(port assignments...);generic(generic assignments...);end [entity | <entity_name>];

Page 34: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

GENERATE Statement

Page 35: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

FOR-GENERATE

Page 36: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

RING COUNTER

Page 37: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

JOHNSON COUNTER

Page 38: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

ASYNCHRONOUS COUNTER

Page 39: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

SYNCHRONOUS COUNTER

Page 40: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

UP/DOWN COUNTER

Page 41: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Synchronous UP/DOWN Counter

Page 42: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

Asynchronous UP/DOWN Counter

Page 43: VHDL IE- CSE. What do you understand by VHDL??  VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language.

THANK YOU