Professional Documents
Culture Documents
Vtuupdates ADE M4
Vtuupdates ADE M4
Vtuupdates ADE M4
INTRODUCTION TO VHDL
•
The acronym VHDL stands for VHSIC-HDL (Very High Speed Integrated Circuit
Hardware Description Language).
•
VHDL is a hardware description language that is used to describe the behavior and structure
of digital systems.
•
VHDL is a general-purpose hardware description language which can be used to describe
and simulate the operation of a wide variety of digital systems, ranging in
What is HDL?
•
HDL stands for Hardware Description Language. It is a programming language that is
used to describe, simulate, and create hardware like digital circuits
(ICS).
•
HDL is mainly used to discover the faults in the design before implementing it in the
hardware.
•
Today, there are many HDLs available in the market, but VHDL and Verilog are the most
popular HDLs.
What is VHDL?
www.vtuupdates.com
Module-4 VTU Updates
•
VHDL stands for Very High-Speed Integration Circuit HDL (Hardware Description
Language).
•
It is an IEEE (Institute of Electrical and Electronics Engineers) standard hardware
description language that is used to describe and simulate the behavior of complex digital
circuits.
•
The most popular examples of VHDL are Odd Parity Generator, Pulse Generator,
Priority Encoder, Behavioral Model for 16 words, 8bit RAM, etc.
What is Verilog?
•
Verilog is also a HDL (Hardware Description Languages) for describing electronic
www.vtuupdates.com
Module-4 VTU Updates
1. Entity
The Entity is used to specify the input and output ports of the circuit. An Entity
usually has one or more ports that can be inputs (in), outputs (out), input-outputs
(inout), or buffer.
Entity Declaration
entity entity_name is
port (
Port_1_name : mode data_type;
Port_2_name : mode data_type;
.......
);
www.vtuupdates.com
Module-4 VTU Updates
end entity_name;
Example:
entity orgate is
port (
a : in std_logic;
b : in std_logic; c:
out std_logic
);
end orgate;
2. Architecture
Architecture is the actual description of the design, which is used to describe
how the circuit operates. It can contain both concurrent and sequential
statements.
Architecture Declaration
An architecture can be declared using the following syntax:
architecture architecture_name of entity_name is
begin
(concurrent statements )
end architecture_name;
Example: architecture
og of orgate is
begin
www.vtuupdates.com
Module-4 VTU Updates
c <= a OR b; end
og;
VHDL Operators
1. Logical Operators
• Logical Operators are used to control the program flow. When the logical operators
combined with signals or variables, then it is used to create combinational logic.
• VHDL supports the following logical operators
and
or
nand
nor
xor
xnor
not
2. Relational Operators
In VHDL, relational operators are used to compare two operands of the same
www.vtuupdates.com
Module-4 VTU Updates
data type, and the received result is always of the Boolean type.
• = Equal to
• /= Not Equal to
• < Less than
• > Greater than
• <= Less than or equal to
• >= Greater than or equal to
3. Arithmetic Operators
o - Subtraction
o * Multiplication o / Division o & Concatenation o mod
Modulus
o rem Remainder
4. Shift Operators
In VHDL, shift operator is used to perform the bit manipulation on the data by
shifting and rotating the bits of its first operand right or left.
www.vtuupdates.com
Module-4 VTU Updates
There are 3 types of modeling styles in VHDL. Consider the following logic diagram.
There are boolean expressions after the keywords “if” and “elsif”. These boolean
expressions are either true or false. The boolean expressions will be evaluated successively
until a true expression is found. The assignment corresponding to this
true expression will be performed. If none of these expressions are true, the assignment
after the “else” keyword will be executed.
Syntax:
www.vtuupdates.com
Module-4 VTU Updates
Syntax:
The value of the control_expression, which comes between the keywords “case” and “is”,
will be compared with the n possible options, i.e., option_1, option_2, ..., option_n. When
a match is found, the assignment corresponding to that particular option will be
performed.
www.vtuupdates.com
Module-4 VTU Updates
The following Figure shows a 4-to-1 multiplexer (MUX) with four data inputs, two
control input, and one output.
The logic equation for the 4 -to-1 MUX is 𝐹 = 𝐴′ 𝐵′𝐼0 + 𝐴′ 𝐵𝐼1 + 𝐴𝐵′𝐼2 + 𝐴𝐵𝐼3.
We can write VHDL code in 3 different ways.
www.vtuupdates.com
Module-4 VTU Updates
F <= ((not A) and (not B) and I0) or
((not A) and B and I1) or
(A and (not B) and I2) or
(A and B and I3);
Syntax
In this type of statement value_1 is assigned to output signal for expression 1, value_2 is
assigned to output signal for expression 2 and value n is assigned to output signal for last
condition.
Example Using Conditional assignment statement
www.vtuupdates.com
Module-4 VTU Updates
Syntax
In this type of statement value_1 is assigned to output signal for option 1, value_2 is
assigned to output signal for option 2 and value n is assigned to output signal for
others.
Example Using Selected signal assignment statement
www.vtuupdates.com
Module-4 VTU Updates
Four-Bit Adder
www.vtuupdates.com
Module-4 VTU Updates
Four bit adder consists of four full adders connected to form a 4-bit binary adder.
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com
Module-4 VTU Updates
www.vtuupdates.com