# CHAPTER 10 Introduction to VHDL - PowerPoint PPT Presentation

PPT – CHAPTER 10 Introduction to VHDL PowerPoint presentation | free to download - id: 82467b-MmUwZ

The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
Title:

## CHAPTER 10 Introduction to VHDL

Description:

### CHAPTER 10 Introduction to VHDL 10.1 VHDL Description of Combinational Circuits 10.2 VHDL Models for Multiplexers 10.3 VHDL Modules 10.4 Signals and Constants – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 38
Provided by: cale88
Category:
Tags:
Transcript and Presenter's Notes

Title: CHAPTER 10 Introduction to VHDL

1

CHAPTER 10 Introduction to VHDL
10.1 VHDL Description of Combinational
Circuits 10.2 VHDL Models for Multiplexers 10.3 VH
DL Modules 10.4 Signals and Constants 10.5 Arrays
10.6 VHDL Operators 10.7 Packages and
Libraries 10.8 IEEE Standard Logic 10.9
Compilation and Simulation of VHDL Code
2
Objectives
• Represent gates and combinational logic by
concurrent VHDL statements.
• 2. Given a set of concurrent VHDL statements,
draw the corresponding
• combinational logic circuit,
• 3. Write a VHDL module for a combinational
circuit.
• 4. Compile and simulate a VHDL module.
• 5. Use the basic VHDL operators and understand
their order of precedence.
• 6. Use the VHDL types bit, bit_vector, Boolean,
and integer.
• Define and use an array-type.
• 7. Use IEEE Standard Logic. Use
• operators, to perform arithmetic operations.

3
Introduction to VHDL
Hardware Description Language(HDL) allows a
digital system to be designed and debugged at a
higher level before implementation VHDL,
Verilog VHDL VHSIC(Very High Speed IC)
Hardware Description Language Behavior Level,
Data Flow Level, Structural Level
4
10.1 VHDL Description of Combinational Circuits
Fig 10-1. Gate Circuit
Concurrent statement order is not important
CltA and B EltC or D
EltC or D CltA and B
signal_nameltexpression after delay
5
10.1 VHDL Description of Combinational Circuits
Fig 10-2. Inverter with Feedback
CLKlt not CLK ?Not allowed (run time error)
Clklt NOT clk After 10 NS and CLKltnot CLK after
10 ns
6
10.1 VHDL Description of Combinational Circuits
Fig 10-3. Three Gates with a Common Input and
Different Delays
7
10.1 VHDL Description of Combinational Circuits
Fig 10-4. Array of AND Gates
8
10.2 VHDL Models for Multiplexers
Flt (not A and I0) or (A and I1)
Fig 10-5. 2-to-1 Multiplexer
Conditional Signal Assignment
signal_nameltexpression1 when condition1 else
expression2 when condition2 else expressionN
9
10.2 VHDL Models for Multiplexers
Flt (not A and not B and I0) or (not A and B and
l1) or (A and not B and I2) or (A and B
and l3)
10
10.2 VHDL Models for Multiplexers
Flt l0 when AB 00 else l1 when AB
01 else l2 when AB 10 else l3
Flt l0 when A 0 and B 0 else l1 when A
0 and B 1 else l2 when A 1 and B
0 else l3
Fig 10-7. 4-to-1 Multiplexer
Selected Signal Assignment Statement
11
10.2 VHDL Models for Multiplexers
Selected Signal Assignment Statement
with expression_s select signal_slt
expression1 after delay-time when choice1,
expression2 after delay-time when
choice2,
expression_n after delay-time when others
12
10.3 VHDL Modules
Fig 10-8. VHDL Module with Two Gates
entity entity-name is port(interface-signaldec
laration) end entityentity-name
13
10.3 VHDL Modules
Figure 10-9. VHDL Program Structure
Interface signal declaration
list-of-interface-signals mode type
initial-value list-of-interface-signals
mode type initial-value
Port declaration
port(A,B in integer 2 C,D out bit)
14
10.3 VHDL Modules
Architecture declaration
architecture architecture-name of entity-name is
declarations begin architecture body end
architecture architecture-name
Fig 10-10. Entity Declaration for a Full Adder
Module
15
10.3 VHDL Modules
architecture Equations of FullAdder is begin
--concurrent assignment statements SumltX
xor Y xor Cin after 10 ns Coutlt(X and Y) or
(X and Cin) or (Y and Cin) after 10 ns end
Equations
16
10.3 VHDL Modules
Fig 10-12. Structural Description of 4-Bit Adder
Instantiate four copies of full adder
17
10.3 VHDL Modules
add list A B Co C Ci S -- put these
signals on the output list force A 1111
-- set the A inputs to 1111 force B
0001 -- set the B inputs to
0001 force Ci 1 -- set
Ci to 1 run 50 ns --
run the simulation for 50 ns force Ci 0 force A
0101 force B 1110 run 50 ns
18
10.3 VHDL Modules
ns delta a b co c ci s
0 0 0000 0000 0 000 0 0000 0 1 1111 0001 0 000 1 0000 10 0 1111 0001 0 001 1 1111 20 0 1111 0001 0 011 1 1101 30 0 1111 0001 0 111 1 1001 40 0 1111 0001 1 111 1 0001 50 0 0101 1110 1 111 0 0001 60 0 0101 1110 1 110 0 0101 70 0 0101 1110 1 100 0 0111 80 0 0101 1110 1 100 0 0011
19
10.3 VHDL Modules
20
10.3 VHDL Modules
1111000110001 with a carry of 1 (at time 40
ns) and 0101111000011 with a carry of 1 (at
time 80 ns).
21
10.3 VHDL Modules- Component
Components are within architecture and declared
at the beginning of the architecture
component component-name port
(list-of-interface-signals-and-their-types) end
component
label component-name port map (list-of-actual-sig
nals)
22
10.4 Signals and Constants
signal list_of_signal_names type_name
constraint initial_value
signal A,B,C bit_vector(3 downto 0) 1111
signal E,F integer range 0 to 15
constant constant_name type_name constraint
constant_value
constant limit integer 17
constant delay1 time 5 ns
AltB after delay1
23
10.4 Signals and Constants
Definition
bit 0 or 1 boolean FALSE or
TRUE integer an integer in the range ( -1)
to ( -1) (some
implementations support a wider range) positive
an integer in the range 1 to 1 (positive
integers) natural an integer in the range 0
to 1 (positive integers and zero) real
floating-point number in the range 1.0E38 to
1.0E38 character any legal VHDL character
including upper- and lower case letters,
digits, and special characters
each printable character must be
enclosed in single quotes, e.g.,d,7, time
an integer with units fs, ps, ns, us, ms,
sec, min, or hr
24
10.4 Signals and Constants
type state_type is (S0,S1,S2,S3,S4,S5) signal
state state_type S1
state lt S3
25
10.5 Arrays
type SHORT_WORK is array (15 downto 0) of bit
signal DATA_WORD SHORT_WORK signal ALT_WORK
SHORT_WORD 0101010101010101 constant
ONE_WORD SHORT_WORD (others gt1)
26
10.5 Arrays
1 4 2 3
1 4 5 6
7 8 9
10 11 12
type array_type_name is array index_range of
element_type signal array_name
array_type_name initial_values
type matrix4x3 is array (1 to 4, 1 to 3) of
integer signal matrixA matrix4x3
(1,2,3),(4,5,6,),(7,8,9),(10,11,12))
type intvec is array (natural range ltgt) of
integer
signal intvec5 intvec(1 to 5) (3,2,6,8,1)
type matrix is array (natural range ltgt, natural
range ltgt) of integer
27
10.5 Arrays
type bit_vector is array (natural range ltgt) of
bit type string is array (positive range ltgt) of
character
constant string1 string(1 to 29) This
string is 29 characters.
constant A bit_vector(0 to 5) 101011
Fig 10-13. VHDL Description of a ROM
28
10.6 VHDL Operators
VHDL Operators
1. binary logical operators and or nand nor xor
xnor
2. relational operators / lt lt gt gt
3. shift operators sll srl sla sra rol ror
5. unary sign operators -
6. multiplying operators / mod rem
7. miscellaneous operators not abs

- Parentheses change the precedence order of
evaluation
not A or B and not C D
((not A) or B) and ((not) C D)
(AgtB) and (BltC) evaluates to FALSE
If A5, B4, C3,
29
10.6 VHDL Operators
Fig 10-14. Comparator for Integers
A sll 2 is 01010100 (shift left logical, filled
with 0) A srl 3 is 00010010 (shift right
logical, fileed with 0) A sla 3 is 10101111
(shift left arithmetic, filled with rightmost
bit) A sra 2 is 11100101 (shift right
arithmetic, filled with leftmost bit) A rol 3 is
10101100 (rotate left) A ror 5 is 10101100
(rotate right)
A(7)A(7)A(7 downto 2) 111000101
11100101
- Shift right operation
30
10.7 Packages and Libraries
Optional package body
Package declaration
package body package-name is package
delarations end package bodypackage-name
package package-name is package
delarations end packagepackage-name
Bit_pack package has a NOR2 gate (inside CD-ROM
attached)
component Nor2 port (A1,A2 in bit Z out
bit) end component
--2-input NOR gate entity Nor2 is port (A1,A2
in bit Z out bit) end Nor2 architecture
concur of Nor2 is begin Zltnot(A1 or A2) after
10ns end concur
31
10.7 Packages and Libraries
To access components and functions within a
package,
libraray BITLIB
Use BITLIB.bit_pack.all
Use BITLIB.bit_pack.Nor2
Fig 10-15. NOR-NOR Circuit and Structural VHDL
Code Using Library Components
32
10.8 IEEE Standard Logic
IEEE standard 1164 defines a std_logic type of
nine values(U, X, 0, 1, Z,W,L,H, -)
Fig 10-16. Tri-state Buffer
Fig 10-17. Tri-state Buffers Driving a Bus
33
10.8 IEEE Standard Logic
Fig 10-18. Resolution Function for Two Signals
FltA Flt not B
library ieee use ieee.std_logic_1164.all
34
10.8 IEEE Standard Logic
Figure 10-19. VHDL Code for Binary Adder
35
10.8 IEEE Standard Logic
Figure 10-20. VHDL Code for Bi-Directional I/O Pin
36
10.9 Compilation and Simulation of VHDL Code
Fig 10-21. Compilation, Simulation, and Synthesis
of VHDL Code
37
10.9 Compilation and Simulation of VHDL Code
Fig 10-22. Simulation of VHDL Code
ns delta A B C D
0 0 3 0 3 1 3 2 8 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 0 1 0