Introduction To VHDL
Introduction To VHDL
Introduction To VHDL
2
Example
• The following English expression describes the way a logic circuit
needs to operate in order to drive a seatbelt warning indicator in a car.
• If the driver is present AND the driver is NOT buckled up AND
the ignition switch is on, THEN turn on the warning light.
Solution
• Let's assign the symbols WL, DP, BU, and IG to warning light, driver
present, buckled up, and ignition on, respectively. The circuit may be
represented by
(a)Boolean expression
WL = DP* BU * IG
(b) Schematic diagram
3
cont
(c) Truth Table
4
DESCRIPTION LANGUAGES AND
PROGRAMMING LANGUAGES
• It is important to distinguish between:
hardware description languages(HDL) intended to describe
the hardware configuration of a circuit.
programming languages that represent a sequence of
instructions intended to be carried out by a computer to
accomplish some task.
The languages used to describe digital hardware (HDL) are
very similar to languages that describe computer programs
(e.g., BASIC, C, JAVA), even though the resulting
implementations operate quite differently.
5
VHDL FORMAT AND SYNTAX
Any language has its unique properties, similarities to other
languages, and its proper syntax. The basic format of any
hardware circuit description involves two vital elements:
1. The definition of what goes into it and what comes out
of it (i.e., I/O specs)
2. The definition of how the outputs respond to the inputs
(i.e. its operation).
In a text-based language, the circuit being described must
be given a name.
The input and outputs (sometimes called ports) must be
assigned names and defined according to the nature of the
port.
6
VHDL --
• The mode of a port defines whether it is input, output,
or both.
• The type determines the range of possible values.
• The type refers to the number of bits.
• If the type of input is a single bit, then it can have only two
possible values: 0 and 1.
• If the type of input is 4-bit binary number, it can have any
one of 16 different values (00002-11112).
• The definition of the circuit's operation in a text-based
language is contained in a set of statements that follow the
circuit input/output (I/O) definition.
7
VHDL --
• Example:
8
INTERMEDIATE SIGNALS IN VHDL
9
REPRESENTING DATA IN VHDL
10
TRUTH TABLES USING VHDL
•
11
DECISION CONTROL STRUCTURES
• IF/ELSE:
• Example
Reconsider the example, where four logic-signal lines A, B, C, D are being
used to represent a 4-bit binary number with A as the MSB and D as the LSB.
The binary inputs are fed to a logic circuit that produces a HIGH output only
when the binary number is greater than 01102 =610. Write the VHDL version
12
Cont..
• case:
• Example:-
13
Single-bit full adder
S= A B C;
14
IMPLEMENTING DECODERS
15
IMPLEMENTING MULTIPLEXERS AND
DEMULTIPLEXERS
• Mux 4-1 :
16
Cont..
• Dux 1-4 :
17
IMPLEMENTING MAGNITUDE
COMPARATORS
• comparator :
• If A>B, then indicate that A>B.
• If A<B, then indicate that A<B.
the relationship.
18