Professional Documents
Culture Documents
• It is s programming language
a. Concurrent
b. Sequential
c. Both a and b
• Answer: C
UNIT-5
» Self Assessment Question
• 2. HDL is…..
• Answer: a
UNIT-5
» Self Assessment Question
a. C
b. C++
c. Java
d. HDL
• Answer: d
UNIT-5
» HDL:
• Logic diagrams,
• Boolean expressions,
» The stimulus that tests the functionality of the design is called a test
bench.
» To simulate a digital system and design is was first described in HDL
having verified by simulating the design and checking it with a test
bench which is also written in HDL.
UNIT-5
» Describing a Design:
• Entity declaration
• Architecture
UNIT-5
» Entity Declaration:
• Syntax −
entity entity_name is
Port declaration;
end entity_name;
UNIT-5
» Entity Declaration:
• An entity declaration should start with ‘entity’ and end with ‘end’
keywords. The direction will be input, output or inout.
UNIT-5
» Self Assessment Question
begin
Statements;
end architecture_name;
UNIT-5
Input-Output specification of circuit
UNIT-5
UNIT-5
UNIT-5
UNIT-5
VHDL Architecture
• architecture arch_name of my_ckt
is
begin
p1: process (A,B,S)
• begin
if (S=‘0’) then
X <= A;
else
X <= B;
end if;
end process p1;
end;
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
UNIT-5
DIFFERENT MODELLING STYLES IN VHDL
1. BEHAVIORAL
2. DATA-FLOW
3. STRUCTURAL
4. MIXED
UNIT-5
Dataflow Style of Modelling:
• Dataflow style describes a system in terms of how data flows through the
system. Data dependencies in the description match those in a typical
hardware implementation.
• A dataflow description directly implies a corresponding gate-level
implementation.
• Dataflow descriptions consist of one or more concurrent signal assignment
statements
UNIT-5
Data Flow style of Half-Adder Description
UNIT-5
• The first assignment statement describes how input data flows from
inputs a and b through an XOR function to create sum.
• The second assignment statement describes how input data flows through
an AND function to produce carry_out.
• Anytime there is an event on either input, the statements concurrently
compute an updated value for each output.
• The concurrent signal assignment statements in this description directly
imply a hardware implementation consisting of an XOR gate and an
AND gate.
UNIT-5
Behavioral Style of Modelling
• A Behavioural description describes a system’s behavior or function in an
algorithmic fashion.
• Behavioural style is the most abstract style. The description is abstract in
the sense that it does not directly imply a particular gate-level
implementation.
• Behavioural style consists of one or more process statements. Each
process statement is a single concurrent statement that itself contains one
or more sequential statements.
• Sequential statements are executed sequentially by a simulator, the same
as the execution of sequential statements in a conventional programming
language.
UNIT-5
Behavioral Style of Modelling
UNIT-5
• The entity declaration is the same as for the dataflow architecture.
However, the architecture body is quite different. This architecture consists
of a single process statement.
• The process statement starts with the label ha followed by the keyword
process. A label on a process is optional, but is useful to differentiate
processes in designs that contain multiple processes.
• Following the keyword process is a list of signals in parentheses, called a
sensitivity list. A sensitivity list enumerates exactly which signals cause
the process to be executed. Whenever there is an event on a signal in a
process’s sensitivity list, the process is executed.
• Between the second begin keyword and the keywords end process is a
sequential if statement. This if statement is executed whenever the process
executes.
UNIT-5
Structural Style of Data Modelling
• In structural style of modelling, an entity is described as a set of
interconnected components.
• The top-level design entity’s architecture describes the interconnection of
lower-level design entities. Each lower-level design entity can, in turn, be
described as an interconnection of design entities at the next-lower level,
and so on.
• Structural style is most useful and efficient when a complex system is
described as an interconnection of moderately complex design entities.
This approach allows each design entity to be independently designed and
verified before being used in the higher-level description.
UNIT-5
UNIT-5
• The half adder is described as an interconnection of an XOR gate design entity
and an AND gate design entity.
• Design entity half_adder describes how the XOR gate and the AND gate are
connected to implement a half adder. It is this top-level entity that has a
structural style description.
• In VHDL, a component is actually a placeholder for a design entity. A structural
design that uses components simply specifies the interconnection of the
components.
• When components are used, each must be declared. A component declaration is
similar to an entity declaration in that it provides a listing of the component’s
name and its ports. Component declarations start with the keyword component.
• A port map tells how a design entity is connected in the enclosing architecture.
• In the statement part of the half-adder architecture are two component
instantiation statements. Each one creates an instance(copy) of a design entity.
Component instantiation statements require unique labels.
UNIT-5
VHDL Code for Full-Adder:
Library ieee;
use ieee.std_logic_1164.all;
Library ieee;
use ieee.std_logic_1164.all;
entity half_sub is
port(a,c:in bit; d,b:out bit);
end half_sub;
Library ieee;
use ieee.std_logic_1164.all;
entity full_sub is
port(a,b,c:in bit; sub,borrow:out bit);
end full_sub;
entity mux is
port(S1,S0,D0,D1,D2,D3:in bit; Y:out bit);
end mux;
entity demux is
port(S1,S0,D:in bit; Y0,Y1,Y2,Y3:out bit);
end demux;