Vansh Tomar - 035 - Training Report VHDL - ECE 3
Vansh Tomar - 035 - Training Report VHDL - ECE 3
Vansh Tomar - 035 - Training Report VHDL - ECE 3
B.Tech.
in
Vansh Tomar
ECE-3
03576802818
rajachoudhary697@gmail.com
To
Declaration
This is to certify that Thesis/Report entitled “Digital System Design using VHDL”
which is submitted by me in partial fulfilment of the requirement for the award of
degree B.Tech./MTech. in Electronics and Communications Engineering to Guru
Tegh Bahadur Institute of Technology, Delhi (affiliated GGSIPU) comprises only
my original work and due acknowledgement has been made in the text to all other
material used.
Date: 19 June 2020
Name of Student: Vansh Tomar (03576802818)
APPROVED BY: -
Dean/Director
Guru Tegh Bahadur Institute of
Technology
Vansh Tomar | ECE 3 | 03576802818
Certificate
Vansh Tomar | ECE 3 | 03576802818
Acknowldegment
I take this opportunity to express my profound gratitude and deep regards to my guide
(Mr.Mukesh Sahu) for their exemplary guidance, monitoring and constant
encouragement throughout the course of this report. The blessing, help and guidance
given by them time to time shall carry me a long way in the journey of life on which I
am about to embark.I also take this opportunity to express a deep sense of gratitude
to my batchmates for valuable information and guidance, which helped me in
completing this task through various stages.
I am grateful for their cooperation during the periodof my assignment.
Lastly, I thank almighty, my parents and friends for their constant encouragement
without whichthis assignment would not be possible.
Vansh Tomar | ECE 3 | 03576802818
Contents
Introduction ........................................................................................................................ 8
1.2 History ........................................................................................................................ 8
1.3 Capabilities ................................................................................................................. 9
2. A Tutorial ................................................................................................................... 11
2.1 Basic Terminology ................................................................................................... 11
2.1.2 Architecture ............................................................................................................. 12
2.2 Levels of Abstraction.................................................................................................. 14
2.2.1 Behavioral Modeling……………………………………………………………………………………………11
2.5 Simulation................................................................................................................. 20
3. Basic Language Elements............................................................................................ 21
3.1. Lexical Elements…………………………………………………………………………………………………….17
3.1.1. Comments……………………………………………………………………………………………………...…17
3.1.2. Identifiers………………………………………………………………………………………………………….17
3.1.3. Numbers……………………………………………………………………………………………………………17
3.1.4. Characters…………………………………………………………………………………………………………17
3.1.5. Strings…………………………………………………………………………………………………………….…17
VHDL Projects
Conclusion
Future Aspect
Refrences
Vansh Tomar | ECE 3 | 03576802818
Preface
VHDL is a hardware description language that can be used to model a digital system.
It contains elements that can be used to describe the behavior or structure of the digital
system, with the provision for specifying its timing explicitly. The language provides support
for modeling the system hierarchically and also supports top-down and bottom-up design
methodologies. The system and its subsystems can be described at any level of abstraction
ranging from the architecture level to gate level. Precise simulation semantics are associated
with all the language constructs, and therefore, models written in this language can be
verified using a VHDL simulator.
VHDL is a large and verbose language with many complex constructs that have
complex semantic meanings and is difficult to understand initially (VHDL is often quoted to
be an acronym for Very Hard Description Language). However, it is possible to quickly
understand a subset of VHDL which is both simple and easy to use. The emphasis of this text
is on presenting this set of simple and commonly used features of the language so that the
reader can start writing models in VHDL. These features are powerful enough to be able to
model designs of large degrees of complexity.
Vansh Tomar | ECE 3 | 03576802818
Introduction
Therefore, the language has constructs that enable you to express the concurrent or sequential
behavior of a digital system with or without timing. It also allows you to model the system as an
interconnection of components. Test waveforms can also be generated using the same
constructs. All the above constructs may be combined to provide a comprehensive description
of the system in a single model.
The language not only defines the syntax but also defines very clear simulation
semantics for each language construct. Therefore, models written in this language can be
verified using a VHDL simulator. It is a strongly typed language and is often verbose to write. It
inherits many of its features, especially the sequential language part, from the Ada programming
language. Because VHDL provides an extensive range of modeling capabilities, it is often
difficult to understand. Fortunately, it is possible to quickly assimilate a core subset of the
language that is both easy and simple to understand without learning the more complex features.
This subset is usually sufficient to model most applications. The complete language, however,
has sufficient power to capture the descriptions of the most complex chips to a complete
electronic system.
1.2 History
The requirements for the language were first generated in 1981 under the VHSIC program. In
this program, a number of U.S. companies were involved in designing VHSIC chips for the
Department of Defense (DoD). At that time, most of the companies were using different
hardware description languages to describe and develop their integrated circuits. As a result,
different vendors could not effectively exchange designs with one another. Also, different
vendors provided DoD with descriptions of their chips in different hardware description
languages. Reprocurement and reuse was also a big issue. Thus, a need for a standardized
hardware description language for design, documentation, and verification of digital systems
was generated.
A team of three companies, IBM, Texas Instruments, and Intermetrics, were first
awarded the contract by the DOD to develop a version of the language in 1983. Version 7.2 of
Vansh Tomar | ECE 3 | 03576802818
VHDL was developed and released to the public in 1985. There was a strong industry
participation throughout the VHDL language development process, especially from the
companies that were developing VHSIC chips. After the release of version 7.2, there was an
increasing need to make the language an industry-wide standard. Consequently, the language
was transferred to the IEEE for standardization in 1986. After a substantial enhancement to the
language, made by a team of industry, university, and DoD representatives, the language was
standardized by the IEEE in December 1987; this version of the language is now known as the
IEEE Std 1076-1987. The official language description appears in the IEEE Standard VHDL
Language Reference Manual made available by the IEEE. The language described in this book
is based on this standard. The language has since also been recognized as an American National
Standards Institute (ANSI) standard.
The Department of Defense, since September 1988, requires all its digital Application-
Specific Integrated Circuit (ASIC) suppliers to deliver VHDL descriptions of the ASICs and
their subcomponents, at both the behavioral and structural levels. Test benches that are used to
validate the ASIC chip at all levels in its hierarchy must also be delivered in VHDL. This set of
government requirements is described in military standard 454.
1.3 Capabilities
The following are the major capabilities that the language provides along with the features that
differentiate it from other hardware description languages.
• The language can be used as an exchange medium between chip vendors and CAD tool
users. Different chip vendors can provide VHDL descriptions of their components to
system designers. CAD tool users can use it to capture the behavior of the design at a
high level of abstraction for functional simulation.
• The language can also be used as a communication medium between different CAD and
CAE tools, for example, a schematic capture program may be used to generate a VHDL
description for the design which can be used as an input to a simulation program.
• The language supports hierarchy, that is, a digital system can be modeled as a set of
interconnected components; each component, in turn, can be modeled as a set of
interconnected subcomponents.
• The language supportsflexible design methodologies: top-down, bottom-up, or mixed.
• The language is not technology-specific, but is capable of supporting technology-
specific features. It can also support various hardware technologies, for example, you
may define new logic types and new components, you may also specify technology-
specific attributes. By being technology independent, the same behavior model can. be
synthesized into different vendor libraries.
• It supports both synchronous and asynchronous timing models.
• Various digital modeling techniques such as finite-state machine descriptions,
algorithmic descriptions, and boolean equations can be modeled using the language.
• The language is publicly available, human readable, machine readable, and above all, it
is not proprietary.
• It is an IEEE and ANSI standard, and therefore, models described using this language
are portable. The government also has a strong interest in maintaining this as a standard
so that re-procurement and second-sourcing may become easier.
• The language supports three basic different description styles: structural, dataflow, and
behavioral. A design may also be expressed in any combination of these three
descriptive styles.
Vansh Tomar | ECE 3 | 03576802818
2. A Tutorial
2.1 Basic Terminology
VHDL is a hardware description language that can be used to model a digital system. The digital
system can be as simple as a logic gate or as complex as a complete electronic system. A
hardware abstraction of this digital system is called an entity in this text. An entity X, when used
in another entity Y, becomes a component for the entity Y. Therefore, a component is also an
entity, depending on the level at which you are trying to model.
To describe an entity, VHDL provides five different types of primary constructs, called
design units.
They are
1. Entity declaration
2. Architecture body
3. Configuration declaration
4. Package declaration
5. Package body
2.1.1 Entity
We elaborated top-down design methodology in chapter one and stated that the main design idea
has to be broken down into smaller modules. These abstract blocks are called components that can
be designed individually and they can be put together using bottom-up method and constitute the
main design. In this case each one of the blocks can be treated as an entity. An entity is a black
box with declaration of inputs and output
which defines a full adder with three input ports and two output ports. Each design must
have at least one entity and one corresponding architecture that specifies the external
specification of the design. Each entity has a names assigned to it along with a port list.
Each port has a name, direction and type.
Vansh Tomar | ECE 3 | 03576802818
2.1.2 Architecture
An architecture statement defines the structure or description of a design and is bounded
with an entity. The syntax for VHDL architecture is as follows. As you see the
architecture is bounded with the entity that was defined before. VHDL allows an entity to
have multiple architectures. Since architecture describes what is inside an entity, it can be
written in different ways by different designers. Some prefer dataflow while the others
may prefer the structural method for a design. Architecture has two parts. The first part is
between the keywords architecture and begin which is the declaration part. In this section
you can define the interconnection signals, other components referenced by this
architecture, or constants. The second part starts after the keyword begin that includes the
statements and assignments and structure of the design. The following piece of code
describes the architecture of the above entity.
2.1.3 Configuration
In the previous section we stated that an entity can have multiple architectures. The configuration
statement specifies which entity is to be bounded to which architecture. This allows you to switch
between different architectures for an entity in a design. The following is an example of a
configuration statement. In this example we bound the above pair of entity-architecture.
2.1.4 Package
It could be very tedious to repeat the declarations every time you need them. As a programmer
you want to be able to use a piece of code over and over once you write it to save time and
resources. Package provides this flexibility in VHDL and is used to store frequently used
declarations among different design units. Package may be used in its simplest form to declare
components, constants, global variables, or global functions which can be made visible not only
for the current design but also for any other design units that reference the package. A package can
Vansh Tomar | ECE 3 | 03576802818
be accessed using the use statement, which will be explained later. A package can be identified
using the keyword package. The following is an example of a package.
As an example of these four levels of abstraction, consider a simple BCD counter. It is possible to
describe the counter in a number of ways. At the lowest level of abstraction (layout level), we
could use the layout of transistors and build gates and flip flops out of them and connect them so
as logic function can be satisfied. At the next level (logic or structural) counter can be specified as
a sequence of predefined logic gates and flip-flips to form the complete circuit. To describe this
same circuit at a dataflow or RTL level of abstraction, we might describe the combinational logic
portion of the counter (its decoding portion) using higher-level Boolean logic functions and then
feed the output of that logic into a set of registers. At the behavioral level of abstraction, regardless
of target technology we just define the behavior of the system using human language. In this case
this could be as “This counter counts from 0 to 9 and rolls over after it reaches the highest count
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
declares IEEE library which is a library that includes conversion functions, useful types, etc.
library std_logic_1164;
declares IEEE 1164 standard library
Vansh Tomar | ECE 3 | 03576802818
library LSI_1100;
declares LSI ASIC library
The code starts with necessary library declarations and is followed by entity and architecture
declarations. The entity part defines the design as a black box with inputs and outputs. The
architecture part defines the interrelation of these inputs and outputs. In fact architecture specifies
what is inside the black box. The architecture part is divided into two sections: declaration and
instantiation part. Declaration part is between the keywords architecture and begin. Here, all the
signals, components, constants, variables, … must be declared. In our example, carry_int signal is
Vansh Tomar | ECE 3 | 03576802818
defined to handle interconnection between the single bit full adders. Also the single bit full adder
is defined as a component. The instantiation part starts after the keyword begin. Four instances of
the full adder are constructed and using the port map statements they are connected together. Note
that full adder instantiations are concurrent statements and order does not matter. These are the
statements that are executed in parallel and operate asynchronously. Concurrent statements are
versus sequential statements that are executed sequentially upon the flow of the program. We will
see this concept in near future.
2.5 Simulation
Once the model description is successfully compiled into one or more design libraries, the next
step in the validation process is simulation. For a hierarchical entity to be simulated, all of its
lowest level components must be described at the behavioral level.
A simulation can be performed on either one of the following:
• Anentity declaration and an architecture body pair,
• A configuration.
Preceding the actual simulation are two major steps:
1. Elaboration phase: In this phase, the hierarchy of the entity is expanded and
linked, components are bound to entities in a library and the top-level entity is
built as a network of behavioral models that is ready to be simulated. Also,
storage is allocated for all data objects (signals, variables, and constants)
declared in the design units. Initial values are also assigned to these objects.
2. Initialization phase: The effective values for all explicitly declared signals are
computed, implicit signals (discussed in later chapters) are assigned values,
processes are executed once until they suspend, and simulation time is reset to
0 ns.
Simulation commences by advancing time to that of the next event. Values that are
scheduled to be assigned to signals at this time are assigned. Each process that has a signal in its
sensitivity list whose value just changed, is executed until it suspends. Simulation stops when a
user-specified time limit is reached, or when an assertion violation occurs, depending on the
implementation of the VHDL system (assertion statements are discussed in Chap. 4), or when
the maximum time as defined by the language is reached.
Vansh Tomar | ECE 3 | 03576802818
3.1.2. Identifiers
Identifiers in VHDL are used as reserved words and as programmer defined names. They must
conform to the rule:
identifier ::= letter { [ underline ] letter_or_digit }
Note that case of letters is not considered significant, so the identifiers cat and Cat are the same.
Underline characters in identifiers are significant, so This_Name and ThisName are different
identifiers.
3.1.3. Numbers
Literal numbers may be expressed either in decimal or in a base between two and sixteen. If the
literal includes a point, it represents a real number, otherwise it represents an integer. Decimal
literals are defined by:
decimal_literal ::= integer [ . integer ] [ exponent ]
integer ::= digit { [ underline ] digit }
exponent ::= E [ + ] integer | E - integer
Based literal numbers are defined by:
3.1.4. Characters
Literal characters are formed by enclosing an ASCII character in single-quote marks. For example:
'A' '*' ''' ' '
Vansh Tomar | ECE 3 | 03576802818
3.1.5. Strings
Literal strings of characters are formed by enclosing the characters in double-quote marks. To
include a double-quote mark itself in a string, a pair of double-quote marks must be put together.
A string can be used as a value for an object which is an array of characters. Examples of strings:
"A string" "" -- empty string "A string in a string: ""A string"". " -- contains quote marks
The expressions that specify the range must of course evaluate to integer numbers. Types declared
with the keyword to are called ascending ranges, and those declared with the keyword downto are
called descending ranges. The VHDL standard allows an implementation to restrict the range, but
requires that it must at least allow the range –2147483647 to +2147483647.
Some examples of integer type declarations:
type byte_int is range 0 to 255;
type signed_word_int is range –32768 to 32767; type
bit_index is range 31 downto 0;
There is a predefined integer type called integer. The range of this type is implementation
defined, though it is guaranteed to include –2147483647 to +2147483647.
end units;
To write a value of some physical type, you write the number followed by the unit. For example:
10 mm 1 rod 1200 ohm 23 ns
3.2.5. Arrays
An array in VHDL is an indexed collection of elements all of the same type. Arrays may be
one-dimensional (with one index) or multidimensional (with a number of indices). In addition, an
array type may be constrained, in which the bounds for an index are established when the type is
defined, or unconstrained, in which the bounds are established subsequently.
The syntax for declaring an array type is:
array_type_definition ::= unconstrained_array_definition |
constrained_array_definition
unconstrained_array_definition ::= array ( index_subtype_definition { ,
index_subtype_definition } ) of elem ent_subtype_indication
constrained_array_definition ::= array index_constraint of elem
ent_subtype_indication
index_subtype_definition ::= type_mark range <> index_constraint
::= ( discrete_range { , discrete_range } ) discrete_range ::=
discrete_subtype_indication | range
The types positive and natural are subtypes of integer, defined in Section2.2.7 below. The type
bit_vector is particularly useful in modeling binary coded representations of values in simulations
of digital systems.
An element of an array object can referred to by indexing the name of the object. For example,
suppose a and b are one- and two-dimensional array objects respectively. Then the indexed names
a(1) and b(1, 1) refer to elements of these arrays. Furthermore, a contiguous slice of a
onedimensional array can be referred to by using a range as an index. For example a(8 to 15) is an
eight-element array which is part of the array a.
Sometimes you may need to write a literal value of an array type. This can be done using an
array aggregate, which is a list of element values. Suppose we have an array type declared as:
type a is array (1 to 4) of character;
and we want to write a value of this type containing the elements 'f', 'o', 'o', 'd' in that order. We could
write an aggregate with positional association as follows:
('f', 'o', 'o', 'd')
in which the elements are listed in the order of the index range, starting with the left bound of the
range. Alternatively, we could write an aggregate with nam ed association:
(1 => 'f', 3 => 'o', 4 => 'd', 2 => 'o')
In this case, the index for each element is explicitly given, so the elements can be in any order.
Positional and named association can be mixed within an aggregate, provided all the positional
associations come first. Also, the word others can be used in place of an index in a named
association, indicating a value to be used for all elements not explicitly mentioned. For example, the
same value as above could be written as:
('f', 4 => 'd', others => 'o')
3.2.6. Records
VHDL provides basic facilities for records, which are collections of named elements of possibly
different types. The syntax for declaring record types is:
record_type_definition ::= record
element_declaration
{ element_declaration } end
record
element_declaration ::= identifier_list : element_subtype_definition ;
identifier_list ::= identifier { , identifier ) element_subtype_definition ::=
subtype_indication An example record type declaration:
type instruction is record op_code :
processor_op; address_mode :
mode;
operand1, operand2: integer range 0 to 15;
end record;
When you need to refer to a field of a record object, you use a selected name. For example,
suppose that r is a record object containing a field called f. Then the name r.f refers to that field.
As for arrays, aggregates can be used to write literal values for records. Both positional and
named association can be used, and the same rules apply, with record field names being used in place
of array index names.
Vansh Tomar | ECE 3 | 03576802818
3.2.7. Subtypes
The use of a subtype allows the values taken on by an object to be restricted or constrained subset
of some base type. The syntax for declaring a subtype is:
subtype_declaration ::= subtype identifier is subtype_indication ; subtype_indication ::=
[ resolution_function_name ] type_mark [ constraint ] type_mark ::= type_name |
subtype_name constraint ::= range_constraint | index_constraint
There are two cases of subtypes. Firstly a subtype may constrain values from a scalar type to be
within a specified range (a range constraint). For example:
subtype pin_count is integer range 0 to 400; subtype digits is
character range '0' to '9';
Secondly, a subtype may constrain an otherwise unconstrained array type by specifying bounds
for the indices. For example:
subtype id is string(1 to 20); subtype word is
bit_vector(31 downto 0);
There are two predefined numeric subtypes, defined as:
subtype natural is integer range 0 to highest_integer subtype positive
is integer range 1 to highest_integer
type, the default value is the composition of the default values for each element, based on the element
types.
Some examples of variable declarations:
variable count : natural := 0; variable trace
: trace_array;
Assuming the type trace_array is an array of boolean, then the initial value of the variable trace is an
array with all elements having the value false.
Given an existing object, it is possible to give an alternate name to the object or part of it. This is
done using and alias declaration. The syntax is:
alias_declaration ::= alias identifier : subtype_indication is name ; A reference to an
alias is interpreted as a reference to the object or part corresponding to the alias. For example:
variable instr : bit_vector(31 downto 0);
alias op_code : bit_vector(7 downto 0) is instr(31 downto 24);
declares the name op_code to be an alias for the left-most eight bits of instr.
Expressions in VHDL are much like expressions in other programming languages. An expression
is a formula combining primaries with operators. Primaries include names of objects, literals,
function calls and parenthesized expressions. Operators are listed in Table 2-1 in order of decreasing
precedence.
The logical operators and, or, nand, nor, xor and not operate on values of type bit or boolean, and
also on one-dimensional arrays of these types. For array operands, the operation is applied between
corresponding elements of each array, yielding an array of the same length as the result. For bit and
Highest precedence: ** abs not
* / mod rem
+ (sign) – (sign)
+ – &
= /= < <= > >=
Lowest precedence: and or nand nor xor
Table 7-1. Operators and precedence.
boolean operands, and, or, nand, and nor are ‘short-circuit’ operators, that is they only evaluate their
right operand if the left operand does not determine the result. So and and nand only evaluate the
right operand if the left operand is true or '1', and or and nor only evaluate the right operand if the
left operand is false or '0'.
The relational operators =, /=, <, <=, > and >= must have both operands of the same type, and
yield boolean results. The equality operators (= and /=) can have operands of any type. For
composite types, two values are equal if all of their corresponding elements are equal. The remaining
operators must have operands which are scalar types or one-dimensional arrays of discrete types.
Vansh Tomar | ECE 3 | 03576802818
The sign operators (+ and –) and the addition (+) and subtraction (–) operators have their usual
meaning on numeric operands. The concatenation operator (&) operates on one-dimensional arrays
to form a new array with the contents of the right operand following the contents of the left operand.
It can also concatenate a single new element to an array, or two individual elements to form an array.
The concatenation operator is most commonly used with strings.
The multiplication (*) and division (/) operators work on integer, floating point and physical types
types. The modulus (mod) and remainder (rem) operators only work on integer types. The absolute
value (abs) operator works on any numeric type. Finally, the exponentiation (**) operator can have
an integer or floating point left operand, but must have an integer right operand. A negative right
operand is only allowed if the left operand is a floating point number.
In the simplest case, the target of the assignment is an object name, and the value of the expression
is given to the named object. The object and the value must have the same base type.
If the target of the assignment is an aggregate, then the elements listed must be object names,
and the value of the expression must be a composite value of the same type as the aggregate.
Firstly, all the names in the aggregate are evaluated, then the expression is evaluated, and lastly the
components of the expression value are assigned to the named variables. This is effectively a
parallel assignment. For example, if a variable r is a record with two fields a and b, then they could
be exchanged by writing
(a => r.b, b => r.a) := r
(Note that this is an example to illustrate how such an assignment works; it is not an example of good
programming practice!)
3.4.2. If Statement
The if statement allows selection of statements to execute depending on one or more conditions.
The syntax is:
if_statement ::= if condition then
sequence_of_statements
{ elsif condition then sequence_of_statements }
[ else
sequence_of_statements ]
end if ;
Vansh Tomar | ECE 3 | 03576802818
The conditions are expressions resulting in boolean values. The conditions are evaluated
successively until one found that yields the value true. In that case the corresponding statement list is
executed. Otherwise, if the else clause is present, its statement list is executed.
If the loop label is omitted, the statement applies to the inner-most enclosing loop, otherwise it applies
to the named loop. If the when clause is present but the condition is false, the iteration continues
normally. Some examples:
for i in 1 to max_str_len loop a(i) :=
buf(i);
exit when buf(i) = NUL;
end loop; outer_loop : loop inner_loop : loop
do_something; next outer_loop when temp =
0; do_something_else;
end loop inner_loop;
end loop outer_loop;
3.4.6. Assertions
An assertion statement is used to verify a specified condition and to report if the condition is
violated. The syntax is:
assertion_statement ::= assert
condition
[ report expression ]
[ severity expression ] ;
If the report clause is present, the result of the expression must be a string. This is a message which
will be reported if the condition is false. If it is omitted, the default message is "Assertion violation".
If the severity clause is present the expression must be of the type severity_level. If it is omitted, the
default is error. A simulator may terminate execution if an assertion violation occurs and the severity
value is greater than some implementation dependent threshold. Usually the threshold will be under
user control.
Vansh Tomar | ECE 3 | 03576802818
Software Overview
The ISE® software controls all aspects of the design flow. Through the Project Navigator interface,
you can access all of the design entry and design implementation tools. You can also access the files
and documents associated with your project.
Design Panel
The Design panel provides access to the View, Hierarchy, and Processes panes.
View Pane
The View pane radio buttons enable you to view the source modules associated with the
Implementation or Simulation Design View in the Hierarchy pane. If you select Simulation, you must
select a simulation phase from the drop-down list.
Vansh Tomar | ECE 3 | 03576802818
Hierarchy Pane
The Hierarchy pane displays the project name, the target device, user documents, and design source
files associated with the selected Design View. The View pane at the top of the Design panel allows
you to view only those source files associated with the selected Design View, such as Implementation
or Simulation. Each file in the Hierarchy pane has an associated icon. The icon indicates the file type
(HDL file, schematic, core, or text file, for example). For a complete list of possible source
types and their associated icons, see the “Source File Types” topic in the ISE Help. From Project
Navigator, select Help > Help Topics to view the ISE Help.
If a file contains lower levels of hierarchy, the icon has a plus symbol (+) to the left of the name. You
can expand the hierarchy by clicking the plus symbol (+). You can open a file for editing by double-
clicking on the filename.
Processes Pane
The Processes pane is context sensitive, and it changes based upon the source type selected in the
Sources pane and the top-level source in your project. From the Processes pane, you can run the
functions necessary to define, run, and analyze your design. The Processes pane provides access to the
following functions:
• Design Summary/Reports
Provides access to design reports, messages, and summary of results data. Message filtering can also be
performed.
• Design Utilities
Provides access to symbol generation, instantiation templates, viewing command line history, and
simulation library compilation.
• User Constraints
Provides access to editing location and timing constraints.
• Synthesis
Provides access to Check Syntax, Synthesis, View RTL or Technology Schematic, and synthesis
reports. Available processes vary depending on the synthesis tools you use.
• Implement Design
Provides access to implementation tools and post-implementation analysis tools.
• Generate Programming File
Provides access to bitstream generation.
• Configure Target Device
Provides access to configuration tools for creating programming files and programming the device.
The Processes pane incorporates dependency management technology. The tools keep track of which
processes have been run and which processes need to be run. Graphical status indicators display the
state of the flow at any given time. When you select a process in the flow, the software automatically
runs the processes necessary to get to the desired step. For example, when you run the Implement Design
process, Project Navigator also runs the Synthesis process because implementation is dependent on up-
to-date synthesis results.
Vansh Tomar | ECE 3 | 03576802818
Libraries Panel
The Libraries panel enables you to manage HDL libraries and their associated HDL source files. You
can create, view, and edit libraries and their associated sources.
Console Panel
The Console provides all standard output from processes run from Project Navigator. It displays
errors, warnings, and information messages. Errors are signified by a red X next to the message; while
warnings have a yellow exclamation mark (!).
Errors Panel
The Errors panel displays only error messages. Other console messages are filtered out.
Warnings Panel
The Warnings panel displays only warning messages. Other console messages are filtered out.
Workspace
The Workspace is where design editors, viewers, and analysis tools open. These include ISE Text
Editor, Schematic Editor, Constraint Editor, Design Summary/Report Viewer, RTL and Technology
Viewers, and Timing Analyzer.
Other tools such as the PlanAhead™ software for I/O planning and floorplanning, ISim, third-party
text editors, XPower Analyzer, and iMPACT open in separate windows outside the main Project
Navigator environment when invoked.
Creating an Archive
To create an archive, do the following:
1. Select Project > Archive.
2. In the Project Archive dialog box, enter the archive name and location.
3. Click Save.
Note: The archive contains all of the files in the project directory along with project settings. Remote
sources are included in the archive under a folder named remote_sources. For more information, see
the ISE Help.
Restoring an Archive
You cannot restore an archived file directly into Project Navigator. The compressed file can be
extracted with any ZIP utility, and you can then open the extracted file in Project Navigator.
2. In the Location field, browse to c:\xilinx_tutorial or to the directory in which you installed the project.
3. In the Name field, enter wtut_vhd or wtut_ver.
4. Verify that HDL is selected as the Top-Level Source Type, and click Next.
The New Project Wizard—Device Properties page appears.
X-Ref Target - Figure 3-3
5. Select the following values in the New Project Wizard—Device Properties page:
• Product Category: All
Vansh Tomar | ECE 3 | 03576802818
In this section, you create a file using the New Source wizard, specifying the name and ports of the
component. The resulting HDL file is then modified in the ISE Text Editor.
To create the source file, do the following:
1. Select Project > New Source.
The New Source Wizard opens in which you specify the type of source you want to create.
2. In the Select Source Type page, select VHDL Module or Verilog Module.
3. In the File Name field, enter debounce.
X-Ref Target - Figure 3-5
4. Click Next.
Vansh Tomar | ECE 3 | 03576802818
5. In the Define Module page, enter two input ports named sig_in and clk and an output port named
sig_out for the debounce component as follows:
a. In the first three Port Name fields, enter sig_in, clk and sig_out.
b. Set the Direction field to input for sig_in and clk and to output for sig_out.
c. Leave the Bus designation boxes unchecked.
X-Ref Target - Figure 3-6
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity or_gate_if_else_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
o : out STD_LOGIC);
end or_gate_if_else_vansh;
architecture Behavioral_03576802818 of or_gate_if_else_vansh is
begin
process(a,b)
begin
if (a ='0'and b ='0' ) then
o <= '0';
elsif (a='0'and b='1') then
o <= '1';
elsif (a='1'and b='0') then
o <= '1';
elsif (a='1'and b='1') then
o <= '1';
end if;
end process;
end Behavioral_03576802818;
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity or_gate_when_else_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : out STD_LOGIC);
end or_gate_when_else_vansh;
architecture Behavioral_03576802818 of or_gate_when_else_vansh is
begin
c <= '0' when a = '0'and b = '0' else
'1' when a = '1'and b = '0' else
'1' when a = '0'and b = '1' else
'1' when a = '1'and b = '1' else
'Z';
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity andgate_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
o : out STD_LOGIC);
end andgate_vansh;
architecture Behavioral_03576802818 of andgate_vansh is
begin
o <= a and b;
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity xor_gate_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
o : out STD_LOGIC);
end xor_gate_vansh;
architecture Behavioral_03576802818 of xor_gate_vansh is
begin
o <= '0' when a = '0'and b='0' else
'1' when a = '1'and b = '0' else
'1' when a = '0'and b = '1' else
'0' when a = '1'and b = '1' else
'Z';
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
NOT Gate
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity notgate_vansh is
Port ( a : in STD_LOGIC;
b : out STD_LOGIC);
end notgate_vansh;
architecture
Behavioral_03576802818 of
notgate_vansh is
begin
b <= not a;
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity nandgate_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : out STD_LOGIC);
end nandgate_vansh;
architecture Behavioral_03576802818 of nandgate_vansh is
begin
c<= a nand b;
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
Half Subtractor
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity halfsub_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
diff : out STD_LOGIC;
borr : out STD_LOGIC);
end halfsub_vansh;
architecture Behavioral_03576802818 of halfsub_vansh is
begin
diff <= a xor b;
borr <= ((not a) and b);
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
TestBench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Fadder_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
ci : in STD_LOGIC;
s : out STD_LOGIC;
co : out STD_LOGIC);
end Fadder_vansh;
architecture Behavioral_03576802818 of Fadder_vansh is
begin
s <= a xor b xor ci;
co <= (a and b) or (b and ci) or (ci and a);
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity full_adder_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
ci : in STD_LOGIC;
sum : out STD_LOGIC;
co : out STD_LOGIC);
end full_adder_vansh;
architecture Behavioral_03576802818 of full_adder_vansh is
component half_adder_behav_modelling is
port(a : in std_logic;
b : in std_logic;
sum : out std_logic;
carry : out std_logic);
end component;
component or_gate_if_else_vansh is
port(a : in std_logic;
b : in std_logic;
o : out std_logic
);
end component;
signal s1,s2,s3:std_logic;
begin
ha_1 : half_adder_behav_modelling port map(a => a,b => b,sum => s1,carry
=> s2);
ha_2 : half_adder_behav_modelling port map(a => s1,b => ci,sum => sum
,carry => s3);
or_gate : or_gate_if_else_vansh port map(a => s3, b => s2, o => co );
end Behavioral_03576802818;
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
Full Subtractor
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity fullsub is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
cin : in STD_LOGIC;
diff : out STD_LOGIC;
borr : out STD_LOGIC);
end fullsub;
architecture Behavioral of fullsub is
begin
diff <= (a xor b) xor cin;
borr <= ((not A) and (B or Cin)) or (B and Cin);
end Behavioral;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity m21x_vansh is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
s : in STD_LOGIC;
y : out STD_LOGIC);
end m21x_vansh;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
JK FLIP FLOP
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
Vansh Tomar | ECE 3 | 03576802818
entity jk_flip_flop_vansh is
port (j : in std_logic;
k : in std_logic;
clk : in std_logic;
reset : in std_logic;
q : out std_logic
);
end jk_flip_flop_vansh;
architecture Behavioral_03576802818 of jk_flip_flop_vansh is
signal s:std_logic;
begin
process(clk,reset)
begin
if (reset = '1') then
s <= '0';
elsif (clk = '1') then
if (j = '0'and k = '0') then
s <= s;
elsif (j = '0'and k = '1') then
s <= '0';
elsif (j = '1'and k = '0') then
s <= '1';
elsif (j = '1'and k = '1') then
s <= not s;
end if;
end if;
q<= s;
end process;
end Behavioral_03576802818;
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
Vansh Tomar | ECE 3 | 03576802818
T FLIP FLOP
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity t_flip_flop_vansh is
Port ( t : in STD_LOGIC;
clk : in STD_LOGIC;
reset : in STD_LOGIC;
q : out STD_LOGIC);
end t_flip_flop_vansh;
architecture Behavioral_03576802818 of t_flip_flop_vansh is
signal s:std_logic;
begin
process(clk,reset)
begin
if (reset = '1') then
s <= '0';
elsif (clk = '1') then
if (t ='0') then
s <= s;
elsif(s = '1') then
s <= not s;
end if;
end if;
q <= s;
end process;
end Behavioral_03576802818;
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
RS FLIP FLOP
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity rs_flip_flop_vansh is
Port ( r : in STD_LOGIC;
s : in STD_LOGIC;
clk : in STD_LOGIC;
reset : in STD_LOGIC;
q : out STD_LOGIC);
end rs_flip_flop_vansh;
architecture Behavioral_03576802818 of rs_flip_flop_vansh is
signal p:std_logic;
begin
process(clk,reset)
begin
if (reset = '1') then
p <= '0';
elsif (clk = '1') then
if (r = '0'and s = '0') then
p <= p;
elsif (r = '0'and s = '1') then
p <= '0';
elsif (r = '1'and s = '0') then
p <= '1';
elsif (r = '1'and s = '1') then
p <= '-';
end if ;
end if;
q <= p;
end process;
end Behavioral_03576802818;
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
MELAY MACHINE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity melay_000_vansh is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
input : in STD_LOGIC;
output : out STD_LOGIC);
end melay_000_vansh;
architecture Behavioral_03576802818 of melay_000_vansh is
type state_type is (s0,s1,s2);
signal current_s,next_s:state_type;
begin
process(clk,reset)
begin
if (reset = '1') then
current_s <= s0;
elsif(rising_edge(clk)) then
current_s <= next_s;
end if;
end process;
process(current_s,input)
begin
case current_s is
when s0=>
if (input = '1') then
output <= '0';
next_s<=s0;
else
output <= '0';
Vansh Tomar | ECE 3 | 03576802818
next_s<=s1;
end if;
when s1 =>
if (input = '0') then
output <= '0';
next_s <= s2;
else
output <= '0';
next_s <= s0;
end if;
when s2 =>
if(input = '0') then
output <= '1';
next_s <= s0;
else
output <= '0';
next_s <= s0;
end if ;
end case;
end process;
end Behavioral_03576802818;
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench Simulation
Vansh Tomar | ECE 3 | 03576802818
RTL Schematic
Vansh Tomar | ECE 3 | 03576802818
Testbench
Vansh Tomar | ECE 3 | 03576802818
Conclusion
Learning about VLSI designing has helped me to understand the working of many
Application Specific Integrated Circuits that are used even in daily appliances like
Refrigerator, Washing Machines etc.
RTL designing has much scope in the hardware sector in upcoming time in India as the
semiconductor market is worth $250 billion. Hence, the knowledge of VHDL also
increases the employability.
Through my summer training, came out of the conventional subjects and gained a small
experience of the current hardware industries requirements and expectations.
Apart from VHDL, there are also come other languages available for the Hardware
Description such as Verilog and System C which have their own benefits and
drawbacks. Yet, there knowledge certainly helps in becoming a good RTL designer.
The main purpose of designing a code is to make it synthesizable rather than focusing
it to be a code that can be successfully simulated. Hence, during programming a
programmable device, certain hardware restrictions should always be put in mind.
Future Prospects
Results VHDL, one of the biggest jobs providing sector today, have a very bright future in the
coming time, but as the time is passing some other languages are making control over
designing, as for example Verilog HDL. Verilog HDL is little bit better in processing speed
than VHDL. But on the other hand, VHDL is also better in some fields like, all the three styles
of modelling (Data flow, Behavioural, Structural) in VHDL can be mixed together in the same
program i.e. VHDL is more user friendly than Verilog HDL.
But today all over world mainly VHDL is used for chip designing at low level. Till now there
are number of drawbacks in VHDL. As main drawback of VHDL is that, there are a number
of features in VHDL, that can be simulated but not synthesized. As, final shape to VHDL was
given by IEEE, hence IEEE is working on it continuously and trying to make available
simulation features to synthesis also.
So, if talk about future prospectus of VHDL, it depends on success of IEEE. If IEEE got able
to implement such features that there remain no differences between simulation & synthesis
with higher processing speed and designing up to lower level of abstraction, on that day VHDL
may take hold over all other HDL.s.
Vansh Tomar | ECE 3 | 03576802818
References
[1] M. Mano and C. Kime, “Logic and Computer Design Fundamentals.” 2nd Edition,
Prentice Hall, Upper Saddle River, 2001.
[2] S. Yalamanchili, "WHDL Starter’s Guide.” Prentice Hall, Upper Saddle River, 1998.
[3] J. Bhasker, “WHDL Primer,” 3rd Edition, Prentice Hall, Upper Saddle River, 1998.
[4] Douglas L. Perry,” VHDL Programming by Examples”, 41 Edition. TMH.
[5] C. EL Roth, “Digital System Design using VIIDL”, PWS Publishing