A Tutorial Introduction to VHDL Programming Gazi download
A Tutorial Introduction to VHDL Programming Gazi download
download
https://ebookmeta.com/product/a-tutorial-introduction-to-vhdl-
programming-gazi/
https://ebookmeta.com/product/modern-c-programming-including-
standards-c99-c11-c17-c23-1st-edition-gazi/
https://ebookmeta.com/product/eloquent-javascript-3rd-edition-a-
modern-introduction-to-programming-marijn-haverbeke/
https://ebookmeta.com/product/introduction-to-python-
programming-1st-edition-s/
https://ebookmeta.com/product/a-death-in-live-oak-a-jack-swyteck-
novel-19th-edition-grippando/
Media Practices Social Movements and Performativity
Transdisciplinary Approaches 1st Edition Susanne
Foellmer (Editor)
https://ebookmeta.com/product/media-practices-social-movements-
and-performativity-transdisciplinary-approaches-1st-edition-
susanne-foellmer-editor/
https://ebookmeta.com/product/human-anatomy-physiology-
laboratory-manual-making-connections-cat-version-2nd-edition-
catharine-whiting/
https://ebookmeta.com/product/food-security-in-africa-s-
secondary-cities-no-the-oshakati-ongwediva-ondangwa-corridor-
namibia-1st-edition-ndeyapo-nickanor/
https://ebookmeta.com/product/the-long-drop-1st-edition-denise-
mina/
https://ebookmeta.com/product/precalculus-6e-robert-f-blitzer/
Annotated criminal legislation New South Wales 2019
2020 edition Peter A. Johnson
https://ebookmeta.com/product/annotated-criminal-legislation-new-
south-wales-2019-2020-edition-peter-a-johnson/
Orhan Gazi
A Tutorial
Introduction
to VHDL
Programming
A Tutorial Introduction to VHDL Programming
Orhan Gazi
A Tutorial Introduction
to VHDL Programming
123
Orhan Gazi
Department of Electronics and
Communication Engineering
Çankaya University
Ankara, Turkey
This Springer imprint is published by the registered company Springer Nature Singapore Pte Ltd.
The registered company address is: 152 Beach Road, #21-01/04 Gateway East, Singapore 189721,
Singapore
Contents
v
vi Contents
VHDL stands for “very high speed integrated circuits hardware description lan-
guage”, and first developed by the US department of defense in 1980s. It is used to
describe the behavior of an electronic circuit. VHDL programs consist of program
modules. A module is nothing but a program segment written for some specific
purposes. For instance, we have package modules, test modules, and main VHDL
modules, i.e., main programs.
In this chapter, entity and architecture parts of a VHDL program will be
explained in details. Entity part is used to describe the input and output ports of an
electronic circuit, i.e., used to describe I/O ports. On the other hand, architecture
part of a VHDL module is used to describe the operation of the electronic circuit.
During the circuit operation, the circuit process its input data obtained from input
ports, and produces its output data to be sent to the output ports. We will also
discuss the data types used for the ports available in entity part. In addition, VHDL
operators will be explained shortly.
1.1 Entity
Input/Output
Input Electronic
Circuit
Buffer
Internal
Circuit
where ‘[entity] [entity_name]’ means that you can omit or keep words inside
braces. Let’s illustrate the use of entity by an example.
Example 1.1 The black box representation of an electronic circuit is shown in
Fig. 1.2. Describe the electronic circuit ports by a VHDL program, i.e., by PR.
Solution 1.1 We can write the entity part for the black box shown in Fig. 1.2 with
the following steps.
(S1) First, write the reserved word entity as in PR 1.2.
(S3) In step 3, write the reserved word is to the end of the line of PR 1.3 as in PR 1.4.
end my_circuit_name
(S5) In step 5, put a semicolon to the end of the closing tag as in PR 1.6.
end my_circuit_name;
(S9) If we look at the black box in Fig. 1.2, we see that we have two input ports and
three output ports. Let’s give names to these ports as in PR 1.10.
(S10) In step 10, we indicate the type of the ports using the reserved words in and
out as in PR 1.11.
PR 1.11 Program 1.11
entity my_circuit_name is
port( inp1: in
inp2: in
outp1: out
outp2: out
outp3: out );
end my_circuit_name;
(S11) In Step 11, we indicate the data type available at the input and output ports an
in PR 1.12 where we used std_logic for all port data types.
(S12) In step 12, we put semicolon to the end of every std_logic except for the last
one as in PR 1.13.
The enclosing tag or enclosing line of the program segment in PR 1.13 can also
be written as in PR 1.14. We can also write the enclosing line as “end entity
my_circuit_name”.
entity my_circuit_name is
port( inp1: in std_logic;
inp2: in std_logic;
outp1: out std_logic;
outp2: out std_logic;
outp3: out std_logic );
end my circuit name;
(S12) Finally, we can add some comments to our VHDL code. For this purpose,
we can use
Your comment here
entity my_circuit_name is
port( inp1: in std_logic; --Input port
inp2: in std_logic; --Input port
outp1: out std_logic; --Output port
outp2: out std_logic; --Output port
outp3: out std_logic ); --Output port
end my_circuit_name; -- End of entity
entity my_circuit_name is
port( inp1, inp2: in std_logic; --Input ports
outp1, outp2, outp3: out std_logic ); --Output ports
end my_circuit_name; -- End of entity
In this section, we will give information about the data types used in VHDL
programming.
std_logic
In PR 1.17 the data type used for the ports is std_logic defined in the package IEEE.
std_logic_1164.all. For std_logic data type, there are 8 possible values available,
and these values are tabulated in Table 1.1.
std_logic_vector
The std_logic_vector data type is defined in the library IEEE.std_logic_1164.all. If
an I/O port has data type of std_logic_vector, it means that the I/O port has a
number of std_logic values.
std_ulogic
The data type std_ulogic is defined in the package IEEE.std_logic_1164.all. For
std_ulogic data type, there are 9 possible values available, and these values are
tabulated in Table 1.2.
std_ulogic_vector
The std_ulogic_vector data type is defined in the library IEEE.std_logic_1164.all.
If an I/O port has data type of std_ulogic_vector, it means that the I/O port has a
number of std_ulogic values.
1.2 The Data Types Used in Input/Output Ports 7
bit
The bit data type is defined in standard package, i.e., we don’t need to include an
extra package at the header of the VHDL program. For instance, if we use data type
bit for port I/Os, we can write PR 1.17 as in PR 1.18 where it is seen that no header
file is needed.
entity my_circuit_name is
port( inp1: in bit;
inp2: in bit;
outp1: out bit;
outp2: out bit;
outp3: out bit);
end my_circuit_name;
bit_vector
The bit_vector data type is defined in standard package, i.e., we don’t need to
include an extra package at the header of the VHDL program. If an I/O port has data
type of bit_vector, it means that the I/O port has a number of bit values.
integer, natural, positive
The data types integer, natural, positive are defined in standard package, i.e., we
don’t need to include an extra package at the header of the VHDL program. The
data type integer is used to represent integer numbers in the range 231 to 231 1.
The data type natural is used to represent the integers in the range 0 to 231 1. On
the other hand, the data type positive is used to represent the integers in the range 1
to 231 1.
unsigned, signed
The data types unsigned and signed are defined in the packages numeric_std and
std_logic_arith. One of these packages should be included in the header of the
VHDL program to be able to use these data types in entity declarations. The data
type unsigned is used to represent unsigned numbers, i.e., nonnegative integers,
and the data type signed is used to represent the signed numbers, i.e., integers.
An electronic circuit with a number of ports which consists of a number of bits
can be expressed with a number of equivalent ways. Let’s illustrate this concept
with an example.
Example 1.2 The black box representation of an electronic circuit is shown in
Fig. 1.3. Describe the electronic circuit ports by a VHDL program.
8 1 Entity, Architecture and VHDL Operators
(a) Use the data type std_logic_vector to describe the ports in entity part.
(b) Use the data type bit_vector to describe the ports in entity part.
(c) Use the data type integer to describe the ports in entity part.
(d) Use the data type natural to describe the ports in entity part.
(e) Use the data type positive to describe the ports in entity part.
(f) Use the data type unsigned to describe the ports in entity part.
(g) Use the data type signed to describe the ports in entity part.
Solution 1.2 Let’s solve the part-a in details, and follow the same approach for the
other parts in short.
In Fig. 1.3, the number of bits available at the ports is indicated, however, the
type of the data available at the ports is not clarified. For this reason, we can employ
all the data types mentioned in the question to represent the bits. Otherwise, con-
sidering the type of the data available at the ports, we would select the suitable
VHDL data type representation in our VHDL program. Now let’s proceed with the
solution of part-a.
(a) We can write the entity part for the black box as shown in Fig. 1.3 with the
following steps.
(S1) First, write the reserved word entity as in PR 1.19.
(S3) In step 3, write the reserved word is to the end of the line of PR 1.20 as in PR
1.21.
end FourBit_Circuit
Exploring the Variety of Random
Documents with Different Content
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.