VLSI BlackBook
VLSI BlackBook
DT Editorial Services
Published by:
~
dreamlech
-AiW::W:W.WM
©Copyright 2016 by Dreamtech Press, 19-A, Ansari Road, Daryaganj, New Delhi-110002
Black Book is a trademark of Paraglyph Press Inc., 2246 E. Myrtle Avenue, Phoenix Arizona
85202, USA exclusively licensed in Indian, Asian and African continent to Dreamtech Press,
India.
This book may not be duplicated in any way without the express written consent of the
publisher, except in the form of brief excerpts or quotations for the purposes of review. The
information contained herein is for the personal use of the reader and may not be incorporated
in any commercial programs, other books, databases, or any kind of software without written
consent of the publisher. Making copies of this book or any portion for any purpose other than
your own is a violation of copyright laws.
Limits of Liability/Disclaimer of Warranty: The author and publisher have used their best
efforts in preparing this book. The author make no representation or warranties with respect to
the accuracy or completeness of the contents of this book, and specifically disclaim any implied
warranties of merchantability or fitness of any particular purpose. There are no warranties which
extend beyond the descriptions contained in this paragraph. No warranty may be created or
extended by sales representatives or written sales materials. The accuracy and completeness of
the information provided herein and the opinions stated herein are not guaranteed or
warranted to produce any particulars results, and the advice and strategies contained herein
may not be suitable for every individual. Neither Dreamtech Press nor author shall be liable for
any loss of profit or any other commercial damages, including but not limited to special,
incidental, consequential, or other damages.
Trademarks: All brand names and product names used in this book are trademarks, registered
trademarks, or trade names of their respective holders. Dreamtech Press is not associated with
any product or vendor mentioned in this book.
ISBN: 978-81-7722-744-4
Credits
The author thanks the following engineers for their help in preparation of the manuscript: A. Veerraju,
Silpa, Atchut Ram Chaudury.
iv
Table of Contents
Preface ....................................................................................................................................... iii
vi
Table of Contents
Questions ........................................................................................................................................................... 62
Exercises ............................................................................................................................................................. 62
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
xi
1
Introduction
to VLSI Design
If you need information on: See page:
Traditional Approach to Hardware Design 2
New Paradigms in Hardware Design 3
VLSI Technology: Fundamentals and Applications 4
Electronic Design Automation 9
FPGA Design Flow 11
Chapter 1
In the recent years, there have been rapid developments in the field of semiconductor electronics.
Consequently, hardware design methodology has also seen various changes. In this chapter, you learn
about the traditional approach to hardware design and the changing trends in the hardware designing
approach. The chapter provides an overview of Very Large Scale Integration (VLSI) technology. It also
explains design flow using Electronic Design Automation (EDA) tools. Towards the end, you learn how
the design automation leads to System-on-Chip (SOC) solutions.
2
Introduction to VLSI Design
Due to these drawbacks, hardware engineers are no longer using the traditional approach of having a
large number of components on the PCB. The aim is to have a few (or even one) chips do the entire system
functionality.
3
Chapter 1
4
Introduction to VLSI Design
22 nanometer
In the last two rows, the Year and Example columns are left blank because at this hour, the prediction is
difficult. The expectation of experts is that 16 nanometer technologies will be available by 2018.
With the improvements in process technology, you can easily see how the hardware design has changed.
You no longer need to use all the discrete components, as you can take readily available processors and
memory chips, and glue them together to develop powerful hardware for various applications.
5
Chapter 1
The next step in this evolution is to develop very few chips that will carry out the complete functionality
of the system, which is called SOC. However, putting the entire logic and memory in one chip requires
sophisticated design automation tools.
6
Introduction to VLSI Design
In Figure 1.1, you can observe an interesting output from the fabless house, FPGA bit stream. Field
Programmable Gate Array (FPGA) is a very flexible chip. It can be configured through a bit stream so that
the same chip can be used for realizing different functionalities. If you think that the ROI, which you have
calculated on ASIC, is not very attractive, then you can choose the option of FPGA to implement your
idea.
7
Chapter 1
popular. You can describe a system using HDL and then compile the code to check whether it is correctly
written and then simulate the system and check how the system is likely to work.
Writing code in HDL is not a very easy task. However, you can use the following tools to describe a
system:
Block diagram: is a diagram of a system, in which the principal parts or functions are represented by
blocks connected by lines, that show the relationships of the blocks. They are heavily used in the
engineering world in hardware design, electronic design, software design, and process flow
diagrams.
Finite State Machine(FSM): is a mathematical abstraction sometimes used to design digital logic or
computer programs.
These tools will automatically convert the high-level representation into HDL code so that you need not
write the code yourself.
8
Introduction to VLSI Design
Similarly, the steps to develop a back-end design are shown in Figure 1.3:
ASIC
ASIC is an IC, which is designed in such a way that it meets the exact requirements for a specific
application. It is a fully customized device, the pre-laid out standard cells in ASIC libraries cover a large
range of functionality. If you are developing a product that will have a mass market, such as a mobile
phone, MP3 player, or set top box, then you can design an ASIC. The advantages of designing ASIC are as
follows:
Very low production cost if the ASIC is for mass market
Best utilization of the resources on the chip (as compared to FPGA)
Optimized for a specific application; and therefore, power consumption and size will be less
9
Chapter 1
10
Introduction to VLSI Design
the FPGA, such as Lookup tables (LUTs), memories, shift registers, and multipliers. These units are much
higher level than the gates in ASICs.
11
Chapter 1
4. Synplicity:
Synplify – synthesizes for code design description in VHDL and Verilog.
Amplify - performs physical synthesis, one of the first tools to do this for FPGA’s.
5. Synopsis:
Virtuso – platform for simulation environment
Scirocco VHDL and VCS Verilog simulators
6. Xilinx
ISE – Simulation and logic synthesis tool.
7. Altera-Quartus – A-HDL (front-end design tool) and MaXPlus back-end tool.
Example
The behavioral description is given in Verilog to perform the addition of two 4-bit binary numbers. For
example, the behavior of an adder that adds two 4-digit inputs and returns an output is specified as
module adder(ip1, ip2, op)
input [3:0] ip1, ip2; //input signals
output [3:0] op; //output signals
op <= ip1 + ip2;
end module
The behavioral description does not specify the structure of the design (whether combinatorial or
sequential elements) used. This description also does not capture the timing information.
In the Register Transfer Level RTL description, the design is split into registers with flow of information
between each register at each clock cycle.
module adder(ip1, ip2, op)
input [3:0] ip1, ip2;
input cin;
output [4:0] op;
assign op = ip1 + ip2 + cin;
end module
Design is divided into registers and logic blocks that join the registers together, as shown in Fig. 1.4.3. The
detailed design flow is shown in Fig 1.4.4 for 4-bit full adder (FA). The design consists of four 1-bit full
adder and the flow of inputs and outputs of each logic block. Each 1-bit full adder has three inputs –
ip1[0], ip2[0] and input carry (cin).
Design entry: The design description is done using Hardware Description Language or schematic entry.
Simulation is checked using front-end tools. The optimization of the design takes place at logic synthesis
and gate-level netlist(Gate-level netlist is basically a circuit implementation of the design made of library
components available in the technology library and their interconnections. The netlist is generated by the
synthesis tool according to the constraints set by the designer) is generated, verified and placed and
routing is done by back-end tools. Finally the physical layout of the circuit is mapped on to target device.
The flow of data between the logic blocks are shown in Figure 1.6 and the structural description of 1-bit
full adder is shown in Figure 1.7.
12
Introduction to VLSI Design
13
Chapter 1
Summary
This chapter presented a brief introduction about VLSI Design. The traditional approaches in the
hardware design – vacuum tubes, transistors, diodes, semiconductors, and Integrated Circuit chips. The
invention of transistor laid down the foundation of semiconductor technology. The fast pace development
of semiconductor technology increased the capability of achieving the functionality of complex logic and
memory usage. With the level of increase in integration of circuits, the processor developments achieved
with complex functionality like memories, ALUs, DSP etc., The two important phases in VLSI Design
process: front end process and Back end process. The front end design is the first phase in the VLSI design
process where the logic for the chip is built using the HDL. Verilog HDL has become popular due to its c-
like syntax. The second major phases is known as Backend process where the logic synthesis is been
performed, cells in the netlist are placed on the die and then routed with final layout. The automated tools
for front end and backend are termed as Electronic Design Automation tools.
Application Specific Integrated Circuit (ASIC) is an Integrated Circuit that is designed to meet the exact
requirements for a specific application. ASIC is a fully customized device, the pre-laid out standard cells in
ASIC libraries cover a large range of functionality. Field Programmable Logic Array is a programmable
device consists of programmable logic blocks (LUTs). ASIC Design and FPGA design flow differs at the
synthesis stage of the design process. The major vendors of Front end tools and backend tools are
Synopsis, Mentor Graphics, Cadence, Magma Design Automation, Synplicity, Altera and Xilinx. The tools
like VCS, Verilog, NCSim, Verilog-XL, A_HDL, ModelSim and Nc verilog are some of the logic simulators
(front end tools). The Altera – MAXplus, Magma, Design Compiler, Emulator, Leonardo Spectrum and
Xilinx are the Backend tools.
Review Questions
1. Explain the developments in VLSI technology.
2. Explain the front end and back end process in a VLSI design process.
3. Explain the features of ASICs devices.
4. What are the applications of FPGAs?
5. List and write the major vendors of front end tools.
6. List and write the major vendors of back end tools for FPGAs and ASICs.
14
2
VLSI Design Technologies
If you need information on: See page:
Combinatorial Design Technique 16
Sequential Design Technique 26
State Machine Logic Design Technique 31
Design Issues 34
Chapter 2
16
VLSI Design Technologies
The Exclusive-OR (XOR) gate and the Exclusive-NOR (XNOR) gate are other logic gates that can be
constructed using the AND, OR, and NOT gates or the NAND or NOR gates. The NAND and NOR gates
are called universal gates because any logic gate, such as AND, OR, NOT, Exclusive-OR, Exclusive-NOR,
NAND, and NOR, can be realized using only the NAND gates or the NOR gates. Similarly, any logic
circuit can be realized using any of these universal gates.
A set consists of logic gates is said to be a functionally complete set if any logical operation can be realized
with these set elements. For example, the set {NAND} is called a functionally complete set because any
logic circuit can be realized using the NAND gate. In this case, the NAND gate is a set element.
Similarly, {NOR}, {AND, NOT}, {OR, NOT}, and {AND, OR, NOT} are functionally complete sets.
Figure 2.2 shows the AND, OR, and NOT gates that are realized from the NAND and NOR gates:
Figure 2.2: Displaying the NAND and NOR Realization of Basic Gates
17
Chapter 2
As mentioned earlier, the digital circuits are constructed with a set of logic circuits. Logic circuits perform
an operation that can be specified logically by a set of Boolean functions. The two types of digital circuits
are as follows:
i. Combinational
ii. Sequential
Logic circuits whose output depends on the current logic states of the inputs are called combinational
logic circuits.
A combinational circuit consists of logic gates, where output values are determined only by the present
combination of inputs. In other words, a combinational circuit performs an operation specific to
information processing assigned logically by a set of Boolean functions. These circuits consist of input
variables, output variables, logic gates, and interconnections. Each input and output variable exist
physically as a binary signal that represents a logic 1or logic 0.
Combinational circuits can have one or more inputs. Figure 2.3 shows the block diagram of a
combinational circuit with m-inputs and n-outputs where m and n are variables:
18
VLSI Design Technologies
Boolean Equation
If the value of the output variable is represented as a function of the input variables, then that function is
called Boolean expression or Boolean equation.
For example, the Boolean equation for a two-input AND gate is
F(x, y) = xy
In this Boolean equation, x and y are the input variables that can be assigned any possible combinations of
the input values, such as 00, 01, 10, and11.
Similarly, Boolean function for a two-input XOR gate is
F(a,b) = a’b + ab’
In the preceding Boolean function, a and b are the input variables and a’, a, b’, and b are literals. A literal is
a variable in a complement or normal form. The output of the Boolean function is true when a = 0 and b =
1 and a = 1 and b = 0. Table 2.1 shows the truth table for the Boolean function:
Table 2.1: Truth Table for the Boolean Function
A B Output
0 0 0
0 1 1
1 0 1
1 1 0
Schematic
The schematic, which is also known as logic diagram, shows the connection of hardware logic gates that
implement the circuit.
The schematic for the Boolean function F(x, y) = x’y + x y’, where x and y are inputs to the XOR gate is as
shown in Figure 2.4:
Figure 2.4: Displaying the Schematic for the Boolean Function F(x, y) = x’y + x y’
Similarly, let’s consider the three-variable Boolean functions F1and F2 such that F1(x,y,z)=x'yz+xy'z+xyz
and F2(x,y,z)=xy+yz+xy.
Figure 2.5 shows the schematic of the Boolean function:
19
Chapter 2
Figure 2.5: Displaying the Schematic Diagram for the Boolean Function
Figure 2.6 shows the schematic diagram of Boolean function F1(x,y,z)=x'yz+xy'z+xyz:
Figure 2.6: Displaying the Schematic Diagram for the Boolean Function F1
Figure 2.7 shows the schematic diagram of F2(x,y,z)=xy+xz+yz:
Figure 2.7: Displaying the Schematic Diagram for the Boolean Function F2
Any logic function or Boolean function expressed as a combination of input variables is also called
Switching algebra or Boolean algebra. These functions can be expressed in three forms: canonical,
standard, and factored. Let’s now learn about these forms in detail.
Canonical Form
A binary variable can hold a value 0 or 1, and it is represented as a complement form (x') or a normal form
(x). For n-variables, the binary numbers from 0 to 2n -1 are considered.
A Boolean expression is said be in a canonical form if all the terms are minterms. Each minterm is obtained
from an AND term of n-variables, with each variable in a complement or normal form. In other words,
20
VLSI Design Technologies
binary variables forming AND-terms where each variable in the term is primed if the corresponding bit of
variable is 0 and unprimed if it is 1 are called minterms.
The number of minterms for n-variables is 2n.
The list of all possible combinations with two-variables (0 - 22 -1=0-3) and corresponding minterms are
listed as follows:
00 --- x' y'
01 --- x' y
10 --- x y'
11 --- x y
For example, Boolean function
F(x,y) = x' y' + x' y is expressed in a canonical form where x’y’ and x’y are its minterms.
Similarly, n-variables forming OR terms with each variable to provide 2n possible combinations are called
maxterms. The maxterms for the two-variables x and y are x+y, x+y', x’+y, and x’+y'.
In other words, any n-variable term formed with an OR-operation where each variable in the term is
primed if the corresponding bit of variable holds 1 and unprimed if it is 0, then the term is called maxterm.
Table 2.2 lists the minterms and maxterms for three-binary variables:
Table 2.2: Minterms and Maxterms of Three–Binary Variables
XYZ MINTERMS MAXTERMS
A Boolean function can be expressed algebraically as a Sum of Minterms (SOM) or Product of Maxterms
(POM). If a Boolean function is expressed as SOM or POM, then the function is said to be in a canonical
form. However, the Boolean function is in a standard form if it is expressed in Sum of Products (SOP) or
Product of Sums (POS) form. Let’s learn about these forms in the next section.
Standard Form
Standard form is another way to represent a Boolean function. The standard forms are of two types: SOP
and POS.
The n-variable term obtained by AND-operation of all the variables or some of the variables is said to be in
the SOP form.
SOP is a Boolean expression containing AND terms called products with one or more literals. Each sum
denotes the ORing of the AND terms. An example of SOP is as follows:
F=xy+yz+z
21
Chapter 2
Similarly, the n-variable term expressed by ORing all the variables or some of the variables is said to be in
the POS form.POS is a Boolean expression containing OR terms called sums with one or more literals.
Each product of these sums is called POS expression.
An example of POS is as follows:
F(x,y,z) = (x+y+z) (y+z) (x+y)
Any Boolean functions can be expressed in terms of AND, OR, and NOT operations. These functions are
easy to implement using basic gates (AND, OR, and NOT), universal gates (NAND and NOR), or with
functionally complete set of gates.
The implementation of the Boolean function F = ABD + CD + E in the SOP form with logic gates is shown
in Figure 2.8:
Factored Form
Boolean functions can also be expressed in the factored form. The logic function is in the factored form, if
it is neither in the SOP form nor in the POS form. The factored form of an expression is composed of
products of factors. This form is used mainly to simplify the logic circuits with minimum logic gates.
Example of a factored form is given as follows:
F = (a+b)cd + (c+d)b
22
VLSI Design Technologies
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
23
Chapter 2
0 0 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
The truth table for output F is determined from the values of w, x, y, and z. The value of F is 1 for any
combination that has three or more inputs equal to 1. Designer’s motive is to design a circuit by using
minimum number of gates to reduce the cost of the circuit. Therefore, by applying Huntington postulates,
Boolean theorems, and algebraic theorems, the Boolean expression is simplified, as shown in Figure 2.9:
Figure 2.9: Displaying the Combinational Circuit Realized with the Basic Gates
Procedure to design a combinational circuit that is incompletely specified for some combinations is given
as follows:
1. Obtain the specifications of the circuit Determine the required number of inputs and outputs and
assign symbols to each input and output.
24
VLSI Design Technologies
2. a. List all the possible input combinations and their corresponding binary numbers from 0 to 2n-1 in
order as a truth table.
b. Derive the truth table that defines the relationship between inputs, outputs, and unspecified
combinations.
c. Represent the unspecified combinations in the truth table as X and specified combinations as 1
and 0 as per the functionality.
4. a. If the function is in the SOP form, then consider the unspecified combination value as 1 and
obtain the simplified Boolean expression for each output as a function of input variables.
b. If the function to be simplified is in the POS form, then consider the unspecified combination
value as 0 and obtain the simplified Boolean expression for each output as a function of input
variables.
5. Draw the logic diagram and verify the correctness of the design for each input combination with the
corresponding output manually or by simulation.
The output binary functions are simplified by using any available method, such as algebraic manipulation,
Boolean theorems, or k-map method. These Boolean functions are implemented using basic logic gates or
universal gates.
Let’s design a four-input combinational circuit
1. Whose output is equal to 1, if input variables have more number of 1’s than 0’s
2. Whose output is unspecified, if input variables have equal 1’s and 0’s
3. Otherwise, the output value is 0
Step-1:
a. Based on the specifications, output of the circuit is equal to 1 if the number of 1’s are greater than
the number of 0’s.
b. The output of the circuit is equal to 0 if the number of 0’s are greater than the number of 1’s.
c. Otherwise, the output of the circuit is don’t care and represent it as X in the truth table.
Step-2: The binary variables w, x, y, and z are inputs and f is an output.
Step-3:
a. Derive the truth table, which consists of four columns for input and one column for output. The
four-variable input represents the binary values from 0-15.
b. The output column is determined from the stated specifications.
Step-4: Boolean function is transformed into a circuit diagram that is composed of logic gates connected in
a particular structure. Output function is expressed as a simplified expression in any of the standard form
in terms of input variables.
Step-5: The logic expression or Boolean function is implemented using the logic gates. The simplified
Boolean function for given specifications is derived as
F(w,x,y,z) = wx + wy +xy.
Table 2.4 shows the truth table for the function F(w,x,y,z) = wx + wy +xy:
Table 2.4: Truth Table with Don’t Care Combinations
W X Y Z F
0 0 0 0 0
0 0 0 1 0
25
Chapter 2
0 0 1 0 0
0 0 1 1 x
0 1 0 0 0
0 1 0 1 x
0 1 1 0 x
0 1 1 1 1
1 0 0 0 0
1 0 0 1 x
1 0 1 0 x
1 0 1 1 1
1 1 0 0 x
1 1 0 1 1
1 1 1 0 1
26
VLSI Design Technologies
Following are the two types of sequential circuits based on the timing of the signals:
Synchronous
Asynchronous
Synchronous sequential circuit is a logic circuit whose outputs depend on the present values of inputs
and the past values of inputs at discrete interval of time. Synchronous is achieved by timing device called
clock generator, which provides a clock signal for every fixed periodic intervals as 0 – 1 – 0 and denoted as
clock pulse or clk. The pictorial form to represent the clock pulse or clock signal is as shown in Figure 2.11:
27
Chapter 2
Flip-Flop
Flip-flop is a circuit constructed from NAND or NOR gates with feedback loop. The circuit has inputs and
outputs. Each flip-flop has two outputs termed as q and q’.
The state of the flip-flop determines the output of the flip-flop and changes only during a clock pulse
transition, that is, when the values of the clock pulse changes from 0 to 1. When clock pulse is not active,
value stored at flip-flop is the output of the flip-flop. The output of flip-flop changes if input change takes
place and clock pulse is active. Therefore, the transition from one state to the next state occurs only at
discrete interval of time. The output value of flip-flop before applying clock pulse is called past input
values and state of the flip-flop is called the present state. Flip-flop is an edge-sensitive device.
The various types of flip-flops are Set – Reset (SR), JK, D, and T. The inputs required for the SR and JK flip-
flops are two.
The state of the flip-flop after applying clock pulse is called the next state of flip-flop and the output values
of the flip-flop are represented as the present input values. The states of sequential circuits are represented
using state equation, state table, and state transition graph. Let’s learn about these in detail.
State Equation
The behavior of a circuit is described algebraically by the means of input variables. The number of state
equations depends on the number of memory elements or the number of flip-flops of the circuit. The
function of state equation specifies the present state and inputs of the circuit. The output of the circuit as
the next state is given as follows:
A(t+1) = A(t)x(t) + B(t)x(t)
The left side of the equation is the output of the flip-flop denoted as next state of the flip-flop after
applying clock pulse. The right side of the equation represents the present state and input conditions that
makes the flip-flop circuit equal to 1. The state equation is also termed as transition function.
28
VLSI Design Technologies
State Table
The state table, also called transition table, consists of input, present state, next state, and output columns.
The derivation of state table requires listing of all the possible binary combinations. The possible
combinations vary with respect to the number of flip-flops and the number of inputs to the circuit. In
general, a sequential circuit with m flip-flops and n inputs needs 2 m+n combinations.
The binary numbers from 0 to 2 m+n -1 rows to be represented in the state table as present state and inputs.
If the present state at t and next state at (t+1) is represented as state equations with input variables, then
the present state represents the state of flip-flop before applying clock pulse, that is, at time t. Similarly, the
next state represents the output of flip-flop after applying clock pulse, that is, at time (t+1).
Following is the state table with one flip-flop and one variable that requires 2 1+1 combinations with one
output variable:
Input Variable Present State Next State Output
X A(t) A(t+1) z
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
State Diagram
The information in the state table can be presented graphically in the form of a state diagram (or transition
diagram). A state is represented by a circle. A transition from the present state to the next state is
represented by an arrow with the inputs and outputs written on that transition with a slash in between
inputs and outputs. Transition from one state to another state is represented as vertices, as shown in
Figure 2.13:
29
Chapter 2
4. Derive the input equations of flip-flop from the next state entries in the encoded state table.
5. Derive the output equations from the output entries in the state table.
6. Simplify the input equations and output equation of flip-flop.
7. Draw the logic diagram with D flip-flops and combinational gates, as specified by the input equations
and output equation of flip-flop.
Let’s design a synchronous sequential circuit that displays the sequence as 0 0, 0 1, 1 1, 1 0 and repeats
itself. The sequence resets to 0 0 when an input variable is equal to 1.
The procedure to design this synchronous sequential circuit is as follows:
1. Identify the number of states, state variables, and input variables from the statement of the problem.
The number of states identified is four and named as S0, S1, S2, and S3.
2. Assign binary codes to the states and number of variable as A, B to represent the binary coding of
states and input variable as x.
3. The state table is given as follows:
Present State Input x Next State
AB
S0 – 0 0 0 01
S1 – 0 1 0 11
S2 – 1 1 0 10
S3 – 1 0 1 00
Figure 2.14: Displaying the Transition State Diagram with Four States
4. Derive the input equations from the next-state entries in the encoded state table.
5. Derive the output equations from the output entries in the state table.
6. Simplify the flip-flops input equations and output equation.
If the flip-flop chosen is of D- type, then the equations for the two input variables DA and DB in terms of
present state variables are as follows:
DA = B(t)
DB = A’(t)
where, A(t) and B(t) are present state variables and A(t+1) and B(t+1) are next state variables.
30
VLSI Design Technologies
31
Chapter 2
32
VLSI Design Technologies
δ (s2, 0) = s3
δ (s2, 1) = s1
δ (s3, 0) = s1
δ (s3, 1) = s2
The transition graph/state diagram for a given Moore-type finite state machine is as shown in Figure 2.17:
33
Chapter 2
Design Issues
The reliability of digital circuit is the most important design issue for a designer. The characteristics of
digital circuits are measured based on the power consumption, propagation delay, power dissipation,
hazards, glitches, and noise margin. Out of all these, the parameter that affect the circuit lifetime is power
dissipation. Similarly, other important factors that affect the circuit are meta-stability apart from noise
margins and delay incurred in the circuit. In this section, parameters, such as fan-out, meta-stability, noise
margin, power dissipation, and timing are discussed briefly.
Fan-Out
Fan-out of a gate is the maximum number of inputs the gate can derive while maintaining the output
levels within the specified limits. In other words, fan-out specifies the maximum loading that a given gate
is capable of handling to derive the output line.
Figure 2.20 shows the AND gate that derives three inputs to next-level gates:
Figure 2.21 represents the AND gate with fan-out 4:
Meta-Stability
Meta-stable means not stable. If a signal is meta-stable, then the value of that signal is neither 0 nor 1. The
value oscillates between 1 to 0 or 0 to 1. In combinational circuits, hazards arise due to momentary delay
between the input leading to the incorrect output of the circuit. Similarly, meta-stable occurs when a clock
edge is random with respect to a change of an input signal in flip-flops. The momentary incorrect output
leads to unreliable conditions to the digital circuits.
In other words, if a signal changes within the setup/hold time of the flip-flop, the output is unknown for a
period. If this time lag is known and finite, then it is not a factor to be considered to measure the
performance of the circuit. However, this period is known prior to the design stage. This depends on the
characteristics of the flip-flop. One of the best solutions to solve this problem is to use synchronous design
techniques.
34
VLSI Design Technologies
Noise Margins
The unwanted signals arise during the interconnection of logic gates of digital circuit. These signals are
termed as noise. Two types of noises can be considered: AC and DC.
The AC noise is a random pulse that may be created by other switching signals. The DC noise is caused
due to sudden fall in voltage levels of signal. Therefore, noise is an unwanted signal that needs to be
avoided. Otherwise, the tolerance level for the circuit needs to be identified such that it does not affect the
circuit output.
Noise margin is expressed in volts and represents the maximum noise signal that can be tolerated by the
gate. Any logic gate is immune to AC noise margins due to the short duration. These AC noise margins
are higher than the DC noise margins. Some important facts of DC noise margin are as follows:
1. The DC noise margin of a logic-gate is a measure of its noise immunity
2. Noise immunity is a measure of gate’s ability to withstand fluctuations of the voltage levels at its
input
3. The common sources of noise are ground noise, variations, and radiated signals for DC noise margin
Power
The primary causes of power dissipation in digital circuits a r e propagation delays, clock frequency,
circuit topology, and dynamic power (charging and discharging of load capacitances). Out of these,
dynamic power is a major cause that contributes to power dissipation. The dynamic power dissipation
depends both on the functionality of the circuit and the input vectors that are applied to it. Dynamic
power dissipation occurs because of switching activity (0 → 1 or 1 → 0 transitions) in the circuit, which
results in the charging/discharging of the load capacitance.
The dynamic power dissipation PR in the combinational portion of a logic circuit can be computed as
follows:
1
PR . Vdd2 . f . ( N ( g ) x C ( g )) (1)
2 gates g
The summation is performed over all the gates g in the circuit; N (g) denotes the number of times
the output of the gate g has switched from 0 → 1 or 1 → 0 (toggled) within a given clock cycle; C (g)
denotes the output capacitance of gate g; f is the frequency of operation; and Vdd is the supply voltage.
Therefore, the total switching activity is the parameter that contributes for power dissipation. To design a
reliable circuit prior the estimation of power dissipation or power consumption is essential in the process of
design flow. General approach to estimate the power component is through simulation of the circuit with
deterministic test vectors or random test vectors. Automatic Test Pattern Generation algorithms are
implemented to simulate the circuit and to estimate the dynamic power dissipation of the circuit.
Timing
The signals through a gate take some amount of time to propagate from the inputs to the outputs of the
gate. This time includes the initial delay and transport delay of the gate, which is known as propagation
delay of a gate. This is measured in time units (nanoseconds). The total time that a signal takes to traverse
from primary inputs to primary outputs in a circuit is considered as the total time taken to pass through
the inputs to outputs. This total time is known as the propagation delay of the circuit.
The input signals in most digital circuits are applied simultaneously to more than one gate. All these gates
at primary inputs and the output of the gates pass through to the next level of the circuit and so on until
the level of the circuit where output reaches to the primary output. Therefore, the propagation delay of the
circuit is computed as follows:
Total Prop Delay = Gate Prop Delay * number of levels of the circuit.
35
Chapter 2
The reduction of propagation delay is one of the factors to be considered to increase the speed of the
circuit.
Summary
In this chapter, the design of digital circuits is discussed extensively. The digital circuits are of two types:
combinational and sequential. The basic elements of digital circuits are logic gates: AND, OR, and NOT
(basic gates), NAND and NOR (universal gates), and XOR and XNOR (additional gates). Functionally
complete sets are used to realize any digital circuits. The design of a combinational circuit and detailed
explanation with an example is presented. The completely and incompletely specified functions are useful
to minimize the logic circuit. The basic elements of sequential circuits are discussed briefly. The sequential
circuits are composed of combinational logic and memory elements. The synchronous sequential circuit
changes the state of the circuit with clock pulse and the asynchronous sequential circuit changes the state
of the circuit without clock pulse. The design of synchronous sequential circuits discussed in detail with
example. The importance of state transitions, state tables, and transition graph is illustrated.
Finite state machine is a form of sequential circuits. The two types of finite state machine are Mealy and
Moore machines. The mathematical notation for these machines is given briefly and design concepts with
examples. Finally, the factors that influence the performance of circuits are considered as noise margins,
meta-stability, power dissipation, power consumption, and timing.
Questions
1. Explain the procedure to design the combinational circuits.
2. Explain the procedure to design the synchronous sequential circuits.
3. List the different methods to represent the Boolean expression
4. Write the difference between standard form and canonical form
5. List the differences between synchronous and asynchronous sequential circuits.
6. Define power dissipation, fan-out, and universal gates.
7. What is noise margin?
8. Explain the completely specified sequential machine and incompletely specified sequential machine.
9. Write a procedure to design a 4-bit mod-10 counter
10. What is Mealy and Moore machine?
11. Discuss the procedure to derive the state tables and state transition graphs for the given specifications
where the circuit generates the sequence of numbers as 00, 11, 10, and 00, and then repeats itself.
Exercises
1. Explain the need of incompletely specified combinational circuits.
2. What is the necessity of synchronous sequential circuits?
3. Enumerate the need of functionally complete set.
4. What are the factors that lead to increase the noise immunity?
5. Derive the steps to design Mealy machine.
6. Write the differences between the completely specified finite state machines and incompletely
specified finite state machines.
36
3
CMOS VLSI Design
If you need information on: See page:
MOS Technology and Fabrication Process 38
pMOS 41
nMOS 43
CMOS 45
BiCMOS 47
Comparison of Different Processes 48
Chapter 3
This chapter gives detailed description of transistor technologies and fabrication process. You also learn
about the physical structure and circuit diagram of p-type Metal-Oxide Semiconductor (pMOS), n-type
Metal-Oxide Semiconductor (nMOS), Complementary Metal-Oxide Semiconductor (CMOS), and Bipolar
Complementary Metal-Oxide Semiconductor (BiCMOS) in detail. The fabrication process concepts to build
Metal-Oxide Semiconductor (MOS) devices and comparisons among different processes are also discussed
in this chapter.
Fabrication Process
ICs are made up on each wafer, which is a single crystal of Silicon available in the form of thin, flat
circular shape. An IC consists of several layers of different materials on a Silicon wafer. As already
learned, IC that varies in shape, size, and location of material is to be specified as a parameter before the
fabrication process begins.
38
CMOS VLSI Design
Silicon (Si), GaAs, and Germanium (Ge) are the materials that are used to build ICs. Based on the
movement of electrons, the electrical properties of a material are calculated such that the electrical current
is measured. The resistance to the flow of electricity in a material is measured in terms of amount of
resistance (ohms per unit length) or resistivity. On the basis of resistivity, the materials are categorized as
conductors, semiconductors, and insulators. These three types of materials are used for fabrication
process. The fabrication materials are important to consider the reliability of the die. Let’s now discuss the
materials used for the fabrication process.
Conductors
Materials that have low electrical resistance or high electrical conductivity are called conductors.
Conductors can have resistivity of as low as 1 micro-ohm-cm. Some of the good conducting elements are
Aluminum, Bismuth, Copper, Gold, Platinum, Silicon, and Tungsten. These materials are used to make
connections between devices on a chip. For example, conductors used in the VLSI fabrication are
Aluminum and Gold.
Insulators
Materials that have high electrical resistance are called insulators. These materials have resistivity of more
than millions of giga-ohms. These are used to isolate the devices with different parts of the device.
Insulator used in the VLSI fabrication is Silicon Dioxide.
Semiconductors
Materials that have neither high nor low electrical resistance are called semiconductors. These materials
have resistivity range from 10 m-ohm-cm to 1 giga-ohm-cm. The electrical current is carried by either
holes or electrons. These materials can change their electrical properties by adding impurities into it. If the
impurity elements are added to provide excess electrons, then the resulting material is called n–type
because the excess free electrons have a negative charge. Similarly, if the impurity elements are added to
provide excess holes or positive charges, then the resulting material is called p–type. Arsenic and
Antimony are added as an impurity to form n-type materials; whereas, Aluminum, Gallium, and Indium
are added as an impurity to form p–type materials. Doping is the process of substituting other atoms for
some of the semiconductor materials. The doping materials are also termed as impurities. Silicon is a
major semiconductor material used for the VLSI fabrication.
As already learned, the basic material used for the large class of semiconductor devices and ICs is Silicon.
The fabrication process starts with the creation of a Silicon wafer by crystal growth. A mask is a
specification of geometric shapes that need to be created on certain layers. Masks are used to create
specific patterns of each material in a sequential manner and create a complex pattern of several layers.
Several masks are created one for each layer. The wafer is then processed for size and shape. Devices are
formed by overlapping a material of certain shape in one layer by another material. After patterning of all
the layers, wafer is cut into individual chips and packaged. All the manufacturing process of an IC takes
place in two steps:
1. Wafer fabrication (front-end process)
2. Assembly (back-end process)
Wafer Fabrication
Wafer fabrication is a process of building an IC, die, or chip. Initially, Silicon chip forms a part of very thin
round Silicon slice called raw wafer. Wafer diameter usually varies from 125, 150, or 200 millimeter (5, 6, or
8 inches).
39
Chapter 3
Photo Masking
The process of producing a pattern on a wafer at desired place is called photo masking. This process takes
place using electron beam focusing on the wafer with selective portions under the beam.
Deposition
Deposition is a process of placing or depositing a material on a raw wafer to change the electrical
properties of the raw wafer. Generally, the raw wafer, which is made up of Silicon, is an insulating
material. The various materials that are used for deposition are insulators, resistive films, and Silicon
Dioxide. The deposition process is done in two ways: physical vapor deposition and chemical vapor
deposition. These depositions are non-selective and are placed uniformly over an entire region of wafer.
Etching
The process of removing unwanted materials over the surface of wafer is called etching. A single IC
undergoes several etches during the process of fabrication for desired circuit. Due to this, chemicals used
for the etching process must be selected in such a way that these materials should not change the
properties of protected areas of wafer. The etching process can be performed in the following two ways:
. Wet: Refers to an etching process where the liquid is used for etching. The horizontal etching and the
vertical etching can be done during this process. The wet etching process is non-uniform due to liquid
chemical agents. The wet etching is also called chemical etching.
. Dry: Refers to an etching process where removal of unwanted material is been performed by
bombardment of ions using electron beam. The dry etching is also called ion etching.
Diffusion
The process of imposing the impurities onto wafer is called diffusion. Silicon features are altered by using
a well-controlled process known as doping the Silicon. Dopants or doping atoms are purposely inserted in
the Silicon lattice to change the features of the materials in predefined areas. These dopants induce the
electrical properties required on semiconductor materials. If the electrical current or charge is carried by
electrons (negative charges), then the material is called n-type material. However, if the electrical current
or charge is carried by holes (positive charges), then the material is called p-type material.
The most frequently used dopants to achieve these features are Phosphorus, Arsenic for negative carriers,
and Boron for positive carriers.
Arsenic results in a semiconductor where the electrical current is carried by electrons; whereas, Boron as a
dopant results in the electrical current carried by holes.
Ion Implantation
Ion implantation is the process of introducing ionized atoms into target wafer or substrate in depth to
avoid any barrier effect of the surface layer.
The etching process is repeated for several times to get the desired circuit. After you get the desired circuit,
the package process takes place, which includes:
40
CMOS VLSI Design
pMOS
An n-type transistor is embedded in a p-type substrate and formed by the intersection of an n-type wire
and a poly Silicon wire. The intersection region is called channel. The transistor action takes place in the
channel. Channel connects two n-type wires that form the Source (S) and Drain (D), which are doped in p-
type substrate also known as n-well or n-channel. To implement p-channel transistors, p-type dopants
(Boron) are diffused into an n-type (Silicon) substrate to form S and D. The electrical charge or current
takes place using holes or positive charge carriers. As the channel is composed of positive charged
carriers, it is called p-channel or pMOS. Indium and Gallium are also p-type materials that are used for
doping. The physical structure and circuit symbol of pMOS transistor is shown in Figure 3.1 (a) and (b);
and the switch model created using the pMOS transistor is shown in Figure 3.1 (c):
41
Chapter 3
1 1 OFF
0 0 ON
nMOS
The nMOS technology is similar to the pMOS technology; however, the difference is with the charge
carriers. A p-type transistor is embedded in an n-type substrate and formed by the intersection of p-type
wire and a poly Silicon wire. This intersection region is called p-channel. The p-channel connects two n-
type wires that form S and D, which are doped in the p-type substrate also known as p-well or p-channel.
To implement n-channel transistors, n-type dopants (Phosphorus) are diffused into a p-type (Silicon)
substrate to form S and D. The electrical charge or current takes place using electrons or negative charge
carriers. As the channel is composed of negative charged carriers, it is called n-channel or nMOS. Arsenic
and Antimony are also n-type materials that are used for doping. The physical structure and circuit
symbol of nMOS transistor is shown in Figure 3.2 (a) and (b) and the switch model created using the
nMOS transistor is shown in Figure 3.2 (c):
42
CMOS VLSI Design
43
Chapter 3
The physical structure shown in Figure 3.2 (a) consists of two n+ regions and one p-well or p-channel. S
and D are created by doping impurities as n+ regions. The charge carrier takes place through electrons in
p-well; this p-well is connected to VDD; and G is connected to S and D.
The circuit symbol shown in Figure 3.2 (b) consists of S, D, and G. The absence of bubble at the gate of
nMOS transistor implies that its gate must be at a high voltage in order for it to turn ON. In other words,
the nMOS transistor is a device that conducts when gate voltage is high. The nMOS are 2.5 times faster
than pMOS due to their mobility of electrons.
The logic level of the switching device is shown in Table 3.2:
Table 3.2: Logic Levels of nMOS Switching Device
Gate Logic Level nMOS
0 0 OFF
1 1 ON
CMOS
The CMOS technology was invented during 1960 and P. K. Weiner succeeded in the year 1962 with the
basic elements to build. In the year 1963, fully-customized CMOS was invented and introduced three basic
logic gate structures (NAND, NOR, and NOT) with CMOS technology. Nowadays, the market is
dominated by CMOS technologies for designing VLSI systems.
CMOS technologies combine both pMOS and nMOS transistor devices on the same Silicon. Both the
transistors require two different substrates, that is, the nMOS transistor requires a p-type substrate and the
pMOS transistor requires an n-type substrate. You can use either a p-type or n-type Silicon substrate as a
channel. However, the opposite doping type called wells must be defined to allow fabrication of the
complementary transistor type. CMOS allows fabrication of nMOS and pMOS transistors side by side on
the same Silicon substrate.
The advantage of CMOS is that its logic elements draw current only during the transition from one state to
another; and therefore, power is conserved. CMOS speed is mainly depends on device parameters, such as
saturation current and capacitance. This in turn depends on oxide thickness, substrate doping, and
channel length.
The various process methods are evolved to build CMOS circuits, such as n-well, p-well, twin-well, and
Silicon, on insulator technology. The process method varies depending on the type of substrate used for
the foundation as a channel. Some of these process methods are described as follows:
1. p-well
2. n-well
3. twin-tub
44
CMOS VLSI Design
45
Chapter 3
BiCMOS
As discussed, a major disadvantage of MOS technology is its limited load driving capabilities due to
limited current sourcing, sinking abilities of pMOS and nMOS transistors, and speed. Similarly, the
limitation of bipolar transistors is high power dissipation. To overcome these limitations, BiCMOS
transistors were introduced in late 1970s. VLSI circuits started using BiCMOS technology during 1980s
that resulted in high-speed memories, gate arrays, and microprocessors.
BiCMOS is a combination of bipolar junction transistors and CMOS transistors. These are integrated into
a single IC. The physical structure of BiCMOS is shown in Figure 3.4:
Power Dissipation
This parameter is measured in mill watts (mW). It represents the actual power delivered by the gate or
circuit from the power supply. The sum of the total power dissipated in all the gates, circuits, or ICs in the
design is considered as the power dissipated by the system.
46
CMOS VLSI Design
Propagation Delay
This parameter is the most important factor to measure the performance of the circuit. Time taken to
propagate a signal from the input of the gate to the output of the gate is called the propagation delay of
the gate. Similarly, time taken to propagate signal or signals from the primary input to the primary output
is called the propagation delay of the circuit. This is expressed as nanosecond (ns) where 1 ns = 10-9 of a
second.
The input signals in most digital circuits are applied simultaneously to more than one gate. All the gates
receive their inputs from external inputs considered as the first logic level circuit. In other words, primary
inputs are given as an input to the first level logic circuit. Gates that receive inputs from the first level of
the circuit are considered as second logic level and similarly, for further level until the signal reaches to
primary output. Therefore, the total propagation delay of the circuit is equal to the propagation delay of a
gate times the number of levels in the circuit. As the number of logic levels increases, the delay increases.
Noise Margin
Noise margin is the maximum noise voltage added to the input signal that does not cause any damage or
undesirable change to the circuit. The two types of noise margins are Alternating Current (AC) noise and
Direct Current (DC) noise. A drift in the voltage levels of a signal causes the DC noise; whereas, the AC
noise is a random pulse created by switching of signals. The ability of the circuit depends on the reliability
to operate in a noise environment.
The advantages of CMOS transistor and BiCMOS are compared with respect to the parameters discussed
are listed as follows:
Advantages of BiCMOS
1. Improved speed over CMOS
2. Low power dissipation
3. Flexible I/Os
Summary
In this chapter, you have learned about the basic transistor technologies and their applications.
The materials used to build transistors are categorized based on their resistivity and conductivity. These
materials are insulators, conductors, and semiconductors. You have also learned about the MOS transistor
fabrication process, which consists of wafer fabrication and device assembling. The wafer fabrication
consists of a sequential set of basic steps: photo masking, deposition, etching, diffusion, and ion
implantation. The pMOS and nMOS transistors dissipate power even when the output is low or high. The
47
Chapter 3
combination of pMOS and nMOS transistors is used to build the CMOS transistor, which dissipates power
only while switching. The processes, such as p-well, n-well, and twin-tub are used to build CMOS device.
These processes are varied based on the type of substrate placed as a foundation to combine pMOS and
nMOS transistors side by side. The major drawback of CMOS circuits is that the total number of
transistors require to build are more than nMOS circuits. BiCMOS circuits are built using bipolar and
CMOS transistors. These technologies are compared with the parameters, such as power consumption, net
delay, noise margins, and power dissipation.
Questions
1. What are the characteristic features of nMOS, pMOS, and CMOS?
2. Define semiconductors. Why semiconductors are used to build transistors?
3. Explain the wafer fabrication process for MOS technologies.
4. Differentiate between p-channel and n-channel.
5. What is ion implantation?
6. Differentiate between dry and wet etching.
7. Explain the physical structure of pMOS and nMOS with diagrams.
8. Explain the switch model of CMOS.
9. Write the differences between the pMOS and nMOS with CMOS technologies.
10. Explain the BiCMOS features when compared with CMOS.
Exercises
1. Explain the merits and de-merits of nMOS, pMOS, and CMOS.
2. Draw the schematic for NOT-gate function using MOS-technology.
3. Study the comparison between the MOS technologies.
4. Study the characteristics of Silicon technology fabrication process and its merits.
5. Study the various fabrication processes for VLSI technology.
48
4
Building Blocks of
a VLSI Circuit
If you need an inforamtion on: See page:
Computer Architecture 50
Memory Architectures 57
Communication Interfaces 59
Mixed Signal Interfaces 61
Chapter 4
In this chapter, you learn about the building blocks used to design very large-scale systems. The design of
logical components, such as multiplexer (MUX), decoder, priority encoder, comparator, memory arrays,
and communication interface concepts, are discussed. Towards the end, you learn about mixed signal
interfaces.
Computer Architecture
While designing a large digital system, such as computer, millions or thousands of individual gates are
required to create the desired system. The basic logic gates (NOT, AND, and OR) are used to create
complex logic designs. As the complexity of the circuit increases, the logic gates required to build the logic
increases. The most difficult task is to keep track of each gate in the circuit for testing and verification of
the design. The other factor is propagation delay, which is a major bottleneck that increases as the level of
the circuit increases. To remove these difficulties, the solution is to use the hierarchical approach where a
complex design or a very large function is defined using a logical or digital component of a system that
represents a specific function with more than one or two gates. These digital and logical components act as
a basic building block for large system design. The logical components of digital systems are MUX,
decoder, priority encoder, magnitude comparator, and bit adder.
The functional description of these components with block diagram is given in the following sections.
MUX
The MUX is a logic circuit that consists of n-input lines and one output as F. The selection of a particular
input line for output is determined by a set of selection inputs. The number of selection inputs (m) to a
MUX is determined as,
m = log2(n)
Where, m - Selection input lines
n – Number of input lines
For example, 2-to-1 MUX has two inputs as i0 and i1 , one output line as F, and one selection line as S. The
block diagram is represented as black box with inputs, output, and selection lines; whereas, the functional
diagram shows the logic circuit represented with gates. The functional table gives the input, output, and
selection inputs information. Similarly, 4-to-1 line MUX has four data inputs i0, i1, i2 , and i3 , one output
line as F, and two selection lines S0 and S1. Figure 4.1 (a), (b), and (c) shows the block diagram, functional
diagram, and functional table of a MUX:
50
Building Blocks of a VLSI Circuit
Multiplexer
Figure 4.1 (c): Displaying the Functional Table of 4 X 1 MUX
MUX is also called data selector since it selects one of many data inputs as output. Generally, more than
one MUXes are enclosed within a single integrated circuit package. Some of the applications of these
MUXes are logic function analyzer/generator, path selection for routing, and parallel-to-serial conversion.
The MUX is considered as a universal logic module since it can be used to design any combinational logic
circuit.
51
Chapter 4
Decoder
A decoder is a digital circuit that converts the binary information from the n coded inputs and produces m
output lines. The value of m is equal to a maximum of 2n unique outputs. The decoders are represented as
n to m line decoders where n is the number of input lines and m is the number of output lines. The
decoder is also referred to as n x m (pronounced as n by m) decoder. The truth table or functional table
gives the behavioral description of the circuit for all the possible combinations of input values. For
example, consider the 2-to-4 line decoder. The truth table for the decoder has two input variables a and b
with four possible combinations of input values as 00, 01, 10 , 11 and four output variables as x, y, w, z.
The output value 1 represents the equivalent binary number of input value. The decoder circuit can be
implemented using the NAND and AND gates. Figure 4.2 (a), (b), and (c) shows the block diagram,
functional diagram, and truth table of a decoder:
52
Building Blocks of a VLSI Circuit
Priority Encoder
An encoder is a combinational logic circuit that converts the 2n input lines into n output lines. The output
lines generate the binary code corresponding to the input value. The output value is based on the input
lines, that is, 2n input lines. A priority encoder is a combinational circuit with m = 2n inputs and n outputs.
Each of the m inputs is assigned a priority. The most significant bit of the input has the highest priority;
whereas, the least significant bit has the lowest priority. The n-bits of the output are represented in binary
form. For example, if n = 2, then m = 4, that is, 22 . The priority encoder is of 4-to-2 line device with four
input lines as i0, i1, i2, and i3 and two output lines as O1 and O2. These encoders are used in the
implementation of interrupt service routine. Figure 4.3 (a), (b), and (c) shows the block diagram, functional
diagram, and functional table of a priority encoder:
53
Chapter 4
Magnitude Comparator
Magnitude comparator is a combinational logic device used to compare two numbers or n-bit numbers
and determines the relation between two numbers. The relation is identified as greater than, less than, or
equal to. In the truth table and logic circuit, two 2-bit numbers and two output lines are identified as the
input and output lines of the circuit. These comparators are used mainly in digital control systems and
digital-to-analog devices. Figure 4.4 (a), (b), and (c) shows the block diagram, functional diagram, and
functional table of a magnitude comparator:
54
Building Blocks of a VLSI Circuit
Bit-Adder
The most basic arithmetic operation is the addition of two binary digits. The combinational circuit that
performs the addition of two bits is called Half Adder. Figure 4.5 (a), (b), (c) shows the block diagram,
functional diagram, and functional table of a Half Adder:
55
Chapter 4
56
Building Blocks of a VLSI Circuit
Memory Architectures
A memory unit is a collection of data stored. The main memory of a computer is used for storing
programs, data, and operands. Memory stores the information in the form of group of bits called words.
These words in memory are organized in square form so that they have an equal number of rows (x) and
columns (y). Each intersection of a row and column comprises a memory word address. Each memory
address contains a memory word. Memory operations, such as read or write, operate on a request,
selection, and initiate basis. The data transfer from memory modules or units can be done in two ways:
serial access and parallel access. The circuits that are designed to access data serially are called shift
registers; whereas, the circuits associated with parallel access are called random memories. The two
different types of random memories used in computer systems are Read Only Memory (ROM) and
Random Access Memory (RAM). Let’s now learn about shifters, ROM, and RAM in detail.
Shifter
Shifter is a logic circuit designed to perform the logical shift left and logical shift right operations. Logical
shift left performs the shift operation on the bits of n-bit register by moving the bits one position to the left
and leaving the rightmost bit value as 0. Similarly, logical shift right performs the shift operation by
moving the bits of n-bit register one position to the right and leaving the leftmost bit value as 0. This
circuit can be designed using either MUXes or transistors. Figure 4.8 (a), (b), (c) shows the logic diagram,
functional table, and functional diagram of a shifter:
57
Chapter 4
Figure 4.8 (c): Displaying the Functional Diagram of a Shifter using a MUX
ROM
ROM is a memory device used to store the binary information permanently. Figure 4.9 (a) shows the block
diagram of ROM device where m is the number of output lines that are equal to the number of bits per
word to be stored in it permanently. The word that is available on the output lines at any given time is
determined by the values (binary information) at the input lines. ROM is constructed using decoders and a
set of OR gates. It is purely a combinational circuit as the data is permanently stored in ROM. An address
is a binary number that denotes one of the minterms of n-variables. The number of distinct addresses
possible with n-input variables is 2n. These circuits are used as basic building blocks in the Very Large
Scale Integration (VLSI) circuits to increase the memory capabilities.
Consider an example to store 1024 bits in ROM. To design the ROM device to store 1024 bits, 10 input lines
are required. Figure 4.9 (b) shows the block diagram of ROM with 1024 lines:
58
Building Blocks of a VLSI Circuit
Figure 4.9(b) – Displaying the Block Diagram of ROM with 1024 Lines
RAM
RAM is designed to access data parallely or randomly from any desired location. The time required to
access memory location is same irrespective of the physical location of data. RAM is also known as read or
write memory as both read and write operations can be performed on it. Read operation refers to the
retrieval of the stored data on demand; whereas, write operation refers to the modification in the stored
data. Each bit or word is stored or retrieved using address lines, which are specified as memory locations
of the data. As both read and write operations can be done randomly, read and write control signals are
used to control these operations. Read control signal is used to access the memory location to transfer the
data from specified address memory location onto output lines; whereas, write control signal is enabled or
activated to modify the data on specified address location by the input data lines. RAM can be classified
into two categories: Static RAM and Dynamic RAM.
Figure 4.10 shows the block diagram of RAM:
Communication Interfaces
The concept of multiprocessor system to meet system performance requirements, such as speed, has
become an attractive design possibility. The components, such as central processing units, I/O processors
connected to input and output devices, and memory units, form a multiprocessor system. The
interconnection among these components can have different physical configurations. These
interconnections are established using physical forms, such as time-shared common bus, multi-port
memory, and crossbar switch, called interconnection networks. Data transmission from one component to
another use these interconnection networks as a medium to transmit the data effectively.
To do this, first and foremost thing is to decide how to encode the data to be sent, that is, its computer
representation. This will differ according to the type of data, such as audio, text, and video.
Data representation can be divided into two categories:
Digital: Refers to a representation where data is encoded as a set of binary values, that is, a sequence
of 0’s and 1’s
Analog: Refers to a representation where data is denoted by the variation in a continuous physical
quantity
59
Chapter 4
SCI
SCI enables serial communication between microprocessors and peripheral devices or within an external
network. It contains data transmitter at the source end and data receiver at the destination end to ensure
serial data transmission. The basic component required to design data transmitter is parallel-to-serial
converter. Similarly, serial-to-parallel converter is used to design a data receiver. Along with these two
devices, enable and interrupt signals are used to perform the transmission of data serially. The speed of
these devices can be programmed based on the requirements. These devices can operate in the
synchronous mode or the asynchronous mode.
In the synchronous mode, the transmitter and receiver are paced by the same clock. The receiver
continuously receives the information at the same rate the transmitter sends it. During the synchronous
transmission, the bits are sent successively with no separation between each character. To ensure the
reliable data transmission, an additional character is necessary to insert that in turn ensures
synchronization between transmitter and receiver modules.
In the asynchronous mode, each character is sent at irregular intervals of time. Both source and destination
does not necessarily act at the same clock. Source can initiate the data transmission by sending a signal to
the receiver. Each character is preceded by some information indicating the start of character transmission
using the START bit. Similarly, each character is followed by some information indicating the end of
character transmission using the STOP bit. The START bit refers to the information that starts the
transmission and STOP bit refers to the information that ends the transmission. Asynchronous data
transmission is used for keyboard, mouse, modem, and serial printer.
The standard SCIs are Universal Synchronous Asynchronous Receiver Transmitter (USART), RS232, RS
422, RS485, Ethernet, Fiber Optics, Bluetooth, and Wi-Fi.
60
Building Blocks of a VLSI Circuit
Summary
This chapter has introduced the basic building blocks of computer hardware system and explained each of
these components and their impact on building efficient architectures. The basic hardware components,
such as MUX, decoder, and priority encoder, are used to select among the input lines onto output lines.
The MUX device is used to select one input among the 2n input lines, and it is also called universal device
because any logic circuit can be implemented using it. Decoder selects among the n-input lines and places
on a 2n-output line. Similarly, priority encoder device selects the input-line based on the priority assigned
61
Chapter 4
to each of the line. Relational operations of the input data are identified using magnitude comparator
device. Adder is an arithmetic device that performs addition of binary bits. Most important part of
hardware component is a device to store and retrieve data. Serial data retrieval is done using shifter
device; whereas, random access is done using random access memories. This chapter has also introduced
main features of communication interfaces. Communication interface devices are classified into serial
communication and parallel communication interfaces. The importance of these interfaces and concepts
are also discussed. Combination of digital data and analog data representation devices are called mixed-
signal devices. This chapter is concluded with insights of mixed-signal interface devices and their major
role in developing embedded system applications that include sensors, actuators, and other supporting
electro-mechanical devices.
Questions
1. Why MUX is called a universal circuit? Explain.
2. Explain the functionality of decoder circuit and its applications.
3. Discuss advantages of decoder and priority encoder circuits.
4. Write the functions of magnitude comparator and explain with circuit diagram.
5. Design n-bit adder with (n-1) delay using n-full adders.
6. Differentiate between synchronous and asynchronous mode of data transfer.
7. Write the applications of shift registers.
8. List the differences between ROM and RAM.
Exercises
1. Design a 16X1 using only 4x1 MUXes.
2. Design a 2-bit magnitude comparator using only NAND gates.
3. Draw the serial data transmission communication interface across serial-to-parallel converter.
4. Discuss the mixed signal interfaces with examples.
5. Design a 4- input NAND gate functionality using a MUX device.
62
5
VLSI Design Issues
If you need information on: See page:
Design Process 64
Design for Testability 64
Technology Options 67
Power Calculations 70
Package Selection 70
Clock Mechanisms 71
Mixed Signal Design 73
Chapter 5
In this chapter, the process of designing the Very Large Scale Integration (VLSI) circuits and issues are
discussed in detail. The testing and verification procedure is been discussed in detail for the circuits.
This chapter describes the importance of testing, test process, design for test, fault models, and test
programs in detail. This chapter also provides an overview of various parameters involved for designing
efficient design of complex circuits with respect to the clock mechanism adopted, power consumption of
the device or chip, and appropriate package mechanism. Brief overview of mixed signal design is also
presented in the chapter.
Design Process
The sequence of steps required for VLSI designs to design a chip with constraints, such as size, area,
power, and delay, is called design process, which can vary on the basis of the type of chip (ASIC or
FPGA). However, the process of designing a VLSI circuit is a highly complex task. As the complexity of
the design increases, the design flow and its verification become tedious. Therefore, the Computer-Aided
Design (CAD) tools are used to ease the process of design flow by using the automation process. The
process for developing a chip from concept to Silicon is been divided into the four tasks. The brief
description of these tasks is given as follows:
1. Design: The process of designing starts with the description of the specifications of the system to be
designed. The description of the design can take place in any of the following three forms:
a. Behavioral Domain: Specifies the hardware implementation of the system’s functionality with
the help of a sequence of register transfer statements
b. Structural Domain: Refers to a domain where the design is described with a set of sub-modules
connected together to function the prescribed behavior based on the users specification
c. Physical Domain: Specifies the layout used to build the system according to the architect’s idea
at the transistor level
2. Verification: The process of verification is done to verify the functionality of a chip that is to be
performed according to its system requirement specification. Verification is an important step for
designing reliable designs. The verification of a design is done at various levels, that is, at the higher
level of abstraction (register transfer level) to the lower level of abstraction (transistor level).
3. Implementation: After the successful completion of the verification process, the required design can
be realized onto the hardware. The process of implementation is done for the physical
implementation of the required function with the actual hardware component that results in an entity
or product, which includes both the logical and physical implementations.
4. Software Development: The verified design with all the necessary hardware components is
considered to convert it into a stream of bits to program onto the target device. Due to this reason, the
task is termed as software development. This is the last task, that is, the process of programming the
brain of the chip for the desired functionality.
64
VLSI Design Issues
What is testing?
Testing is a process of verification. It can be done when a known input is applied to a unit and a known
response can be evaluated. In other words, the response from a circuit is compared with a known response
or a predictable response. The testing process is equally applicable to circuits, chips, boards, and systems
from transistor level, gate level, microcells, chips, and printed circuit boards. Figure 5.1 illustrates the
block diagram of a testing unit:
65
Chapter 5
model varies based on the type of fault. The fault may be classified as undetected, detected, blocked, tied,
redundant, and untestable. Out of these, the undetected faults are those faults that are not detectable by
any test vectors.
Fault model is created to verify the DUT. A fault model identifies the targets for testing the device or chip
behavior. This model helps in analyzing the faults in the system such that to design a testing method, you
need to detect the fault in the circuit. The various fault models are listed as follows:
Single stuck-at faults
Transistor open and short faults
Memory faults
Functional faults
Delay faults
Analog faults
Stuck-at-fault and transistor open and short faults are two common fault models that are used in the
present day verification process. Before learning about the two fault models, let’s first learn about the fault
coverage.
Fault Coverage
Fault coverage is a measure to detect the percentage of faults by the applied test vectors. Testing involves
the detection of all the possible faults in a DUT. Performance of testing process is measured by the
percentage of fault coverage. For example, if a fault coverage is 100%, then the test process and test vectors
detect all the possible faults in DUT. In other words, fault coverage gives the measure of goodness of the
test program. The major issue of design for test is to improve the percentage of fault coverage.
Let’s now learn about the single stuck-at fault and transistor open and short faults models in detail.
66
VLSI Design Issues
Number of stuck-at faults detected by test vector / 2 * (number of nets/wires) in the circuit
Example: For the given circuit (Figure 5.3), there are 12 fault sites to be tested and 24 single stuck-at faults.
The total number of fault sites for any Boolean circuit represented in gates is computed as follows:2 * Total
number of wires (primary inputs + primary outputs + internal wires).
The faults identified in Figure 5.3 are represented with an x mark:
Technology Options
After the circuit is synthesized and verified during the physical implementation stage, the next step is to
fabricate the design onto a Silicon chip. Various options exist for creating the physical realization of a
digital circuit onto a Silicon chip. The two major options to fabricate the chip from the circuit level to the
physical realization are full-custom design and semi-custom design.
Full-Custom Design
A designer can handcraft all the digital circuits, such that it gives the possibility to use special circuit styles
and arbitrary sizing of transistors. Designer has the flexibility to choose the logic. This was the approach
followed in early days of digital design era. In this design methodology, large number of logic gates was
67
Chapter 5
available to a designer where the function and layout of every transistor was customized and optimized
by the designer.
Intel 4004 microprocessor and memory chips are some of the examples of full-custom designs.
Following are the advantages of full-custom designs:
1. High Performance can be achieved since the design can be created from scratch
2. Minimum area can be achieved
3. Maximum speed can be achieved
Following are the disadvantages of full-custom designs:
1. Requires great number of staff and labor
2. High cost and long time to market
3. High cost to design
4. Long time for verification
Semi-Custom Design
In the present day VLSI design era, alternative to full-custom design is semi-custom design method. Semi
means part of the design can be fixed with standard logic, so that each of these modules can be reused in
other designs based on the applications. This approach has shown better results in terms of design time,
cost, and effort. Through automation process, programmability is been achieved which in turn reduce the
design time drastically. Various approaches used to divide the complete design into modules that may be
reused by other designs are as shown in Figure 5.4:
Cell-Based Designs
In this process of design methodology, a logic element implemented by a circuit consists of one or more
primitive gates (AND, OR, and NOT) and universal gates (NAND and NOR). Some additional logic
elements (XOR and XNOR), sequential elements (flip-flops), and complex functions (AND-OR-INVERT,
68
VLSI Design Issues
Multiplexer, Full adder, Comparator, Counter, Decoder, and Encoder) are also included that can be reused
by other designers. These cells are designed, verified, and optimized once, and can be reused many a
times. This reuse property reduces the design cost and time to market tremendously.
Challenging task in this type of cell-based design is to choose the cells and group them to meet the desired
objective. This complexity in library composition may affect area, delay, power consumption, and
dissipation of the circuit.
Following are the advantages of cell-based design:
1. It minimizes the design effort time due to reusable property
2. Pre-designed cells reduce the complexity of the circuit
Following are the disadvantages of cell-based design:
1. Fixed logic elements in library
2. It reduces the possibility of 100% designer’s choice based on objectives
3. Fan-out and fan-in are not known in advance
In general, cell-based designs are divided into three categories:
1. Standard cell-based designs
2. Compiled cell-based designs
3. Macro cell-based designs
Let’s now learn about these categories in brief.
Standard Cell-Based Design—In a standard cell-based design, logic cells are placed in rows that are
separated by interconnections (or routing channels). Each logic cell can be of different size due to fan-
in variations of the cell. When the cells are placed in a row, cells placed in a row must be of same
height, but with different widths. To make connections among the cells that are placed in a row,
routing channels are used. In the standard cell-based design method, interconnection overhead is the
major issue to be addressed.
Compiled Cell-Based Design—In a compiled cell-based design, designers have a choice of
customizing and optimizing the cells. A software library tool generates the cells as a function of user
supplied parameters. These generated cells are placed on cell architecture with predefined technology
rules, such as cell size parameters, power budget, routing style, and contact method.
Macro Cell-Based Design—In this method, macro cells are pre-designed complex designs, such as
multipliers, data paths, memories, and DSPs, and embedded microprocessors. The functionality and
routing within the module is fixed or flexible.
Array-Based Designs
Array-based designs are alternative of cell-based designs. In cell-based designs, the complete process
of fabrication is required, which leads to the delay in introducing the product to the market. On the other
hand, dedication process of fabrication is avoided in array-based designs, which reduces the non-recurring
engineering cost. These designs fall into the following two categories:
Pre-diffused—In this array-based design, array of primitive cells or transistors are manufactured by
the vendor. All the fabrication steps needed to make these primitive cells are standardized and
optimized irrespective of applications. Desired interconnections can be added with only a few
metallization steps. The example of pre-diffused category is Mask Programmable Gate Arrays.
Pre-wired—In this array-based design, all the primitive cells are provided but manufacturing process
is separated from the implementation phase of circuits such that it can be performed at user’s site.
FPGA is an example of pre-wired category.
69
Chapter 5
Power Calculations
Power–aware designs in modern VLSI chips play a major role on VLSI industry. With the continuing
decrease in size and increase in chip density, impact on power consumption of chip has increased.
Clock frequency is another factor that contributes to the power consumption of VLSI design. In recent
years, various applications, such as portable or battery-powered electronics, are inaccessible to vendors,
due to the tight power constraints; and therefore, it has become a major issue for VLSI designers to design
a power optimized VLSI circuits.
Lowering power consumption in the digital circuits would minimize the packaging and cooling costs,
which in-turn leads to the increase in the life span of a chip. High power dissipation or power
consumption leads to the drop down not only in the performance of chips but also in extreme cases, such
as burnouts and damage to circuits. Therefore, extensive researches have been directed towards low
power VLSI circuits.
Power issues in VLSI circuits are addressed in two different aspects: one is to decrease the power
consumption of the VLSI circuits by reducing the logic density and second is to estimate the power
dissipation of the circuit in the early design cycle where the target device can be either ASIC or FPGA.
Let’s now learn about the major sources involved in calculating the power consumption and power
dissipation in VLSI circuits.
To calculate the total power consumption in the digital circuit, one should have the knowledge of
sources involved for power consumption in VLSI circuits. The primary sources of power in VLSI
circuits are as follows: Static powerShort circuit current
Dynamic power
Inductance and resistance of wires
The major contributions to total power consumption in VLSI circuits are static and dynamic power.
Static power, also referred as leakage power, is consumed when a logic circuit is in a quiescent or idle
state. The idle state means without functioning or operating the circuit.
Dynamic power is consumed due to signal transitions in the circuit, that is, switching from 0 → 1 or 1 → 0.
In well-designed circuits, short-circuit current typically represents only 5-10% of dynamic power. There
are two types of signal transitions, given as follows:
Functional transitions—Transitions necessary to perform the required logic functions
Spurious transitions or glitch—Unnecessary signal transition due to the unbalanced path delays to
the input signals of a gate
All the sources of power can be accurately estimated or predicted except the dynamic power because it
depends on the functionality of the circuit and the input vectors that are applied to it. Dynamic power
dissipation or consumption occurs because of switching activity in the circuit. This switching activity is
due to the charging or discharging of the load capacitances.
The power estimation in FPGA designs are calculated by estimating the dynamic power dissipation of the
circuits that are mapped onto FPGA such that the average power consumption of circuits can be estimated
before the fabrication of FPGA to identify the possible power violations during the design process.
Therefore, power estimation is required across the various levels in the design hierarchy to effectively
control and reduce the power consumption of the end product mapped onto the target device.
Package Selection
After the successful completion of verification process, the next step is to place the design onto a board.
Chip package plays a vital role in chip manufacturing, in which the chip resides for plugging into or
soldering onto the printed circuit board. We face the challenge of how to package the monster chips, as we
70
VLSI Design Issues
approach the scenario of having hundreds of millions of transistors, thousands of inputs and outputs, and
hundreds of watts of power on a chip.
Package selection is another major issue that affects the physical design of the circuit. The selection of
the package is based on a number of factors, such as die size, price, chip input, output pins, and
power consumption. The major challenges in package selection are as follows: How to minimize the
signal distortion introduced by the package
How to package the chip efficiently
How to reduce the footprint of the package
The multiple stacked-die System-in-Package (SiP) method is an alternative to the System-On-Chip (SoC)
approach. This is also known as the Multi-Chip Module (MCM).
Traditionally, the system could be constructed using discrete components of individual packages. The SoC
approach packs the multiple dies into one package. These multiple dies are internally connected either by
fine wires that are buried in the package or by using solder bumps to join the stacked chips together.
Clock Mechanisms
A mechanism known as clock allows hardware to operate without requiring the input to change. All the
digital circuits are said to be clocked, which implies that all the components of digital circuit ensure that
they work together. In other words, they are synchronized to do an intended task.
A clock is a mechanism that emits an alternating sequence of logic 0 and logic 1 at a regular interval of
time. The speed of the clock is measured as Hertz (number of clock cycles per second). A clock is an
electrical signal that oscillates between a high state and a low state. It is usually a square wave with a
predetermined period, as shown in Figure 5.5:
71
Chapter 5
72
VLSI Design Issues
In Figure 5.8, first D flip-flop is provided with positive edge-triggered clock and another is provided with
negative edge-triggered clock. This can be extended for any number of components. Another solution to
minimize the clock skew is to provide multiple clocks. As global clock for large systems gives rise to clock
skews, several clocks are used with each clock controlling one part of the system. In particular, clocks that
run at highest rates are used in small physical areas. Though multiple clocks solve the problem of clock
skew, clock synchronization problem arises for large systems. This is an open issue for VLSI designers.
73
Chapter 5
Figure 5.10: Displaying the Ideal Design Flow for Mixed Signal Design
Design flow of mixed signal designs is not well structured as digital systems. Reason behind this design
flow is that digital systems are compatible with the top down approach; whereas, analog designs are
compatible with the bottom up approach. The ideal flow of design process is shown in Figure 5.10. The
digital components are simulated with digital simulators; whereas, analog simulators are simulated with
analog components. Combined top-level designs are simulated and synthesized at the synthesis stage and
finally to the physical design process.
Summary
In this chapter, the process of verification at physical level design is been discussed in detail. Verification
is a process of identification of faults in the systems. Faults in a system lead to failures of the chip. In
general, faults occur due to power failures or short circuits. Functional faults, memory faults, transistor
faults, and analog faults are some of the faults occur in VLSI systems. Fault models are developed to detect
faults. Single stuck-at fault model is one of the fault models to detect functional faults. Design for
testability is a process to design a set of models to detect the faulty chips based on functional behavioral.
Fault coverage factor determines the quality of the design for testability process to detect the faults. Full-
custom and semi-custom designs are the two major technology options to fabricate the design onto Silicon.
Full-custom designs are suitable for microprocessors; whereas, semi-custom designs are used for
designing embedded processors. Clock mechanism, power calculations, and package selection are other
important criteria to design reliable chips. Power calculations give input for package selection based on
cooling capacity requirements. Finally, mixed signal design systems and ideal design flow is been
discussed in this chapter.
Review Questions
1. Write the differences between faults and fault coverage.
2. Explain the stuck-at fault model with example.
3. Define controllability and observability.
4. Design a procedure to detect the untestable faults.
5. Explain any method to minimize the clock skew in digital systems.
6. What is dynamic power and static power?
7. Write a procedure to estimate the total number of toggles of a XOR gate using NAND realization in a
cycle.
8. Write the advantages and disadvantages of cell-based and array -based designs.
9. Give two reasons about the importance of package selections.
10. Write the differences between detectable and undetectable faults.
74
6
EDA Tools: An Overview
If you need information on: See page:
EDA 76
Architecture Design 79
Design Entry 81
Synthesis Tools: XST, Synplify, and Leonardo Spectrum 83
Functional Verification 97
Timing Verification 99
On-Chip Debugging 99
Chapter 6
To achieve large-scale integration, the importance of tools cannot be overemphasized. The ultimate
objective of tools is to automate the entire design process. Of course, we are nowhere near achieving this
ultimate objective, but certainly, the present available tools are sophisticated enough to represent the
design of a system at an abstract level (block diagrams level) or using Hardware Description Language
(HDL). The tools that help in converting this representation of the design into the chips are the Electronic
Design Automation (EDA) tools. In this chapter, an overview of some of the popular EDA tools is given.
As there is a good demand for such tools, a very large number of tools are available in the market. This
chapter is an attempt to describe some tools that help in understanding the role of tools in chip design.
EDA
With the advent of advanced technologies, shrinking size of transistor leads to an extent where millions of
transistors can be built on a single integrated chip. Design of Very Large Scale Integration (VLSI) circuits
with very complex combinational or sequential circuits is made easy to integrate on a single chip. Due to
the complexity involved in these circuits, the manual process of designing, testing, and verification of the
designed circuits on breadboard has become a tough task. Therefore, designers felt the necessity to
automate the design flow of logic circuits. EDA or Computer Aided Design (CAD) tools are evolved to
automate the process of design flow for electronic circuits. EDA is a software tool used to provide the
automation procedure to design and verify circuits.
Till 1960s, circuits were drawn manually on drafting boards. During 1960s to 1970s, CAD was used to
create the schematics (layout of the circuit) and analyze the functionality of designs. During 1980’s, CAD
or EDA tools were introduced for designing complex electronic circuits. EDA for electronics has rapidly
gained importance with the enhancements in technology.
Several companies that specialize in EDA tools are Cadence Design Systems, Magma Design Automation,
Synopsis, Mentor Graphics, and Xilinx. These tools perform the logic optimization and functional
verification (logic synthesis). In addition, these tools help in transform the synthesized netlist to an
equivalent hardware implementation file for an Application Specific Integrated Circuit (ASIC) or Field
Programmable Gate Array (FPGA).
Some of the leading software vendors for EDA tools are given as follows:
Altera
Magma Design Automation
Mentor Graphics
Microwind
Synplicity
In addition to these commercial tools, various open source tools are used extensively in the academic
institutions.
Taxonomy of Tools
The tools, broadly categorized based on the flow of design process, are given as follows:
Front-end tools
Back-end tools
Front–End Tools
The steps involved in designing with the help of flow diagram for the required logic are shown in
Figure 6.1:
76
EDA Tools: An Overview
77
Chapter 6
Back-End Tools
The back-end process takes place after the synthesis step successfully completes the design process. The
steps in the process of back-end design are shown in Figure 6.2:
78
EDA Tools: An Overview
Microwind Tools
Microwind Inc. (www.microwind.net), based in France, has a set of powerful tools for both front-end and
back-end for VLSI design. These tools include features that are listed as follows:
The front-end tool, DSCH, is a schematic editor and a simulator used to generate an equivalent
Verilog Register Transfer Language (RTL) code description for the given schematic in the layout
editor
VirtuosoFab is a three-dimensional (3D) fabrication process simulator with cross sectional viewer
feature
MEMsim is a simulator that simulates the non-volatile memory (EPROM, EEPROM, and Flash)
PROthumb is used for mixed signal simulation and analysis of the design
Xilinx Tools
Xilinx Inc. (www.xilinx.com) has a set of tools for simulation, synthesis, and power estimation for VLSI
designs. These tools also include front-end and back-end tools for FPGA design, on-chip verification tool,
and timing analysis tool for both ASIC and FPGA designs. Some of the Xilinx tools are given as follows:
1. ISE® Simulator—It provides a complete, full-featured HDL simulator.
2. XST Synthesis—It provides the simulation, placement and route, and bit generation stream for FPGA
and ASIC designs.
3. PlanAhead Design and Analysis—It provides timing analysis of the designed circuit, structure of the
components, and wiring between the components and enables the routing feature.
Architecture Design
The major challenges to design a digital system are that it must execute the desired function and meet the
area, performance, and timing constraints. During the design process, modeling is an important aspect to
meet the required specifications. The HDLs allow designing any digital systems using RTL at various
levels of abstraction. The two major approaches followed in the process of design flow are top-down
approach and bottom-up approach.
79
Chapter 6
Top-Down Design
This is one of the approaches to design any digital system from simple to complex design. The design
starts at the highest level of a design concept as specifications, algorithm, and implementation using HDL
and proceeds towards the lowest level, that is, gate level netlist.
The top-down design methodology takes the HDL model of hardware as an abstract level input. The
design steps down until gate or transistor level of the circuit. Figure 6.3 represents the top-down design
flow for electronic hardware component:
Bottom-Up Design
This design approach is a traditional method of electronic design. Each design is performed at gate level
using standard gates. The basic logic units, such as primitive gates, adders, and registers, are designed as a
first step in the design process. These are combined to create designs that are more complex. This
approach is best suitable for small projects, such as arithmetic logic unit, parallel adder, and Wallace tree
multiplier. As the complexity of circuit increases, this approach is not suitable. For example, 64-bit
microprocessor is difficult to design using the bottom-up design approach, as there are large numbers of
complex designs to be designed using existing logical components.
80
EDA Tools: An Overview
Design Entry
The purpose of design entry is to describe the digital electronic systems to EDA tools.
During the design entry stage, designers have several options for the selection of tool to enter the design
specifications, to simulate and synthesize using EDA tools. The purpose of these design entry tools are
given as follows:
1. To reduce the effort to enter the design specifications as input to EDA tool
2. To reduce the size and cost of the system
3. To estimate the power parameters, such as power consumptionTo increase the productivity of the
electronic systems
4. To increase the reliability
After the design specifications are ready, a design entry tool is selected to enter the design into an
automation tool to analyze the functionality of the circuit. Some of the popular automation tools used to
enter the design are listed as follows:
1. Schematic editor
2. VHDL editor
3. Verilog editor
4. Block editor
5. Third party editor
Let’s discuss the features of these editors in detail.
Schematic Editor
Schematic editor is a drawing tool editor that provides the following features:
1. It shows the connectivity of all the components of a design
2. All the components are created using built-in objects, and connectivity between them is established
using nets
3. Nets are represented as a direction line, which is used to show the interconnections of a design
4. Netlist is generated for the given schematic as input to the schematic editor
5. All the components in a design and their interconnections are either in the binary or American
Standard Code for Information Interchange (ASCII) format
6. The complex components can be arranged in the following two ways:
a. Hierarchical design
b. Flat design
Hierarchical design of 4x1 multiplexer is shown in Figure 6.4:
81
Chapter 6
Figure 6.4
Flat design of 4x1 and 2 X 1 multiplexer is shown in Figure 6.5:
Figure 6.5 Flat design of 2x1 Multiplexer and 4XI Multiplexer
Figure 6.5
Block Editor
The block editor tool provides features to enter and edit schematics. This editor reads and edits block
design files. Each block design file contains blocks and symbols that represent logic in the design. This
editor also incorporates the design logic represented by each block diagram, schematic, or symbol into the
project. The block editor helps in connecting blocks and primitives that include both data path connections
and mapping signals.
82
EDA Tools: An Overview
83
Chapter 6
Figure 6.7: Displaying the New Project Wizard – Create New Project Window
2. Type a name for the project in the Project Name field.
3. Browse to a location or enter a location (directory path) for the new project in the Project Location
field.
4. Select an option from the Top-Level Source Type list. In our case, we have selected HDL.
The options in the Top-Level Source Type list are as follows:
i. HDL—Choose this option for VHDL / Verilog
ii. Schematics—Choose this option to work on Schematics
iii. EDIF—Choose this option to skip project navigator synthesis process and to start the
implementation process
iv. NGC/NGO—Choose this option to skip project navigator synthesis process and to start the
implementation process
5. Click the Next button to open the New Project Wizard – Device Properties window, as shown in
Figure 6.8:
Figure 6.8: Displaying the New Project Wizard – Device Properties Window
6. Enter the values in the Device Properties table as follows:
Product Category: All
84
EDA Tools: An Overview
Family: Vertex4
Device: XC4VFX12
Package: SF363
Speed: -10
Top-Level Source Type: HDL
Synthesis Tool: XST (VHDL/Verilog)
Simulator: Modelsim-SE VHDL
7. Select the Enable Enhanced Design Summary checkbox.
8. Click the Next button to proceed. The New Project Wizard – Create New Source window appears, as
shown in Figure 6.9:
Figure 6.9: Displaying the New Project Wizard – Create New Source Window
9. Click the Next button, as we are using an existing source. The New Project Wizard – Add Existing
Sources window appears, as shown in Figure 6.10:
Figure 6.10: Displaying the New Project Wizard – Add Existing Sources Window
85
Chapter 6
10. Click the Next button to proceed. The New Project Wizard - Project Summary window appears, as
shown in Figure 6.11:
Figure 6.11: Displaying the New Project Wizard – Project Summary Window
11. Click the Finish button to complete the creation of new project. The New Project Main Screen appears,
as shown in Figure 6.12:
Figure 6.12: Displaying the Project Window after Creating the New Project
Perform the following steps to create VHDL/Verilog source code:
1. Select a device from the Sources tab in the Sources panel. In our case, we have selected XC4VSX35-
10ff668 (Figure 6.12). A pop-up menu appears.
2. Select New Source from the pop-up menu. The New Source Wizard – Select Source Type window
appears (Figure 6.13).
86
EDA Tools: An Overview
3. Select VHDL Module as a type of source from the list box and enter the file name of the source code as
Counter in the File name field, as shown in Figure 6.13:
Figure 6.13: Displaying the New Source Wizard – Select Source Type Window
4. Click the Next button. The New Source Wizard – Define Module window appears (Figure 6.14).
5. Declare the ports for the entity (which contains all the inputs and outputs) by filling the port
information, as shown in Figure 6.14:
Figure 6.14: Displaying the New Source Wizard - Define Module Window
You can skip the window if you do not want to declare the entity now.
6. Click the Next button. The New Source Wizard – Summary window appears, as shown in Figure
6.15:
87
Chapter 6
88
EDA Tools: An Overview
-- Filename: Counter.vhd
-- Create Date: 01/18/2009
-- Module Name: Counter
-- Project Name: Counter
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 8.1i
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
----------------------------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--entity Declaration
entity Counter is
Port (c: in STD_LOGIC; --Input
clr: in STD_LOGIC; --Input
q_out: out STD_LOGIC_VECTOR (3 downto 0) --output
);
end Counter;
--architecture Declaration
--signal Declaration
begin
process(clr,c)
begin
if (clr='1') then
89
Chapter 6
end if;
end process;
end Behavioral;
Simulation process takes place by selecting the Check Syntax option in the Xilinx XST tool. Perform the
following steps to check the syntax and simulate and synthesize the design:
1. Verify whether the Check Syntax option is available in the Process window (Figure 6.17). After saving
the code, you need to check whether the syntax is correct or not. This is done by using the Check
Syntax option.
2. Right-click the Check Syntax option if it is available. A pop-up menu appears.
3. Select the
4. Run option from the pop-up menu.
5. Select the Synthesize-XST option from the Process window to expand it, if the Check Syntax option
is not available. From the expanded list, select the Check Syntax option.
The Process “Check Syntax" completed successfully message is displayed in the Transcript window if the
architecture behavioral of Counter entity is up to date, as shown in Figure. 6.17:
If there are errors, modify the code and follow the procedure to keep checking the syntax until the code is error-free.
5. Verify whether the Synthesize-XST option exists in the Process window after getting the Process
"Check Syntax" completed successfully message.
6. Select Synthesize-XST Right-clickRun in the Process window, if the option exists in the window.
90
EDA Tools: An Overview
7. Select Source window Module Name (Counter) Set as Top Module, if the Synthesize-XST
option does not exist in the Process window. Several options appear as a list in the Process window.
Select the Synthesize-XST option from the list and follow the procedure in the step 6.
The Process "Synthesize" completed successfully message appears in the Transcript window, if the
synthesize step is completed without error, as shown in Figure 6.18:
91
Chapter 6
This file contains the detailed information about the Synthesis Report, Design Hierarchy, HDL
Synthesis Report, Low Level Synthesis, Device Utilization Summary, and Timing Constraints.
10. Select Synthesize-XST RTL SchematicRun to view the RTL Schematic of the module.
The RTL Schematic window appears, as shown in Figure 6.20:
92
EDA Tools: An Overview
93
Chapter 6
94
EDA Tools: An Overview
95
Chapter 6
For the fastest runtime, set the effort level to std; for the best performance, set the effort level to high; and for a balance
between the fastest runtime and the best performance, set the effort level to med.
The second option in the Place and Route menu is Clock Region Report. If the process is completed
successfully, then the Process "Clock Region Report" completed successfully message appears in the
Transcript window. It will generate a file in the main text window named Clock Region Report for the
module. The generated file contains all the information about Clock Reports by Clock Regions.
The third option in the Place and Route menu is Asynchronous Delay Report. If the process is completed
successfully, then the Process "Asynchronous Delay Report" completed successfully message appears in
the Transcript window. It will generate the file in the main text window named Asynchronous Delay
Report for the module. The file contains all the information about the delay parameters. For the Counter
module, the results are the 20 worst nets by delay.
The fourth option in the Place and Route menu is Pad Reports. It will generate a file in the main text
window named Counter_pad.txt for the module. The generated file contains the information about
Pin Number, Signal Name, Pin Usage, Pin Name, Direction, IO Standard, IO Bank Number, Drive
(mA),Slew Rate, Termination, IOB Delay, Voltage, Constraint, DCI Value, IO Register, and Signal
Integrity.
The important option in the Place and Route menu is Analyze Power of the designed circuit. The process
is started as Implement Design ---> Place and Route--->Analyze Power (XPower)--->Right click-----
>Run. If the process is completed successfully, then the Process "Analyze Power (XPower)" completed
successfully message appears in the Transcript window and it generates a new window of Xilinx XPower.
The Xilinx XPower window contains all the information regarding the values, such as Voltage(V),
Current(mA), Power(mW), Data Types, and Report views, as shown in Figure 6.25:
Figure 6.25: Displaying the Xilinx XPower Window to Analyze the Power
The Power Report can be generated using an option in the menu of Place and Route as Implement Design
---> Place and Route--->View XPower Report----->Right click--->Run. If the process is completed
successfully, then it will generate a report named Power Report of the module regarding the power
summary and the temperature summary in the main text window of Xilinx, as shown in Figure 6.26:
96
EDA Tools: An Overview
Functional Verification
EDA refers to a set of computer programs used to facilitate the design and physical realization of
electronic circuits. Typically, this can be done on a chip or Printed Circuit Board (PCB), and involves
layout, verification, and performance simulation of electronic circuits. The most important factor in these
tools is the verification process. Verification is a process of examining the behavior of the implementation.
In other words, verification implies pre-silicon testing, that is, functional verification of Verilog or VHDL
RTL code. Functional verification is essential in the development of complex digital design. To verify
whether the chip is functionally correct, exhaustive check is required to ensure the correct behavior. As the
complexity of the circuit increases, the search state space increases. To overcome this, verification process
takes place for sub-components of chip and finally, stitched these components after the completion of
verification process for all its sub-components.
Standard procedure of verification is done at each level of the design. The various levels at which the
verification is done are system level, abstract level, and board or chip level testing. Functional verification
and equivalence checking are the systematic procedures to verify the design at abstract level.
General procedure of verification is done at each level of the design. The components at abstraction level
are verified with the functional behavior with the set of data inputs. The datasets, also called stimulus, are
applied to design and verify the functional behavior with respect to the given specifications.
The major challenges in verification process are as follows:
Total amount of space
Detection of incorrect behavior
Reference model to verify the design
Parameters to measure functional coverage
EDA tools are used to design automatic test pattern generators called functional verification tools. These
tools generate the test vectors to perform the logic simulation of the circuit. Two types of verification
methods are used: black box verification and white box verification. The black box verification method
includes Simulation and Emulation; whereas, the white box verification method is used for formal
verification called Assertion-based Verification.
97
Chapter 6
98
EDA Tools: An Overview
designs, the assertion notifies to designers at the end of design process. This report helps to re-design the
process to ensure the correctness of the circuit.
Some of the commercial verification tools available in the market are as follows:
i. Verilog–XL—It is a compiler and functional simulator for Verilog code
ii. NC-Verilog—It is a compiler and functional simulator for Verilog code
iii. VCS tool—It is a fastest compiler and functional simulator for Verilog RTL code
iv. Modelsim—It supports systemC, Verilog, SystemVerilog, and VHDL
v. Specman—This simulator is for ‘e’ Hardware Verification Language (HVL)
vi. Vera—This simulator is for VERA HVL
Timing Verification
Timing verification is the process of determining that a given design can be operated at a specific clock
frequency without errors. In other words, timing verification determines whether timing requirements are
being met to ascertain the absence of timing violations, such as setup time, hold time, inertial delay, and
transport delay. For example, if the data input of a latch arrives after closing the edge of the clock or if the
data input changes before the closing edge of previous clock, then violation occurs. As the latch is level
sensitive clock, this type of violation is highly predictable.
Timing analysis is classified into two methods: static and dynamic. The differences between these two
approaches are listed as follows:
On-Chip Debugging
As the design complexity increases, the complexity involved in the functional and timing verifications
increases exponentially. Functional verification using simulation is a highly complicated task. To simplify
the verification process of high performance processors or VLSI designs, on-chip debugging is introduced.
On-chip debugging means built-in microprocessor debugging. Addition of on-chip hardware is embedded
on the chip itself to diagnose the system. Software program monitors the hardware functionality and
generates the reports. Some of the EDA tools that support on-chip debugging and its software are listed as
follows:
Altera product: Quartus-II software with on-chip debugging using external interfaces as SignalProbe
and External Logic Analyzer
99
Chapter 6
Summary
This chapter has described the design automation procedure for VLSI design process and the
characteristics of such design as a foundation for understanding CAD systems. EDA refers to a set of
computer programs used to facilitate the design and physical realization of electronic circuits. Typically,
this can be on a chip or PCB, and involves layout, verification, and performance simulation of electronic
circuits. The two major approaches to design the complex circuits are discussed and in present day
scenario, both approaches are combined to design the digital circuits. The various tools and vendors
associated with front-end and back-end tasks are listed with brief description of editors. Finally, the
synthesis and simulation results simulated using Xilinx tools are discussed with all the parameters of the
design constraints, such as area and power. Simulation procedure using deterministic and random
approaches gives the detailed verification of the logical components. Static and dynamic timing
verification and on-chip debugging sets the stage for the computer-aided design tools described in this
book.
Questions
1. Write the importance of EDA tools. Explain the process of design flow for ASICs and FPGAs.
2. What is the difference between top-down design approach and bottom-up design approach? Illustrate
with example.
3. What is the major bottleneck in design automation tools?
4. Illustrate the functional and timing verifications for a 2x2 multiplier circuit.
5. Write the test vectors for logic simulation of 4x1 multiplexer.
6. Discuss the factors involved in timing verification for large circuits.
7. Why on-chip debugging is required to verify the circuits?
Exercises
1. Write the procedure to design 8x1 multiplexer with only 2x1multiplexers using top-down approach.
Draw the design process flow.
2. Draw the flow-chart to design a 4-bit parallel adder and full adder with bottom-up approach.
3. Give two examples where top-down and bottom-up approaches are required to design a given task.
4. What is the difference between simulator, emulator, and on-chip debuggers? Explain the differences
with example.
5. Explain why timing verification is a necessary step in the process of design flow.
6. Generate the simulation report using Xilinx ISE tool for a grey code to binary code converter.
7. Generate the random test vectors to verify the 2-bit binary counter.
8. List some verification tools and its features in detail.
100
7
HDL Simulation
and Synthesis
If you need an information: See page:
Overview of VHDL 102
Overview of Verilog 127
Simulation 136
Synthesis 137
Behavioral Modeling 140
Timing Analysis 141
RTL Simulation 141
VITAL Simulation 141
Chapter 7
This chapter introduces the fundamentals of the VHDL and Verilog Hardware Description Languages
(HDL). These languages are used to implement and analyze primitive gates as well as complex
combinational and sequential logic circuits. Verilog is popular in North America and Japan; whereas,
VHDL is popular in Europe. A detailed description of VHDL and Verilog code structure to write an
expression of subsections within a design unit, such as assignments, expressions, operands, and operators,
is given. A study on basic constructs of VHDL and Verilog is discussed with examples including
simulation and synthesis details. A detailed description is given to verify the design and synthesize the
circuit using Electronic Design Automation (EDA) tools.
Overview of VHDL
VHDL stands for VHSIC Hardware Description Language. VHSIC is an abbreviation for Very High Speed
Integrated Circuit. Nowadays, VHDL is a very popular language along with Verilog for simulation,
modeling, documentation, and synthesis of high-speed integrated circuits. Due to complex circuits for
large systems, entering the circuit schematic manually is a very difficult task. Therefore, VHDL or Verilog
can be used to describe a system. In addition, writing Boolean expressions using any of these languages is
similar to a programming language method.
VHDL is a very popular language particularly in the academic community. However, the academic
industry uses both Verilog and VHDL equally well. The VHDL language was introduced in the year 1983
by the joint effort of IBM, Texas Instruments, and Intermetrics. The Institute of Electrical and Electronics
Engineers (IEEE) standardized this language in the year 1987 as IEEE1076 and revised to IEEE 1076 in
1993. VHDL has set a new standard for modeling Application Specific Integrated Circuit (ASIC) and Field
Programmable Gate Array (FPGA) libraries.
A system described using VHDL has a number of advantages, which are given as follows:
Documenting the design—Instead of explaining the design in natural language sentence, if the
design is expressed in VHDL, then it will result in a very precise description of the system with no
ambiguities.
Modeling and simulation of the system—A system can be modeled and simulated on a desktop or
workstation and its behavior can be studied without actually implementing the prototype. This saves
lot of time and cost. VHDL is used not only for modeling and simulation of electronic systems but
also for electromechanical and chemical systems.
Synthesis of the system—Tools are available that can take the VHDL input and generate the circuit
diagram using primitives, such as gates and flip-flops.
A system can be described in VHDL in one of the two forms:
Behavioral description—In this description, the system is described based on how it works and not
based on how it is implemented. The relationship between the input and output signals is specified
using sequential or concurrent statements. The two approaches in this description style are data flow
model and algorithmic flow model. In data flow model, the system is described using concurrent
statements in VHDL that are executed in parallel as soon as the data arrives at input. The register
transfer statements are used to write the concurrent statements. On the other hand, in algorithmic
flow model, the statements describe the sequence of flow of execution of the statements as per the
system requirements.
Structural description—In this description, the system is described based on how it is implemented.
In other words, the system is described in terms of interconnection of gates to perform a desired
function.
Let’s observe the difference between two description styles in the following example.
102
HDL Simulation and Synthesis
Primary Units
The design units that are visible in library are called primary units. The primary design units are
configuration declaration, entity declaration, and package declaration. These declarations act as an
interface to the external world that defines the input and output signals.
The primary units are described as follows:
Configuration declaration—A configuration declaration describes the binding between the entity and
architecture. Single configuration can specify multiple entity architecture bindings.
Syntax for the configuration description is as follows:
configuration identifier of entity_name is
[ declarations…]
end architecture identifier ;
Package declaration: The global variable declarations are declared using the package declaration
design entity. The variables declared in package declaration are treated as global variables and are
accessible across multiple design units. Syntax for the package description is as follows:
package identifier is
[declarations…]
end package identifier;
Entity declaration: An entity declaration describes the interface of a design entity through which it is
communicated to other entities in the same environment. An entity provides the port information of a
particular design entity while the architecture provides the functional body description of a design
entity. In other words, it describes the interface of a design entity through which it communicates
with other design entities. The interface includes the output, input, and bidirectional signals defined
in port declaration section.
Syntax for the entity description is as follows:
entity <entity_name> is
port(
port assignments
...
);
103
Chapter 7
The name of the system is the name of the entity itself. The port statement involves declaration of the
inputs and outputs of the design. These input and output ports act as an interface to the design, and the
declarations are read or set within the accompanying architecture.
For example, to describe a system MobilePhone, its entity is written as follows:
entity MobilePhone is
….
end entity MobilePhone;
Similarly, if the system to be described is CDROM, then its entity is written as follows:
entity CDROM is
….
end entity CDROM;
Again, if the system to be described is a basic gate, such as AND gate, then its entity is written as follows:
entity ANDGATE is
Secondary Units
The design units that are not visible in library are called secondary units. These units are interconnected
components of the design. The secondary units in VHDL are package body declaration and architecture
body declaration. These are discussed with the syntax as follows:
Package body declaration—Package body declaration is associated with the package declaration.
This declaration is used to implement the subprograms declared in the package declaration. Syntax
for package body description is as follows:
package body identifier is
[ declarations]
end package body identifier ;
Architecture body declaration:—Architecture body declaration is used to implement a design entity.
There can be more than one architecture for a design entity. The architecture can be described as a
behavior style, structural style, or data flow style. Syntax for architecture body description is as
follows:
architecture identifier of entity_name is
[ declarations]
begin -- optional
[ statements]
end architecture identifier ;
104
HDL Simulation and Synthesis
In addition, it is important that every file should have a header that contains the following information
about the file:
-- File name:
--Purpose:
--Development tools used:
--Author:
--Known bugs if any:
--Version history
--version no. 1.0 dated 12 Jun 2010
This type of header will be very useful for the maintenance of code.
Library
The VHDL library contains the design elements that can be used in VHDL source files to design any
digital systems. These libraries are platform independent. These libraries are user defined and built in
packages. To use the packages defined in a library, the use statement is used in VHDL. The syntax of the
use statement is given as follows:
Syntax:
Library < library_name>;
use < library_name > <package_name> [all|<part>];
The standard library IEEE is used and its package, IEEE.numeric_std.all is defined using the library
statement and the use statement respectively as follows:
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
Identifiers
VHDL identifier consists of letters, digits, and underscores (_). An identifier is used to give a name to a
data object. A VHDL identifier is case insensitive.
For example: a1, sum, carry12, and carry_1.
105
Chapter 7
Syntax:
type type_name_identifier is array (range integer_range) of std_logic;
type type_name_identifier is record (range integer_range) of std_logic;
Data Objects
Data object is a collection of possible values of any data type. Depending on the type of data that holds
varies the name of the object. The different data types that are supported in VHDL are signal, constant,
variable, and file.
In the next subsection, you learn how to implement commonly used digital circuits in VHDL. You also
learn how to use Xilinx ISE and ModelSim together for the simulation. In addition, you learn how the
resources of a Xilinx FPGA device are utilized for each circuit.
When you implement a circuit in an FPGA, it is important to find out the resources utilization. This knowledge is very
useful when you have to actually design hardware built around an FPGA, as you need to estimate the FPGA resources
required.
NOT Gate
The function of a single input NOT gate is to invert the input. Figure 7.1 shows a NOT gate:
0 1
1 0
VHDL Implementation
Following is the VHDL implementation of NOT gate:
-- File name: NotGate.vhdl
-- Create Date: 11:13:21 17/03/2010
-- Module Name: NotGate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 10.1i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
---------------------------------------------------------------
--library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
106
HDL Simulation and Synthesis
end NotGate;
begin
end NotGateArch;
Simulation Results
Modelsim 6.0 simulator is used to test the design and generate waveforms for the given input test vectors.
This simulator generates the waveform for all the possible input vectors to the given design. The timing
summary and device utilization summary reports are given for each VHDL code segment for information
about resource utilization. The Xilinx ISE tool generates these reports. The details of speed grade and
maximum combinational path delay are given in the timing summary report. The speed grade influences
various timing parameters in the FPGAs, such as logic blocks and memory blocks. To meet the timing
constraints of the target device, the speed grade is considered as high or low based on the target device
speed. For the Virtex -4 device, speed grades are -10 (slowest), -11, and -12 (fastest); whereas, for the
Virtex-5 device, speed grades are -1 (slowest), -2, and -3 (fastest). Combinational path delay is defined as
the longest path delay from the primary input to primary output. The device utilization summary report
displays the detail information related to the logical components in terms of slice and Look Up Table
(LUT) required to implement the given design. The utilization ratio of slices, LUTs, and I/O blocks
information is generated by the Xilinx ISE tool in the synthesis report. The total number of slices in target
device is 5472, number of LUTs is 10944, and I/O buffers are 240. For all the basic gates, VHDL and
Verilog code fragment is given with simulation waveforms and device utilization summary.
Timing Summary
Speed grade: -10
Minimum period: No path found
Minimum input arrival time before clock: No path found
Maximum output required time after clock: No path found
Maximum combinational path delay: 6.415ns
107
Chapter 7
OR Gate
The output of the two-input OR gate is high when any one of the inputs is high or when both the inputs
are high. When both the inputs are low, the output is low. The two-input OR gate takes two inputs,
inputs(1) and inputs(0), as shown in Figure 7.3:
108
HDL Simulation and Synthesis
VHDL Implementation
Following is the VHDL implementation of OR gate:
-- File name: OrGate.vhdl
-- Create Date: 11:26:37 17/03/2010
-- Module Name: 2 Input OrGate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.1i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- entity declaration
entity OrGate is
-- input ports
-- output ports
end OrGate;
-- architecture declaration
109
Chapter 7
begin
end OrGateArch;
Note that we have taken the two inputs, inputs(0) and inputs(1), as a vector.
110
HDL Simulation and Synthesis
AND Gate
The two-input AND gate’s output is high only when both the inputs are high. The two-input AND gate is
represented, as shown in Figure 7.5:
VHDL Implementation
Following is the VHDL implementation of AND gate:
-- File name: AndGate.vhdl
-- Create Date: 09:47:22 18/03/2010
-- Module Name: 2 Input AND Gate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i, ModelSim SE 6.0
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--entity declaration
entity AndGate is
-- input ports
111
Chapter 7
-- output ports
end AndGate;
-- architecture declaration
begin
output <= inputa AND inputb;
end AndGateArch;
112
HDL Simulation and Synthesis
NOR Gate
The NOR gate is a two-input gate whose output is high when both the inputs are low. When any one of
the input is high, then the output is low. The block diagram of NOR gate is shown in Figure 7.7:
VHDL Implementation
Following is the VHDL implementation of NOR gate:
-- File name: NorGate.vhdl
-- Create Date: 10:51:58 17/03/2010
-- Module Name: 2 Input Norgate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
------------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--entity declaration
entity NorGate is
-- input ports
113
Chapter 7
-- output ports
end NorGate;
-- architecture declaration
begin
end NorGateArch;
114
HDL Simulation and Synthesis
NAND Gate
The output of the two-input NAND gate is high when one of the inputs is low. However, when all the
input values are high, the output is low. The realization of NAND gate is as shown in Figure 7.9:
VHDL Implementation
Following is the VHDL implementation of NAND gate:
-- File name: NandGate.vhdl
-- Create Date: 10:27:48 19/03/2010
-- Module Name: 2 Input NandGate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-----------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- entity declaration
entity NandGate is
-- input ports
-- output port
end NandGate;
115
Chapter 7
begin
end NandGateArch;
The simulated results for the NAND gate are shown in Figure 7.10:
116
HDL Simulation and Synthesis
XOR Gate
The output of the two-input XOR gate is high when both the inputs are different. However, when both the
inputs are same, output is low. Realization of XOR gate is shown in Figure 7.11:
VHDL Implementation
Following is the VHDL implementation of XOR gate:
-- File name: XorGate.vhdl
-- Create Date: 12:26:35 20/03/2010
-- Module Name: 2 Input XorGate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- entity declaration
entity XorGate is
-- input ports
-- output ports
117
Chapter 7
end XorGate;
-- architecture declaration
begin
end XorGateArch;
The simulation results of the XOR gate are shown in Figure 7.12:
118
HDL Simulation and Synthesis
XNOR Gate
The output of the two-input XNOR gate is high when both the inputs are same. However, when the input
values are different, output value is low. Figure 7.13 shows the XNOR gate:
VHDL Implementation
Following is the VHDL implementation of XNOR gate:
-- File name: XnorGate.vhdl
-- Create Date: 12:11:45 20/03/2010
-- Module Name: 2 Input XnorGate
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
----------------------------------------------------------------
--library declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- entity declaration
entity XnorGate is
-- input ports
-- output port
119
Chapter 7
end XnorGate;
-- architecture declaration
begin
end XnorGateArch;
The simulation results of the XNOR gate are shown in Figure 7.14:
120
HDL Simulation and Synthesis
D Flip-Flop
The feature of D flip-flop is that it can hold the last value stored; and therefore, can be considered as a
basic memory cell. Figure 7.15 shows a positive edge triggered D flip-flop:
VHDL Implementation
Following is the VHDL implementation of D flip-flop gate:
-- File name: D-FlipFlop.vhdl
-- Create Date: 09:45:09 21/03/2010
-- Module Name: D-FlipFlop
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
--------------------------------------------------------------------
121
Chapter 7
--Libarary declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--entity declaration
entity Dff is
--inputs
-- architecture declaration
--signal declaration
-- process sync
begin
else
if enb ='1' then -- enable input(active high)
122
HDL Simulation and Synthesis
else
tempq <= '0';
end if;
end if;
end if;
end process sync;
-- process async
begin
end if;
end if;
end process async;
123
Chapter 7
Number of GCLKs 2 32 6%
Based on the device utilization summary, the number of LUTs required to synthesize the design is 3;
whereas, slices are 2.
Simulation Results
The simulation results are shown in Fig. 7.12. where the inputs to the two-input XOR gate are termed as
inputs(0) and inputs(1) and output of the D flip-flop are shown in Figure 7.16. The number of LUTs
required to implement XOR gate is 1 over 10944.
Decade Counter
Decade counter is a 4-bit counter. The input ports of the decade counter are as follows:
rst: It is an active high reset
clock: It is a clock whose maximum operating frequency is 405.301 MHz
The output ports of the decade counter are as follows:
output (9:0): Out of the ten outputs, only one will be high at a time for one clock cycle and others will
be low
counth: After completing the counting, it will be high for one clock cycle
124
HDL Simulation and Synthesis
VHDL Implementation
Following is the VHDL implementation of decade counter:
-- File name: DecadeCounter.vhdl
--
-- Create Date: 15:01:57 21/03/2010
-- Module Name: Decade Counter(0-9)
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 9.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-------------------------------------------------------------------
-- library declaration
library ieee;
use ieee.numeric_std.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
-- entity declaration
entity CountDec is
-- input ports
-- output ports
output : out std_logic_vector(9 downto 0);
-- it will be high for one clock cycle after counting specified no. of count value
);
end CountDec ;
-- architecture declaration
125
Chapter 7
-- signal declaration
begin
begin
else
countpoint <= '0';
count <= count + '1';
end if;
end if;
end process;
end CountDecArch ;
126
HDL Simulation and Synthesis
Number of GCLKs 1 32 3%
Simulation Results
Figure 7.18 shows the simulation results of decade counter:
Overview of Verilog
Verilog is the registered trademark of Cadence Design Systems Inc. Philip Moorby developed the Verilog
language in the year 1985. IEEE has standardized Verilog in the year 1995 as IEEE Standard 1364. Open
Verilog International (OVI), established in 1991, has been promoting this language. You can get the latest
updates on Verilog from the website www.verilog.com.
One of the most attractive features of Verilog is that it is very easy to learn. If you know the C language,
then it is much more easy, as the syntax is very similar to C. Simulation and synthesis can also be done
very fast using this language, and several tools are available that support this language. This language is
very popular in North America and Japan.
127
Chapter 7
128
HDL Simulation and Synthesis
port declaration—Specifies the direction of the data flow and the width of the port. The direction can
be input to the system, output from the system, or both input and output to the system. The width is
to indicate whether it is a single wire or a bus.
For example,
module CPU(clock, reset, address, data);
input clock;
input reset;
output [31:0] address;
inout [15:0] data;
…
endmodule
A module can be specified in the following three ways:
Structural approach—In this approach, the system is specified using logic gates. Any digital circuit
can be represented using logic gates, which are the primitives in any digital circuit. However, too
many gates can make the circuit complex and complicated. To reduce the complexity, you can create a
library of different modules, such as adders and multiplexers, and use them in your module so that
you can build the system. An advantage of using this approach is that you can synthesize the circuit
easily.
Dataflow approach—As a system takes some inputs, processes the input, and produces some output,
a system can be represented by using a set of assignment statements using expressions and operators
for the transformation of the input to the output. This is similar to writing a series of assignment
statements in a programming language by using various operators and expressions.
Behavioral approach—In this approach, the behavior of a system is described without going into the
details of how it has been using a series of programming statements to describe the behavior of the
system through programming. This is called behavioral style. It is very easy to program, but difficult
to synthesize.
129
Chapter 7
Data Types
In the Verilog language, data types have four values set: 0, 1, X, and Z. Logic zero is represented by 0,
1represents logic one value, X represents an unknown logic value, and Z represents high-impedance state.
The input and output values based on the four valued data for a BUF gate is as follows:
Data Objects
Data objects are declared in a model as a single element or an array of elements. The different types of data
objects that are supported by Verilog are signal, wire, supply nets, register, parameter, integer, and
memory.
Description of some of the data objects are as follows:
Net—Represents the physical connection of signals in the circuit. Different types of nets are wor,
wand, and wire. These data objects can be declared as a scalar or vector type.
For example: wire n1; // n1 is a net of type wire
Register—Holds the unsigned data. The value holds for a simulation delta cycle. The register can be
declared as a scalar or vector type.
For example: reg (2:0) r1; // r1 is a vector that holds 3-bit unsigned data.
Parameter—Holds a constant value. These data objects are used to define the values or constants that
are local to a module or local to a sub-module.
For example: parameter P = 2’b11; // P is defined as constant value as 3
Integer—Holds the data in signed representation form. These data objects are used to declare general-
purpose variables. Default size of an integer data object is 32-bit in size. Integer data object is of scalar
type.
For example: integer Count; // variable name count of type integer
NOT Gate
The program written in Verilog HDL, which is simulated using the Modelsim simulator tool, and the truth
table for the NOT gate is given as follows:
130
HDL Simulation and Synthesis
module notgate(inputa,out);
input inputa;
output out;
not(out,inputa);
endmodule
The waveform generated from the simulator for the basic gate is as shown in Figure 7.19:
OR Gate
Verilog code written using data flow model for two-input OR gate with two-valued function is given as
follows:
//File Name : or2.v
//Created on : 14-03-2010
//Module Name: or2
//ProjectName: verilog_project
module or2(inputa,inputb,out);
input inputa;
input inputb;
output out;
assign out=(inputa |inputb); //data flow
endmodule
Figure 7.20 shows the simulation results of an OR gate:
131
Chapter 7
AND Gate
The Verilog code fragment is written to simulate the functionality of two-valued AND gate as follows:
//File Name : and2.v
//Created on : 17-03-2010
//Module Name: and2
//ProjectName: verilog_project
module and2(inputa,out);
input [2:0] inputa;
output out;
and(out,inputa[0],inputa[1],inputa[2]);
endmodule
Figure 7.22 shows the simulation results of an AND gate:
132
HDL Simulation and Synthesis
NOR Gate
The data flow model for 2-input NOR gate is shown as follows:
//File Name : nor2.v
//Created on : 17-03-2010
//Module Name: nor2
//ProjectName: verilog_project
module nor2(inputa,out);
input [1:0] inputa ;
output out;
nor(out,inputa[0],inputa[1]);
endmodule
Figure 7.24 shows the simulated results of two-input NOR gate using the Modelsim simulator tool:
NAND Gate
The data flow model for two-input NAND gate is shown as follows:
//File Name : nand2.v
//Created on : 17-03-2010
//Module Name: nand2
//ProjectName: verilog_project
module nand2(inputa,out);
input [1:0] inputa;
output out;
nand(out,inputa[0],inputa[1]);
endmodule
133
Chapter 7
Figure 7.25 shows the simulated results of two-input NAND gate using the Modelsim simulator tool:
XOR Gate
The Verilog code to two-input XOR gate is shown as follows:
//File Name : xor2.v
//Created on : 17-03-2010
//Module Name: xor2
//ProjectName: verilog_project
module xor2(inputa,out);
input [1:0] inputa;
output out;
xor(out,inputa[0],inputa[1]);
endmodule
Figure 7.26 shows the simulated results of two-input XOR gate:
XNOR Gate
The Verilog code to two-input XNOR gate is shown as follows:
//File Name : xnor2.v
//Created on : 17-03-2010
//Module Name: xnor2
//ProjectName: verilog_project
module xnor2(inputa,out);
input [1:0] inputa;
output out;
xnor(out,inputa[1],inputa[0]);
endmodule
Figure 7.27 shows the simulated results of two-input XNOR gate:
134
HDL Simulation and Synthesis
D Flip-Flop
The following code is an example of sequential circuit, D flip-flop, in Verilog:
// FileName : dff_beh.v
// Created On : 17-03-2010
// Module Name: dff_beh
// ProjectName: dff_proj
// Tool Name : ModelSim SE 6
module dff_beh(clk,rst,din,dout,dout_bar);
input clk,rst;
input din;
output dout;
output dout_bar;
reg dout;
assign dout_bar = ~dout; //data flow
135
Chapter 7
Counter
The 4-bit counter is designed using Verilog behavioral model. The counter starts counting from 0000 to
1111 and repeats the sequence. The counter resets itself when reset is set to high. Count is a 4-bit output
variable. Input variables are clock (clk) and reset (rst). Following is the Verilog code of a 4-bit counter:
// File Name : counter.v
// Created On : 17-03-2010
// Module Name: counter
// ProjectName: counter_project
// Tool Name : ModelSim SE 6
module counter(clk,rst,count);
input clk,rst;
output [3:0] count;
reg [3:0] count;
always@(posedge clk)
begin
if(rst==1'b0)
begin
count<=4'b0000; // sets counter to zero's
end
else
count<=count+1'b1; // starts counting
end
endmodule
The simulated results of a 4-bit counter are shown in Figure 7.29:
Simulation
Simulation is a process of design verification that takes place at several points in the design flow to ensure
correctness of the design. During the simulation process, the functionality of the design is been verified at
every stage, that is, from the first step to the last step. It is an iterative process to generate the test vectors
to verify the circuit behavior in terms of functionality and timing constraints.
A Verilog or VHDL simulators compile the design for syntax errors and simulate the design with the input
test vector. The simulator generates the waveforms that consist of input and output signals and the values
that are possessed based on the input vectors used to verify the entire design. Simulation of the design can
be done at various levels, that is, at the functional level, Register Transfer level, Place and Route level
136
HDL Simulation and Synthesis
using static timing analysis, and post synthesis stage. The detailed characterization of the design can be
done using functional and timing simulations.
As already learned, simulation is a process of verification of the design. The design to be verified is termed
as Device Under Test (DUT), which contains the entire hierarchy of the design. For example, if a
microprocessor is coded in Verilog or VHDL, the various sub-modules, such as Load Store Unit (LSU) and
execution units (Integer Unit, Floating Point Unit, and Bus Interface Unit), are included in the top-level
design. The DUT represents the top-level module of the design hierarchy. The top-level module drives the
inputs to DUT and nets that receive outputs from the DUT to verify the design.
This detailed simulation process helps in making the necessary changes before the fabrication. During the
design flow, the simulator interprets VHDL or Verilog code and verifies the circuit behavior. The process
of verification of design flow in the Xilinx tool is considered for an explanation purpose. Verification is an
automated process and various commercial simulators, such as Specman Elite, Icarus Verilog, and
Modelsim, are available in the market.
Synthesis
After the functional verification of the design is completed, the next step in the design flow is synthesis.
The goal of the synthesis step is to convert the netlist into target FPGA or ASIC technology.
During this step, Boolean circuit, which is designed based on the specification written in the behavioral or
structural flow style of VHDL or Verilog code, is transformed into a functionally equivalent gate-level
netlist and LUT-level netlist (FPGAs).
The synthesis report generated by the Xilinx ISE tool, for the given design, consists of the details of
number of logic elements (LUTs) required to design, the combinational path delay, and logic levels or the
depth of the circuit. The technology schematic view of the design can be obtained from the Xilinx tool.
The VHDL code for the 2X1 multiplexer using the behavioral code style is as follows:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity mux4 is
Port ( s1,s0 : in STD_LOGIC;
a,b,c,d : in STD_LOGIC;
y : out STD_LOGIC);
end mux4;
architecture Behavioral of mux4 is
begin
y<=(a and(not s1)and(not s0))or(b and(not s1)and s0)or(c and s1 and(not s0))or(d
and s1 and s0);
end Behavioral;
The gate-level netlist, technology schematic view, and synthesis report for the 2x1 multiplexer is, as shown
in Figure 7.30 (a) –(e):
137
Chapter 7
138
HDL Simulation and Synthesis
139
Chapter 7
Behavioral Modeling
Behavioral modeling is one of the methods to describe hardware circuits using HDL. This modeling is
used to represent the circuits at higher level of abstraction. Verilog language supports this type of
modeling for ease of design. Structural and data flow model descriptions are suitable for the circuits with
few hundreds of gate count. As the gate count increases, the description of the circuit difficult to model
using these models.
Behavioral modeling has become popular due to its ease of programming, which is similar to algorithmic
language. The constructs used in Verilog are similar to C language constructs, such as assignments, if-else
statements, case, for, functions, and procedures. Verilog constructs, such as always, initial, for, case, and
begin-end blocks, support the abstract description of the circuit. Design description at behavioral
modeling is done using the sequence of assignment statements. The example of using behavioral model in
Verilog to generate the Fibonacci sequence is given as follows:
module fib(a,b,c) // module name fib
input a,b; // input variable declarations
output c; //output variable declarations
initial // initial construct to initialize the values
begin
c = 1'b1;
a = 1'b0;
b = 1'b1;
end
always (posedge clock) // always construct
begin
a <=b;
b <=c;
c<= a+b;
end
end module // endmodule
140
HDL Simulation and Synthesis
Verilog code generates the Fibonacci sequence of numbers during the positive edge triggered clock. The
simulation results of the Verilog behavioral code can be generated using Verilog constructs, such as
always and initial. The stimulus for the Verilog code to generate the Fibonacci sequence is given as
follows:
module stimulus; // stimulus to test the design
initial
clock = 1'b0; // initialize the clock
begin
#5 clock = ~clock; // 5 unit delay
#100 stop; // after 100 time units simulation stops
end
initial
$monitor(“ monitor: a = %b, b = %b, c = %c”, a,b,c); // displays the value of a ,
b and c
end module
Timing Analysis
Timing analysis or verification is the process of verifying that the design meets the timing constraints.
Timing verification can be done using timing simulation. During timing simulation, DUT is verified at the
desired speed under worst-case conditions. This process is performed once the design process completes
the mapping, placement, and routing. During the timing verification phase, critical path delays, setup
time, and hold time violations can be determined ahead of time, that is, at the pre-silicon fabrication stage.
RTL Simulation
Registered Transfer Level (RTL) simulation is a verification process to verify the design coded in VHDL.
To determine the functionality of the circuit, the simulation process needs two inputs: one is the design to
be tested and another is the stimulus file to test the behavior of the circuit. As already learned, design to be
tested is referred to as DUT.
Outputs generated by the DUT are compared with the actual values.
RTL simulation, which is also called functional simulation, takes place at early stages of the design flow,
that is, at the pre-silicon stage or pre-synthesis stage.
VITAL Simulation
VITAL stands for VHDL Initiative Towards ASIC Libraries.
It specifies a standard method of writing ASIC and FPGA libraries.
VITAL is an IEEE standard used for modeling accurate timing for the gate-level design.
This gate-level design is generated after Place and Route stage for the verification of functional and timing
constraints of the design.
The Place and Route tool generates two files: VHDL netlist and Standard Delay format file with details
about the timing information.
VITAL simulation uses these two files as well as an additional file called VITAL library.
The VITAL library file describes the behavior of entities that are used to implement the design.
VITAL simulation uses three files: VHDL netlist, SDF file, and VITAL library for timing and functional
verifications.
141
Chapter 7
Summary
In this chapter, we have discussed the basic concepts of VHDL and Verilog with examples and their
simulation results for basic gates and various simulation models.
VHDL and Verilog are HDLs used for the description of VLSI circuits using behavioral model or
structural model. The behavioral model description of the circuit is the abstract level of description similar
to the algorithmic approach. The structural model description of the circuit is defined as the
interconnection of the hardware components or logic components. This type of model is also called gate-
level modeling.
Conventions used for operators, comments, data types, identifiers, and literals in VHDL and Verilog are
also discussed. The VHDL and Verilog code for basic gates and universal gates are given with simulation
results and synthesis details, such as device utilization for the given design. Modelsim simulator provides
tools to simulate the design and generate the waveforms for the given test vectors. Test vectors are the set
of input vectors used to verify the functionality of the design. The Xilinx synthesis tool is used to
synthesize the design to target device. The target device is Vertex-4 of FPGA.
Various types of simulation, such as behavioral simulation, functional simulation, RTL simulation, timing
simulation, and VITAL simulation, are discussed. Simulation is a process of verification of the design. This
verification takes place at various stages during the design flow to meet the design constraints in terms of
functional and timing constraints. Behavioral simulation, functional simulation, and RTL simulation are
functional verification simulation methods. Timing constraints are verified by timing verification strategy;
whereas, VITAL simulation is used to verify the design after Place and Route stage.
Questions
1. Write the syntax and semantic for process construct in VHDL.
2. Explain the features of VHDL and Verilog HDL with examples.
3. Explain how logic optimization takes place at the synthesis stage of design flow.
4. What is behavioral simulation, VITAL simulation, and functional simulation?
5. Define critical path delay, setup time, and hold time.
6. Write a procedure to generate a set of test vectors to verify the 4-bit ripple carry adder.
7. Discuss the slice utilization and LUT utilization ratio for a 2-bit up-counter.
Exercises
1. Write the VHDL code to generate the counter that repeats the Fibonacci sequence.
2. What are the primary and secondary units?
3. Compare and contrast the HDLs with high-level programming languages.
4. Explain the various approaches to design a code in Verilog.
5. Write the Verilog code for push and pop operations in stack.
6. Write the Verilog code to implement queue implementation.
7. Discuss the features of behavioral modeling method in Verilog.
142
8
IC Design
If you need an information on: See page:
PLAs 144
PLDs 146
FPGA 148
ASIC 151
Selection of an Appropriate Integrated Circuit 151
Chapter 8
This chapter gives the detail description of Programmable Logic Devices (PLDs), Programmable Logic
Arrays (PLAs), and Field Programmable Gate Arrays (FPGAs). The architecture of PLAs supports the
realization of any complex digital design using the AND and OR planes. The description of FPGA
architecture and its importance to build Very Large Scale Integration (VLSI) circuits is also discussed and
compared with complex PLDs. In addition, the chapter gives an insight for the selection of these devices
and their importance in designing real time applications.
PLAs
Conventional approach to design any digital design is to simplify the given digital design and realize it
with minimum number of gates. Then, the optimized design is implemented with basic gates or universal
gates that are connected with wires. This method is simple, but lack of portability is its disadvantage.
Figure 8.1 shows the block diagram of PLA:
144
IC Design
145
Chapter 8
common product terms, namely bc and ac'. The number of product terms in the AND array to be
implemented are ab', ab, bc, and ac'. Therefore, only four product terms are required to implement using
the AND plane. Four product terms, p0, p1, p2, and p3 hold the expression as follows:
p0= ab'
p1= ab
p2= bc
p3 = ac'
These four product terms are configured in the AND plane. The p0 term is represented as a black dot at
crossover point where vertical lines of x and y variables intersect with the horizontal line. Similarly, p1, p2,
and p3 are denoted as black dots on the AND plane. The terms that are generated using OR plane are F1,
F2, and F3, given as follows:
F1 = p0 + p2
F2 = p1 + p3
F3 = p3 + p2
Using PLA, only the required terms are generated. Simplification to the number of product terms is the
feature of PLA. In addition, the AND array is used which is fully utilized. As per the transistor
technology, NAND or NOR gate is used to implement these devices instead of AND or OR gate array.
One of the features of PLAs is that both AND and OR planes are programmable during manufacturing.
However, the difficulty in these devices is that finding common factors in large designs are impractical.
PLDs
PLDs are used to realize digital designs with AND and OR planes. Major difference when compared with
PLA devices is in the programming of AND and OR planes. In case of PLAs, both AND and OR planes are
programmable; whereas, in PLDs, either one of the planes is programmable or both the planes are fixed.
Programming technology is initiated in Read Only Memories (ROMs) to store the information. This
information is stored by programming the wires based on the address lines. These are one time
programmable and are fixed. In this case, fixed implies that bits cannot be changed once they are
programmed. In other words, these devices are not reconfigurable. Developments on these devices are
initiated to implement the combinational designs.
ROM consists of m-inputs and n-outputs. It is also called hardwired truth table, as truth table is stored in
it. Any combinational circuit can be implemented using ROMs. Based on the functionality, the output of
the circuit can change. The truth table is considered to store in the ROM devices and the required
minterms are programmed or configured to realize the design. For example, consider a well-known
combinational design, 1-bit Full Adder. The input variables of this circuit are x, y, and z, and output
variables are sum and carryout. Sum and carryout function in terms of sum of minterms are as follows:
sum(x,y,z) = f (1,2,4,7) = x'y'z + x'yz'+xy'z'+ xyz
carryout(x,y,z) = f (3,5, 6, 7) = x'yz + xy'z + xyz' + xyz
In ROM devices, minterms are configured on the AND plane. Outputs are determined by combining
minterms, such as 1,2,4,7 for sum and 3,5,6,7 for carryout, on the OR plane. Truth table inside a ROM
determines these minterms. You need to program the device such that whenever the minterm
combinations 1, 2, 4, 7 are read as input, output line generates 1. Similarly, generation of carry signal
output takes place. Basically, it consists of an AND array whose input will be x, y, z and output will be
f(0,1,2,7). To combine these minterms into required sum and carryout, OR array is required. These devices
are called as programmable devices due to its configurability feature. The minterms of the given input can
be combined as per users choice, that is, different inputs can be configured or given to these devices. After
146
IC Design
the device is configured to 1-bit Full Adder function, it cannot be used for different designs. The
realization of 1-bit Full Adder is shown in Figure 8.3:
147
Chapter 8
FPGA
Ross Freeman, one of the founders of Xilinx, invented FPGA in the year 1984. Xilinx continues to be one of
the leading vendors of FPGAs. Due to the reprogramming feature, FPGA has become a very popular
device. FPGAs are programmable devices; therefore, to realize any digital design, end users can program
FPGAs. These devices are very popular due to their reprogrammable nature and short turnaround time.
FPGAs are advanced versions of CPLDs, where PAL structure of the logic blocks is replaced by
Configurable Logic Blocks (CLBs).
148
IC Design
A generic FPGA architecture consists of programmable logic elements called CLBs, programmable
interconnect, and input and output programmable pads (Figure 8.6). All these three can be configured
through programming. Each configurable logic block consists of logic elements that can be used to realize
the logic. An FPGA contains two-dimensional CLBs and a two-dimensional array of switching matrices to
connect the CLBs. Through programmable routing, CLBs can be interconnected. An FPGA can have more
than 10,000 CLBs. Programmable interconnects are used to establish connection between logic elements.
Other important resources, such as three-state buffers, registers and multiplexers in I/O blocks, and JTAG
boundary scan circuitry, are also included in FPGAs. Figure 8.6 shows the architecture of FPGA:
Antifuse FPGA
In this type of FPGA, the programming is done by burning a set of fuses. This type of programming is also
called hard programmable FPGAs, antifuse FPGAs, or one-time programmable devices. After the chip is
configured, it cannot be modified. These FPGAs are mostly preferable in production systems, where
reconfiguring the FPGA in the field is not required. For payload applications in space, these devices are
used extensively.
149
Chapter 8
Flash FPGA
Flash FPGAs can be reprogrammed thousands of times. These types of FPGAs use flash-erase EROM
technology; therefore, these devices are also called soft programmable devices. These are non-volatile, that
is, even when the power is switched off, the configuration within these devices remains intact. The main
advantage of FPGAs is that they can be reconfigured or reprogrammed in the field. However, these
devices are costlier when compared with antifuse FPGAs.
SRAM FPGA
In this type of FPGA, programmable switch is used to configure designs. The state of switch is controlled
by SRAM bit. SRAM-based technology is most widely used in FPGAs, as these devices support in-
programmability and re-programmability. In this type of FPGA, when power is switched off, the
configuration is erased. To retain the configuration even during power failures, additional logic is
required. Therefore, additional circuitry is added to load the configuration into the FPGA whenever
power is switched on. This reconfiguration is done very fast.
Most of the current day commercial FPGA products are based on either SRAM or antifuse technologies.
Major commercial vendors of FPGA devices are Xilinx and Altera. In Xilinx terminology, a set of building
blocks of a logic circuit is called slice; whereas, in Altera terminology, it is called adaptive logic module.
The main advantages of FPGA are as follows:
Design and implementation are easier and faster
The size of the chip is small
Reliability is higher
Due to re-programmable nature of FPGAs, the component count is reduced
It provides remote hardware or field programming by end users
Risk and cost of development time is reduced
Non-Recurring Expenditure (NRE) cost is low
Testing process is easier when compared to PLDs
FPGAs have the following disadvantages:
Power consumption is high and slow
The production cost is high as compared to Application Specific Integrated Circuits (ASICs)
There will be an overhead (in terms of logic circuitry) as some portion of FPGA is not available for
user programming
FPGAs are extensively used for the design of both prototypes and production systems. Some typical
applications of FPGAs are as follows:
In major research and development projects of telecommunications, networking, software radio, and
process control to develop fast prototypes
In pre-production systems where the product has to be launched early to avoid competition
In production systems where the production volumes are not very high and the ASIC development
cost is not justified
150
IC Design
ASIC
ASIC is an integrated circuit designed in such a way that it meets the exact requirements for a specific
application. ASIC is a fully customized device. If you need to design an electronic component as a
dedicated component for a specific task, then ASICs are the best choice; for example, mobile phones and
smart phones. Moreover, if you are developing a product that will have a mass market, such as an MP3
player or a set top box, then you can design an ASIC. The advantages of an ASIC are as follows:
Very low production cost if the ASIC is for a mass market
Best utilization of the resources on the chip as compared to FPGA
Optimized for a specific application; and therefore, power consumption and size can be less
On the downside, ASIC has the following problems:
Initial development cost is very high, that is, design, verification, and physical chip design will take a
lot of time and expertise
The final ASIC fabrication will be done by a third party having the chip making facility
Summary
PLDs are used to implement any digital design with the help of AND and OR planes. The combinational
circuits are represented in either canonical or standard forms. Standard form expressions, SOP or POS, are
realized using AND plane and OR plane. Based on the programmable features of AND and OR planes, the
devices may vary. The PLDs, such as ROM, PROM, EPROM, and EEPROM, are all fixed AND and OR
planes. Both AND and OR planes are programmable in PLA devices. These PLA devices are used in
151
Chapter 8
FPGAs. PAL devices consist of fixed AND plane and programmable OR plane. Combining these PLDs
forms various devices, such as CPLDs, FPGAs, and ASICs. These devices vary in programming feature
and the configuration technology. Different programming technologies for FPGAS are soft and hard.
Widely used devices are FPGAs and ASICs due to manufacturing cost and speed.
Questions
1. Draw the PLA structure for the function F1 = xy + yz+ x'z.
2. Distinguish between PROM and PLAs.
3. Write the application of CPLDs.
4. Explain the architecture of generic FPGA.
5. Write the advantages of ASICs over FPGAs.
Exercises
1. Implement the given function using PLDs
F = xyz + y'z' +x'y'
2. Draw the structure of PLA to implement the functions:
F1(x,y,z) = yz + x
F2 (x,y,z) = xy + x'y'z'
3. Design a procedure for the selection of appropriate integrated circuit for an embedded system
application.
152
9
FPGA Design Process
If you need an information on: See page:
Architectures of Popular FPGAs 154
Choosing an FPGA 156
FPGA Design Process 159
FPGA Families of Different Vendors 163
FPGA Design Examples 164
Chapter 9
As Field Programmable Gate Array (FPGA) devices are becoming more and more versatile and flexible,
the use of these devices is also increasing. Choosing a specific FPGA for a given application is not an easy
task. In this chapter, you learn about the intricacies of selecting an FPGA, the FPGA design process, and
the precautions to be taken for designing a Printed Circuit Board (PCB) with FPGA. In addition, FPGA
design process is illustrated with few examples.
154
FPGA Design Process
An LUT-based logic block consists of LUTs, flip-flops, multiplexers, and latches (Figure 9.2). These LUTs
are programmed to realize any n-variable Boolean function. As the k-input LUT inside a logic block can be
programmed to realize any of the 2m Boolean functions where m = 2k, the logic blocks are also called
Configurable Logic Blocks (CLBs). The CLBs in modern FPGAs have more than one LUT; for example,
CLBs in the Xilinx Virtex-4 family contain eight four-input LUTs. Most of the commercial FPGAs, such as
Xilinx and Altera, have four-input LUTs as logic blocks. Figure 9.2 shows an LUT-based logic block:
155
Chapter 9
In Figure 9.4, the logic block is implemented by using three multiplexers, where the input variables are w,
x, y, z and output is f with S1, S2, S3, and S4 as select lines.
Choosing an FPGA
The first step in the process of FPGA selection is to identify your area of application, that is, whether it is
aerospace and defense applications or commercial applications.
For aerospace and defense applications, FPGAs need to work under harsh environmental conditions, such
as very high or low temperatures or very high humidity. Therefore, FPGAs that meet these requirements
are very few as compared to those that can be used for commercial applications.
The second step in narrowing down your search for the right FPGA is answering the following questions:
Is the FPGA for general logic implementation?
Is the FPGA for an embedded system implementation?
Is the FPGA for implementing signal processing functions?
Depending on your answer, a vendor recommends a few families of FPGAs or a small set of components
within each family.
The next step is to identify the FPGA’s that meet your needs in each of the families.
For example, Xilinx gives a number of families, such as Vertex.
The various parameters that need to be taken into account are:
Input voltage (5, 3.3, 2.5, 1.8)
Number of gates
Macro cells
Clock
Number of pins
Package type: Plastic Leaded Chip Carrier (PLCC), Plastic Quad Flat Package (PQFP), Very Thin
Quad Flat Package (VTQFP), Thin Quad Flat Package (TQFP), Ball Grid Array (BGA), and Fine Pitch
Ball Grid Array (FBGA)
Let’s now learn about intellectual property cores, which are popularly known as IP cores.
IP Cores
In software development, you can use library functions. These library functions make development faster
as you do not have to write everything from scratch. Similarly, while designing FPGAs, IP cores are
available to implement commonly used functions in them.
IP core can be defined as a reusable unit of logic design. It is an intellectual property of the party who
developed it; and therefore, the name IP core. A large number of vendors offer IP cores for a price in the
following two forms:
a. Netlist, which can be ported to a different target FPGA. It cannot be reverse engineered; and
therefore, the IP is protected.
b. Hardware Description Languages (HDL) code, which is a synthesizable version of the IP core; and
therefore, it can be modified as per your requirements.
These IP cores are also called soft cores.
156
FPGA Design Process
Manufacturers of FPGAs
Manufacturers, such as Xilinx and Altera, provide IP cores, but they are very limited. Microblaze is a
software-based embedded processor from Xilinx. NIOS is a software-based embedded processor from
Altera. FPGA manufacturers also provide IP cores for more powerful embedded processor cores for AVR
and PowerPC.
A large number of 3rd party vendors provide IP cores. Each vendor may specialize in a specific area given
as follows:
Processing—Processor cores such as Z80 and 8085Connectivity or Interfaces: RS232, I2C, and Ethernet
Communication—Network protocol stacks, error detection and correction, and encryption
Telecommunications—Modulations, demodulations, interleaving, digital up-conversion, digital
down-conversion, and direct digital synthesis
Digital Signal Processing—Filters, decimation and interpolation, and FFT analysis
Coding—Audio compression and video compression
Open source is made available mostly in VHDL or Verilog on the Internet. You can check at the website
www.opencores.org if any core that meets your requirement is available.
If you are a manager working on a project that uses FPGA with strict deadlines, then you need to consider
the option of buying the IP cores for implementing complex functionality in the FPGAs. This will save lot
of time; however, if the engineers start developing from scratch, then they will take lot of time for coding
and testing.
FPGA Configuration
FPGA is a reconfigurable device. However, as FPGA is based on SRAM technology, it is volatile, that is,
when power goes off, it has to be reprogrammed. On the other hand, Complex Programmable Logic
Devices (CPLDs) are non-volatile, as they are based on Electrically Erasable Programmable Read Only
Memory (EEPROM) or Flash cell technology.
Following two options can be used to configure an FPGA:
Configure the FPGA directly using a cable during development
Program a CPLD or Programmable Read Only Memory (PROM) by loading the configuration data
into the CPLD or PROM and then loading the configuration data onto the FPGA during production
models
When you want to program an FPGA using PROMs, the configuration data for the FPGA is stored in the
PROM. PROMs are of two types:
One Time Programmable (OTP) ROM
In System Programmable (ISP) ROM (platform Flash)
If you do not need ISP capability, you can use OTP ROM and use in the production model PCB.
Otherwise, you need to use ISP ROMs. Figure 9.5 shows the process of configuring an FPGA:
157
Chapter 9
Configuration Modes
A number of modes in which the devices can be configured are given as follows:
JTAG—Refers to a mode, which can be used to program FPGA, CPLD, and PROM. It is done using a
JTAG cable. The JTAG mode is a serial programming mode in which data is loaded one bit per test
clock tick. This mode is also called Boundary Scan mode.
Master-Serial—Refers to a mode, which is used to load the configuration data from a serial PROM to
an FPGA. This mode is also a serial mode in which data is loaded one bit per clock tick. The FPGA
itself provides the clock by using its internal oscillator that drives the configuration clock. Therefore,
in this mode, FPGA loads itself with the data in the PROM.
Slave-Serial—Refers to a mode in which an external clock from a microprocessor or another FPGA is
used to load the configuration data into an FPGA. In this mode, the loading is done one bit per clock
tick.
Slave-Parallel—Refers to a mode in which an external clock from another microprocessor or FPGA is
required. The data transfer is done byte wise rather than bit-by-bit; and therefore, transfer is faster.
This mode can be used if the configuration speed is important.
JTAG and Master-Serial are the most widely used modes.
158
FPGA Design Process
159
Chapter 9
Implementation: In this stage, the netlist is converted into a bit stream corresponding to a target
device. The complete design is described in terms of the primitives of the target architecture and all
the instances are assigned to physical locations. This is done iteratively as timing constraints need to
be met during the implementation process.
Timing simulation: Ideally, test benches are written to check whether the necessary timing
constraints are met, particularly for critical paths. However, writing test benches is a very involved
task.
Static timing analysis: This can be done easily by computing the actual timing with the constraint
imposed on the design.
Perform the following steps to download the VHDL source code onto an FPGA device:
1. Write the VHDL source code. The VHDL code to display the decimal digit using LED output is
shown in Figure 9.7:
160
FPGA Design Process
Figure 9.9: Displaying the Implementation Stage after the Synthesis Stage
161
Chapter 9
Preliminary design—At this stage, you need to identify various components to be used in a PCB. You
also need to select the specific FPGA to be used. As discussed earlier, you need to select an FPGA
based on the resources required on the device. You also need to study the factors, such as device
packaging and number of pins, as these factors affect the production cost of the PCB. While you are
carrying out the design, it is very important to keep in mind the design for test philosophy. Your
design should be such that it is not difficult to test the PCB during the production stage and
maintenance. In a PCB with a large number of components, you need to identity the important test
points. In the FPGA, you need to plan for writing built-in-test logic so that the FPGA can be tested
easily.
Detailed Design—At this stage, you need to work out the detailed circuit diagram. For the FPGA,
you need to perform the following:
Input or output identification.
FPGA pin assignment.
Clock generation and distribution. Note that clock is a source of cross talk and EMI. The Digital
Clock Management (DCM) circuitry in the FPGA should be made effective.
Power supplies required for FPGA core, I/Os, and reference.
Estimate the power dissipation. This is a specialized activity called thermal management. You
need to take expert advice on this aspect, as this will have an impact on the PCB design. If the
power dissipation is high, you may need to provide a cooling arrangement, such as fan.
Static timing analysis to analyze the timing margins.
Signal Integrity Analysis (SIA) is performed to find out the distortion caused when the signal
travels through the FPGA, crosstalk effects, and EM radiation, and how to overcome it. This
analysis provides the inputs for placement and routing tool.
PCB design—PCB design with an FPGA onboard is a challenging task as FPGAs are devices with
large number of pins and packaging, which is difficult to handle. As a result, the number of layers is
going to be high (typically eight and above). The cost goes up and testing and debugging the PCB
becomes difficult as the number of layers increases. Therefore, experienced professionals need to take
up the PCB design. Particular care needs to be taken if the PCB has to accommodate both analog
circuitry and digital circuitry (as in the case of all the telecommunication systems). The analog and
digital grounds need to be separated.
PCB assembly and test—PCB assembly and testing become easy if you follow the design for test
principle; else, life is tough. You need to test the PCB part-by-part rather than assembling all the
components in one shot.
Production model—You can launch the production model after the prototype is working correctly.
The cost of production model will be much lower than the prototype, as you are likely to procure the
components in large quantities; and therefore, the cost per device will work out to be low. You need
to consider this while doing the design.
FPGA power dissipation depends on a number of factors, such as resources used, I/Os, and clock. Tools, such as Xilinx
XPower, are available to estimate the power dissipation of the FPGA.
After synthesizing and simulating, the last step is configuring the FPGA.
Xilinx gives in-system programmable Platform Flash configuration memories, such as PROM, to simplify
configuration process.
162
FPGA Design Process
In designing and developing systems using FPGA, the design and verification go hand in hand.
163
Chapter 9
Four such slices make up a CLB, which is the basic unit to create combinatorial logic or sequential circuits.
In this family, the following three groups of series are available:
LX series—Refers to a series that is used for implementing logic and I/O functions.
SX series—Refers to a series that is used for implementing digital signal processing functions. Slices
in the series are called digital signal processing slices.
FX series—Refers to a series that have a PowerPC core and memory.
The latest series of Xilinx FPGAs are the Virtex 5 series. These FPGAs have capacities of 12 million gates
and 330,000 logic cells. The three families of the FPGAs are as follows:
Virtex 5 LXT for high performance logic
Virtex 5 SXT for digital signal processing
Virtex 5 EXT for embedded processing
Virtex-7 FPGAs for ASIC emulation
164
FPGA Design Process
VHDL Implementation
Following is the VHDL implementation of the stack:
-- File name: Stack.vhdl
--
-- Create Date: 17:10:26 07/05/2007
-- Module Name: Stack
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 8.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-----------------------------------------------------
--library declaration
library ieee;
use ieee.numeric_std.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--entity declaration
entity Stack is
--input ports
165
Chapter 9
);
end Stack;
--architecture declaration
--signal declaration
component dpram
-- Generic declaration
--input ports
-- address inputs, write enable, read enable, chip select, async reset, clock
166
FPGA Design Process
cs : in std_logic;
rst : in std_logic;
clk : in std_logic;
end component;
--------------------------------------------------------------
begin
wrdpram <= '1'when (wr = '1' and fulltemp1 = '0') or wrtrd ="10" else '0';
rddpram <= '0'when (rd = '0' and delay = '0') or wrtrd ="10" else '1';
process(clk,rst) --process
167
Chapter 9
begin
if rst='1' then
case wrtrd is
when "10" => -- read and write are taking place at same time
top <= top;
if fulltemp='0' then
top <= top + '1'; -- write operation incrementing address pointer
cnt <= '1';
else
top <= top;
end if;
end if;
end case;
end if;
end process;
process(clk,rst) --process
begin
168
FPGA Design Process
else
delay <= '0';
end if;
end if;
end process;
dataout <= (others =>'Z') when fulltemp1 ='1' or delay ='1' else dataouttemp;
end StackArch ;
Number of GCLKs 1 32 3%
169
Chapter 9
170
FPGA Design Process
VHDL Implementation
Following is the VHDL implementation of the queue:
-- File name: Queue.vhdl
-- Create Date: 10:01:36 07/06/2007
-- Module Name: Queue
-- Project Name: VLSI LAb
-- Target Devices: xv4vfx12-10sf363
-- Tool versions: ISE 8.2i,Model Sim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-----------------------------------------------------------------
--LIBRARY DECLARATION
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
--entity declaration
entity Queue is
-- GENERIC DECLARATION
generic (width : integer := 4;
addloc : integer := 4
);
-- INPUT PORTS
171
Chapter 9
-- OUTPUT PORTS
end Queue;
--architecture Declaration
component Dpram
-- GENERIC DECLARATION
generic(width : integer := 4;
addloc: integer := 4);
-- INPUT PORTS
-- ADDRESS INPUT
);
end component;
-- SUBTYPE DECLARATION
172
FPGA Design Process
-- SIGNAL DECLARATION
begin -- QueueArch
);
wrdpram <='1' when (wr ='1' and fulltemp = '0') else '0'; -- WRITE
rddpram <='0' when (rd ='0' and emptytemp = '0') else '1'; -- READ
---------------Queue Full---------------------
fulltemp <= '1' when fecounter = ((2**addloc) -1) and wr = '1' else '0';
almostfull <= '1' when fecounter = ((2**addloc) -2) and wr = '1' else '0';
---------------------------Queue Empty ---------
emptytemp <='1' when fecounter =0 and rd ='0' else '0';
almostempty<='1' when fecounter =1 and rd ='0' else '0';
173
Chapter 9
process(clk,rst)
case wrtrd is
else
end case;
end if ;
174
FPGA Design Process
end process ;
output<= outputdata;
end QueuArch;
Number of GCLKs 1 32 3%
175
Chapter 9
VHDL Implementation
Following is the VHDL implementation of the shift register:
-- File name: ShiftRegister.vhdl
-- Create Date: 12:39:37 07/04/2007
-- Module Name: ShiftReg
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 8.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
------------------------------------------------------------------
--libarary declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
176
FPGA Design Process
--entity declaration
entity ShiftReg is
-- bits to be shifted in one clock should be less than the data width
-- input port
-- input data
clk : in std_logic;
rst : in std_logic; -- reset
load : in std_logic; -- load data enable
end ShiftReg ;
--architecture declaration
--signal declaration
begin
begin
177
Chapter 9
else
case shiftlr is
end case;
end if;
end if;
end process;
end ShiftRegArch;
Number of GCLKs 1 32 3%
178
FPGA Design Process
Summary
This chapter focuses on FPGA architecture and design processing steps for system prototyping. Due to
reprogrammable feature, the FPGA devices become popular as a rapid prototyping device. The basic
architecture of FPGA consists of programmable I/O blocks, programmable logic blocks, and interconnects.
Logic block is a basic unit to realize any Boolean function from basic logic gates to complex combinational
circuits. Most FPGAs use a multiplexer-based logic block or LUT-based logic block as a basic logic
element. The multiplexer control inputs are used as logic inputs and the multiplexer inputs are strapped to
logic levels to implement the desired function. The SRAM-cell represents the k-input one-output LUT that
implements any Boolean function upto k-variables. Various commercial vendors that produce these
FPGAs are listed in the chapter. The procedure to implement the hardware on a PCB is also explained. The
FPGA design process is illustrated with examples using VHDL.
Questions
1. Explain the need of FPGA and its various applications.
2. Explain the basic architecture of FPGA.
3. Explain the functions of LUT-based logic block and multiplexer-based logic blocks.
4. Explain the design flow for FPGAs.
5. List the methods to choose an FPGA device for an embedded application.
6. What is meant by LUT? Realize a given Boolean function f(x,y,z) = xy + z by using LUT-based logic
block.
7. List the commercial vendors of FPGA devices.
179
Chapter 9
Exercises
1. Write a Verilog code to implement a n-bit carry-lookahead adder.
2. Write a VHDL code to implement the 4-bit carry-save adder.
3. Write the steps involved to prototype the HDL-code onto an FPGA device.
4. Realize a NOR-gate using multiplexer as a logic block.
180
10
VHDL Implementation
Examples
If you need an inforamtion on: See page:
Adder 182
Multiplier 186
Multiplexer 192
Chapter 10
VHDL stands for VHSIC Hardware Description Language. VHSIC is an abbreviation for Very High Speed
Integrated Circuit. VHDL is a very popular Hardware Description Language (HDL) along with Verilog for
simulation, modeling, documentation, and synthesis of high-speed integrated circuits. As it is complicated
to design large systems by manually entering the circuit schematics or writing Boolean expressions, VHDL
can be used to describe systems using a language similar to a programming language. Systems can be
described in VHDL in the two forms: behavioral description and structural description. In the behavioral
description, the system is described based on how it works; whereas, in the structural description, the
system is described based on how it is implemented. In this chapter, you learn how to implement
commonly used digital circuits, such as adder, multiplier, and multiplexer, in VHDL. You also learn the
use of Xilinx ISE for the simulation and synthesize.
Adder
Addition is one of the most important operations, which is used in all computations. Adder is a circuit that
performs addition operation in computers that is widely used in all computations. A 4-bit Carry-
LookAhead (CLA) adder can be implemented using VHDL.
The behavioral description of VHDL code for CLA adder is given as follows:
-- Create Date: 09:31:03 03/21/2010
-- Design Name: adder
-- Module Name: cla1 - Behavioral
-- Project Name: cla
-- Target Devices: xc3s100e-4-tq144
-- Tool version: Release 8.1i - xst I.24
Copyright (c) 1995-2005 Xilinx, Inc. All rights reserved.
Parameter TMPDIR set to ./xst/projnav.tmp
-------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity cla1 is
port ( a,b : in STD_LOGIC_VECTOR (3 downto 0);
sum : out STD_LOGIC_VECTOR (3 downto 0);
carry : out STD_LOGIC;
c : in STD_LOGIC);
end cla1;
component full is
182
VHDL Implementation Examples
----port declaration
begin
end Behavioral;
Figure 10.1: Displaying the Synthesis Report of CLA Adder using the Xilinx ISE Tool
183
Chapter 10
In Figure 10.1, the device summary information shows the number of slices, number of Look Up Tables
(LUTs), and number of bonded Input/Output Blocks (IOBs) used by the given design. For the CLA circuit,
number of logic elements (also called LUTs) used is two out of 1922. The timing constraints given by the
tool for the design is shown as follows:
Timing constraint: Default path analysis
Total number of paths / destination ports: 6 / 2
-------------------------------------------------------------------------
Delay: 7.047ns (Levels of Logic = 3)
Source: a0 (PAD)
Destination: ca (PAD)
Data Path: a0 to ca
Gate Net
Cell:in->out fanout Delay Delay Logical Name (Net Name)
---------------------------------------- ------------
IBUF:I->O 2 1.218 1.052 a0_IBUF (a0_IBUF)
LUT3:I0->O 1 0.704 0.801 s1 (s_OBUF)
OBUF:I->O 3.272 s_OBUF (s)
----------------------------------------
Total 7.047ns (5.194ns logic, 1.853ns route)
(73.7% logic, 26.3% route)
===============================================================
CPU : 7.07 / 7.28 s | Elapsed : 7.00 / 8.00 s
Figure 10.2 shows the schematic view of the circuit with LUTs and the hardware components in each LUT:
Figure 10.2: Displaying the Schematic View of the 4-Bit CLA Adder
184
VHDL Implementation Examples
As you can see in Figure 10.2, the inputs of the 4-bit CLA design are a0, a1, and a2 and outputs are s and
ca. Figure 10.3 shows two 3-input LUTs of a design with the input and output variables:
Figure 10.3: Displaying the Schematic View of LUTs for the 4-Bit CLA Adder
In Figure 10.3, the CLA circuit is realized using two LUTs termed as LUT3, which means 3-input LUT. The
3-input LUT is used to realize any 3-variable function. The logic that is mapped to each LUT is shown as
gate-level circuit in Figure 10.4 and Figure 10.5. The logic expression for LUT1 is shown in Figure 10.4:
Figure 10.4: Displaying the Gate-Level View of LUT1 for the CLA Design
The logic expression for LUT2 is shown in Figure 10.5:
185
Chapter 10
Multiplier
The 2-bit multiplier performs the multiplication of two 2-bit numbers and stores the product in a 4-bit
register. The input variables of the multiplier are named as x and y and the output of the multiplier is
termed as p. The two binary numbers are multiplied using addition of partial products. The partial
product bits are then added using a half adder. The VHDL code for 2x2 multiplier is given as follows:
MULTIPLIER:-2x2
----------------------------------------------------------------------------
-- Company:
-- Engineer:
-- Create Date: 10:15:18 03/27/2010
-- Design Name: multiplier
-- Module Name: p_bits - Behavioral
--Target Devices : xc4vfx12-10sf363
--Tool Versions: ISE 8.2i
-- Revision 0.01 - File Created
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
186
VHDL Implementation Examples
library ieee;
use ieee.std_logic_1164.all;
component ha is
port(a,b:in std_logic; ---Input port a,b declared
su,car:out std_logic); ---Output port declaration
end component;
---- End of Component Declaration
----Component Full Adder declaration
component fa is
port(a1, b1 ,c1 :in std_logic; ---Input port a1,b1 declared
sum1,carry1 :out std_logic); ---Output port declaration
end component;
---- End of Component Declaration
begin
u1:internal_bits port map(x,y,a,b);
p(0)<=a(0);
u2: ha port map(a(1),b(0),p(1),c0); --- Instantiation
u3: ha port map(b(1),c0,p(2),p(3)); --- Instantiation
end p_bits;
187
Chapter 10
188
VHDL Implementation Examples
The project summary gives information regarding the project file name, selected target device, module
name, and the tool version on which a program is simulated. The logic utilization in the device utilization
summary gives the number of logic blocks used to realize the multiplier circuit; in this case, it is four out
of 9316. Similarly, the logic distribution gives the details related to the distribution of the logic blocks; in
this case, it is 4-input LUTs.
Figure 10.8 shows the block diagram of synthesized circuit:
189
Chapter 10
190
VHDL Implementation Examples
Figure 10.13: Displaying the Simulation Results for the Multiplier using ModelSim Simulator
191
Chapter 10
In Figure 10.13, the initialization waveforms are obtained where the variables x, y, and p_bits are
initialized to the value 0. The p_bits are changed to 1001 when x and y bits are changed to 11 and 11. These
waveforms are obtained using the Mentor Graphics tool. The waveforms are shown in Figure 10.14:
Multiplexer
The 8 x 1 multiplexer acts as a digital switch. It connects data from one of the eight sources to its output
according to the decimal equivalent of select lines. For example, if the select lines are 010 (the decimal
equivalent of 2), then input(2) is assigned to the output. We will declare a generic variable selectlines
whose value is defined as 3 to select from 8 input lines. The total number of input lines can be, in general,
2 selectlines and the number of output lines is 1. Figure 10.15 shows the 8X1 multiplexer:
192
VHDL Implementation Examples
VHDL Implementation
The VHDL implementation of the multiplexer is as follows:
-- File name: Mux8.vhdl
--
-- Create Date: 14:19:47 07/05/2007
-- Module Name: Mux8
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 8.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
--------------------------------------------------------------------
-- library declaration
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--entity declaration
entity Mux8 is
193
Chapter 10
-- inputs to mux
-- output port
end Mux8;
-- architecture Declaration
begin
begin
end process;
end Mux8Arch;
Simulation Results
Figure 10.16 shows the simulation results of the 8x1 multiplexer:
194
VHDL Implementation Examples
16 X 1 Multiplexer
The 16 x 1 multiplexer acts as a digital switch. It connects data from one of the n sources to its output
according to decimal equivalent of select lines. For example, if the input to select lines is 0011 (whose
binary equivalent is 3), then input(3) is assigned to output.
If generic selectlines are assigned a value of 4, then there will be four select lines and the number of input
lines can be 16. You can change this value so that the input of multiplexer can be 2 selectlines.
Figure 10.17 shows the block diagram of 16X1 multiplexer:
195
Chapter 10
VHDL Implementation
The VHDL implementation of the 16X1 multiplexer is as follows:
-- File name: Mux16.vhdl
-- Create Date: 14:45:09 07/05/2007
-- Module Name: Mux16
-- Project Name: VLSI Lab
-- Target Devices: xc4vfx12-10sf363
-- Tool versions: ISE 8.2i,ModelSim SE 6.0
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-----------------------------------------------------------------
-- library declaration
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
--entity declaration
entity Mux16 is
-- inputs to mux
-- output port
end Mux16;
-- architecture Decalaration
begin
196
VHDL Implementation Examples
end process;
end Mux16Arch;
Simulation Results
Figure 10.18 shows the simulation results of the 16 x 1 multiplexer:
197
Chapter 10
Summary
In this chapter, you have studied how to develop applications using VHDL. Xilinx released a simulator
and synthesizer of Vertex-4/5 devices to address the design techniques for complex combinational
circuits. You have also demonstrated the arithmetic circuits, such as CLA adder, multiplier, and
multiplexer, using VHDL. In addition, the simulation and synthesis results are explained for some test
cases. The simulation waveforms from ModelSim tool are also discussed with test cases for designs, such
as multiplier.
Questions
1. Write the VHDL code for carry-save adder and compare the delay with CLA adder.
2. Explain decimal adders.
3. Write the VHDL code for BCD addition.
4. Write a VHDL code to compute the product of two 4-bit binary numbers using Booths multiplication
algorithm.
5. Write the VHDL code for generic nxm multiplier using repeated addition.
6. Write a VHDL code for a 4-bit number divided by a 2-bit combinational logic divider.
198
11
Case Study:
Xilinx Development Board
If you need an information on: See page:
Xilinx ISE 10.1 200
Development Board Architecture 201
Interfacing with Peripherals 202
Chapter 11
In this chapter, you learn how to develop applications using a Xilinx FPGA-based development board. The
details of the architecture of the board and the tools required for development are also given. In addition,
a systematic procedure for the development is given through a case study.
200
Case Study: Xilinx Development Board
Design Implementation
After generating the gate-level netlist, which is the technology-independent design at the synthesis step,
the design is converted into technology-dependent design (target to particular devices, such as Virtex or
Spatran FPGA). This step is performed in the following three sub-steps:
1. Translate: In this step, the design is converted into technology-dependent circuit with the available
logic elements. During the translation, the Native Generic Database (NGD) file serves as an input file
and generates the Native Circuit Description (NCD) file.
2. Mapping: The NCD file generated at the translation step is taken as an input to map the program and
allocate the Configurable Logic Blocks (CLBs) and input/output buffer resources to all the basic logic
elements in the design.
3. Placing and Routing the Design: After the design is mapped to logic blocks, the place and route
program runs to place the blocks and performs wiring either based on timing constraint or without
timing constraint depending on the users choice.
4. Timing Simulation: After the evaluation of place and route design, timing simulation step checks the
routing delays and timing constraint using the timing analyzer program.
5. Bit Stream Generation: In this step, configuration bit stream is created for downloading to a target
device for formatting into a programming file.
201
Chapter 11
The board is built around Xilinx XC4VSX35 Virtex 4 FPGA and consists of the following components:
Power supply module that supplies 1.2 volts/2.5 volts/3.3 volts to the board through an adapter
Provision for clock input
10/100 Mbps Ethernet interface
RS 232 interface
User switches and LEDs
2 x 16 character LCD
4 MB flash disk
64 MB DDR SDRAM
Joint Test Action Group (JTAG) port
Configuration through platform Flash, PC4 JTAG Header, and System ACE
Connectors, such as P240 expansion interface and 800 Mbps LVDS interface
Development board is a very sophisticated board that can be used to develop a variety of applications.
Generally, when you want to develop a system, it is always good to procure such a board and develop the
prototype. After you are satisfied with the prototype, you can consider the option of developing your own
hardware that needs only the necessary interfaces or peripherals. For instance, if you do not need an
Ethernet interface, you can eliminate it in your hardware design.
In addition to the hardware board, you need a number of tools to develop the firmware, perform the
simulation, and then test the firmware, after it is ported onto the hardware. Specifically, you need the
following tools:
Xilinx ISE
ModelSim
ChipScope
202
Case Study: Xilinx Development Board
4 DTR OUT Data Terminal Ready. It is raised by DTE when power is on. In the auto-
answer mode, it is raised only when RI arrives from DCE.
5 GND - Ground
7 RTS OUT Request To Send. It is raised by DTE when it wishes to send. It also
expects CTS from DCE.
8 CTS IN Clear To Send. It is raised by DCE in response to RTS from DTE.
9 RI IN Ring Indicator. It is set when incoming ring detected - used for auto-
answer application. DTE raises DTR to answer.
203
Chapter 11
204
Case Study: Xilinx Development Board
The speed is specified in baud, that is, how many bits per second can be sent. For example, 1000 bauds
would mean 1000 bits per second, or that each bit lasts one millisecond.
Common implementations of the RS232 interface do not allow just any speed to be used. Some standard
speed parameters used for RS232 interface are 1200, 9600, 38400, and 115200 bauds.
The signals on wires use a positive or negative voltage scheme as follows:
1 is sent using -10V (or between -5V and -15V)
0 is sent using +10V (or between 5V and 15V)
Perform the following steps to connect the RS232 interface to a computer:
1. Connect the FPGA Spartan-3E kit to a laptop or computer using the USB port, as shown in Figure
11.7:
205
Chapter 11
206
Case Study: Xilinx Development Board
207
Chapter 11
6. Set the baud rate to a desired value depending on the design parameters. As the baud rate in the
present design is configured for 9600 baud, the following settings are chosen, as shown in Figure
11.13:
Summary
In this chapter, the Xilinx ISE version 10.1 and its architecture is been discussed. The design flow in the
Xilinx environment is performed in various steps, such as design entry, design verification, synthesis and
simulation, translate, map, and place and route. Finally, bit stream generation is programmed onto an
FPGA device. The block diagram of architecture with internal and peripheral components is also
discussed. In addition, you have learned the procedure to interface with the peripheral devices with
input/output devices, such as RS232 communication interface and USB, and display the data onto LCDs.
Questions
1. Explain the design verification process in Xilinx ISE.
2. What are the steps involved in the implementation of logic design in the Xilinx ISE tool?
3. Explain the procedure to interface with RS232.
4. Write the function of D9 cable.
5. What is baud rate? Give the permissible baud rates in the Xilinx 10.1 tool.
Exercises
1. Write a 2-bit synchronous counter in VHDL and verify the code using the Xilinx 10.1 tool.
2. Write the program to display the Hello word on the LCD through the keyboard interface.
3. Write a brief note on the components in Virtex Xilinx board.
4. Take any Spartan board and list all the components that are supported to interfacing with USB port.
208
12
Case Study:
Implementation of a
Communication System
If you need an information on: See page:
Xtreme DSP Board Overview 210
Design Details 212
Implementation Details 213
Simulation 225
Testing Environment 247
Chapter 12
Many engineers, new to Very Large Scale Integration (VLSI) technology, show a surprising face when
asked whether they can implement a communication system using Amplitude Modulation (AM) on Field-
Programmable Gate Array (FPGA). After all, these signals are analog and FPGA handles only digital
signals. However, you can develop extremely complicated communication systems using FPGAs. In this
chapter, you learn how to implement a communication system using an FPGA development board
through a case study.
210
Case Study: Implementation of a Communication System
211
Chapter 12
Reconstruction filter—Immediately after DAC, a reconstruction filter is required to get high quality
analog signal from the DAC. This is called reconstruction filter.
Therefore, while selecting an FPGA-based development board for communication applications, you need
to select ADC and DAC based on the bandwidth of the signal, sampling rate, resolution, and input/output
signal levels. In addition, the board needs to have the necessary anti-aliasing filter and the reconstruction
filter.
Even if you do not have access to a development board, you can implement the communication system described in
this chapter. Of course, your study is only limited to test the system through simulation.
Design Details
In this case study, you will develop a communication system that takes an input signal, modulates it using
AM in the FPGA, and then demodulates the signal in the FPGA to get back the original signal. You also
learn how to generate sine waves, implement modulation and demodulation algorithms, and filter the
signal. In fact, the work presented can be used straight to develop a communication system based on
FPGA. Figure 12.2 shows an amplitude modulator and demodulator:
212
Case Study: Implementation of a Communication System
Implementation Details
In this section, the step-by-step procedure for implementing the communication system is given. To start
with, you will learn how to perform the simulation and testing. Then, you will port the code on the FPGA
and then test on the actual hardware. Even if you do not have access to a development board, you can
work on the first portion of this project.
213
Chapter 12
Figure 12.4: Displaying the New Project Wizard – Create New Project Window
2. Type the name of the project in the Project Name field.
3. Enter a location in the Project Location field or browse to a location (directory path) by clicking the
button located beside the field, for the new project.
4. Select an option from the Top-Level Source Type list, which has the following options:
i. HDL → Choose this option for VHDL / Verilog programming
ii. Schematics → Choose this option to work on Schematics
In our case, we have selected HDL.
5. Click the Next button. The New Project Wizard - Device Properties window appears, as shown in
Figure 12.5:
Figure 12.5: Displaying the New Project Wizard – Device Properties Window
6. Fill the values in the table given as follows:
Product Category: All
Family: Vertex4
Device: XC4VSX35
214
Case Study: Implementation of a Communication System
Package: FF668
Speed Grade: -10
Top-Level Module Type: HDL
Synthesis Tool: XST (VHDL/Verilog)
Simulator: Modelsim-SE VHDL
7. Select the Enable Enhanced Design Summary checkbox, if not selected.
8. Click the Next button to continue. The New Project Wizard – Project Summary window appears, as
shown in Figure 12.6:
Figure 12.6: Displaying the New Project Wizard – Project Summary Window
9. Click the Finish button to complete the creation of new project. The New Project Main Screen
appears, as shown in Figure 12.7:
Figure 12.7: Displaying the Project Window after Creating the New Project
215
Chapter 12
Figure 12.8: Displaying the New Source Wizard – Select Source Type Window
6. Click the Next button to continue. The New Source Wizard – Define Module window appears (Figure
12.9). Declare the ports for Entity (which contains all the inputs and outputs) by filling in the port
information. We will output the tone as a 14-bit value; and therefore, we have selected the Bus check
box and entered 13 and 0 in the MSB and LSB columns respectively for the tone_wave port name, as
shown in Fig 12.9:
Figure 12.9: Displaying the New Source Wizard - Define Module Window
7. Click the Next button. The New Source Wizard – Summary window appears, as shown in Figure
12.10:
216
Case Study: Implementation of a Communication System
217
Chapter 12
the DDS core on a variety of Xilinx processors, such as Virtex-4 FX, LX and SX families, Vertex-2 Pro,
Vertex-2, Vertex-E, Spartan-3E, Spartan-3, Spartan-2E, and Spartan 2.
In our example, we have chosen the sampling rate as 10 MHz. The number of output bits is 14. The
Spurious Free Dynamic Range (SFDR) would be equal to 6 times the number of bits or 84 dB.
Perform the following steps to generate a sine wave component:
1. Select VHDL Module, “tone – Behavioral (tone.vhd)” from the Sources tab of the Sources window and
right-click it to open a pop-up menu.
2. Select New Source from the pop-up menu. The New Source Wizard – Select Source Type window
appears, as shown in Figure 12.12:
Figure 12.12: Displaying the New Source Wizard – Select Source Type Window
3. Select IP (Coregen & Architecture Wizard) from the list box and enter the name of the component in
the File name field.
4. Click the Next button. The New Source Wizard – Select IP window appears, as shown in Figure 12.13:
218
Case Study: Implementation of a Communication System
219
Chapter 12
In the case of multiple frequencies, you need to select the Programmable radio button.
12. Click the NEXT button to continue. The Direct Digital Synthesizer dialog box shows the Phase Offset
Angles group, as shown in Figure 12.17:
220
Case Study: Implementation of a Communication System
If there is any requirement of changing the phase of the wave, then you can make the necessary changes in
the group. As there is no need for any phase offset in our example, you can move on to the next window
by clicking the Next button. The various pin selection groups appear, as shown in Figure 12.18:
221
Chapter 12
222
Case Study: Implementation of a Communication System
From this window, you can take the component and its instance; and instantiate it in the VHDL source
code (copying the component and its instance from the Language Templates and pasting them in the
VHDL module, tone.vhd). You can then change the instantiation variables, as per your requirement. After
the instantiation, the VHDL source code appears, as shown in Figure 12.21:
You need to ensure that the DDS clock rate and instantiated clock in the source code are the same.
19. Write a process block for clock division, as shown in Listing 12.1:
Listing 12.1: ToneGeneration.vhd
---------------Tone Generation------------
--Library Declaration
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--Entity Declaration
223
Chapter 12
entity tone is
--input port
--outport
);
end tone;
--Architecture Declaration
--signals Declaration
------------Component Declarations-----------
component sine
port (
--input
CLK : IN std_logic;
ACLR: IN std_logic;
--output
);
end component;
begin
----------Component Instantiations------------
u1: sine
port map (
CLK => clk_10M,
ACLR => rst,
SINE => msg_out
224
Case Study: Implementation of a Communication System
);
process(clk,rst)
begin
if(rst='1') then
if(cnt=4) then
else
end if;
end if;
end process;
end Behavioral;
Simulation
Before simulating the source code, you need to add Xilinx libraries in case you are using IP core
components from the COREGEN folder; otherwise, errors will occur while simulating with ModelSim.
The following libraries need to be added to the ModelSim:
Unisim
Simprim
Coregenlib
To add these libraries, you need to change the properties of Simulation Library Compiler Properties,
which can be found using the following steps:
1. Select the device name XC4VSX35-10ff668 in the Sources tab of the Sources window.
2. Expand Design Utilities in the Processes pane.
3. Right-click Compile HDL simulation libraries from the Design Utilities. A pop-up menu appears.
225
Chapter 12
4. Select Properties from the pop-up menu. The Simulation Library Compiler Properties window
appears, as shown in Figure 12.22:
Simulation in ModelSim
Perform the following steps to design and simulate the source code tone.vhd in ModelSim, which can be
opened from the Xilinx ISE8.2i window:
1. Click the source code name (tone.vhd) in the Sources window to find the ModelSim simulator in the
Process window.
2. Double-click Simulate Behavioral Model. The ModelSim simulator opens to simulate the source
code, as shown in Figure 12.23:
226
Case Study: Implementation of a Communication System
227
Chapter 12
After the successful loading, compilation, and simulation of design, the Waveform window appears, as
shown in Fig 12.25:
228
Case Study: Implementation of a Communication System
5. Specify clock period in the Period field and leave the remaining options unchanged.
6. Click the OK button.
7. Right-click rst (reset) in the window. A pop-up menu appears.
8. Select Force from the pop-up menu. The Force Selected Signal dialog box appears, as shown in
Figure 12.27:
Figure 12.29: Displaying the Waveform Window after Running the Code
We need to change the format of the output signal, as we require the output in the analog form.
11. Right-click the output wave. A pop-up menu is displayed.
12. Select Format from the pop-up menu. A sub pop-up menu appears.
13. Select Analog from the sub pop-up menu. The Wave Analog dialog box appears, as shown in Figure
12.30:
229
Chapter 12
230
Case Study: Implementation of a Communication System
AM Modulator Implementation
Modulation is a process in which the characteristics of the carrier signal wave are varied according to the
characteristics of the message. Any of the following characteristics of the carrier can be varied:
Amplitude
Frequency
Phase
If the amplitude is varied, it is called AM. If the frequency is varied, it is called Frequency Modulation. If
the phase is varied, it is called Phase Modulation. In good (or bad?) old days, the modulators and
demodulators used to be implemented in discrete circuitry. Subsequently, DSPs became the norm;
however, nowadays, FPGAs are used. The FPGA optimized for signal processing applications is the best
for these types of applications.
AM is defined as a process in which amplitude of carrier wave c(t) is varied about a mean value linearly
with the baseband signal m(t). Mathematically, AM wave is represented as follows:
AM modulated wave = Ac[1 + ka m(t)] cos(2fc )
= [1 + ka m(t)] c(t)
In this equation, ka is called the Modulation Index. For simplicity, we will take ka value as 1.
Perform the following steps to generate AM signals:
Step 1: Generate a 1 KHz tone signal m(t) from Xilinx ISE IP Coregen as explained in the Generation of 1
KHz Sine Wave (Tone) Component section. The tone is generated, as shown in Figure 12.32:
231
Chapter 12
232
Case Study: Implementation of a Communication System
vi. Select the desired options from the dialog box as follows:
Output Options : Registered
Latency : 1
Carry/Overflow Options: Clear Carry/Borrow Input
Layout : Create RPM
vii. Click the Generate button to generate the adder component.
Step 4:
i. Multiply the result in step 3 with the carrier wave. To do this, select the Multiplier component from
the New Source Wizard – Select IP window, as shown in Figure 12.36:
233
Chapter 12
iii. Click the Finish button. The Multiplier v8.0 dialog box appears, as shown in Figure 12.38:
234
Case Study: Implementation of a Communication System
entity am_mod is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
am_out : out STD_LOGIC_VECTOR (13 downto 0));
end am_mod;
--------------------------------------------------------------------
----------------- INTERNAL SIGNAL DECLARATIONS ---------------------
--------------------------------------------------------------------
235
Chapter 12
--------------------------------------------------------------------
component carr
port (
CLK: IN std_logic;
ACLR: IN std_logic;
SINE: OUT std_logic_VECTOR(13 downto 0));
end component;
component adder
port (
A: IN std_logic_VECTOR(13 downto 0);
Q: OUT std_logic_VECTOR(15 downto 0);
CLK: IN std_logic);
end component;
component mul
port (
clk: IN std_logic;
a: IN std_logic_VECTOR(13 downto 0);
b: IN std_logic_VECTOR(15 downto 0);
q: OUT std_logic_VECTOR(29 downto 0));
end component;
---------------------------------------------------------------------
begin
u1 : msg
port map (
CLK => CLK_10M,
ACLR => rst,
SINE => msg_out);
236
Case Study: Implementation of a Communication System
u2 : carr
port map (
CLK => CLK_10M,
ACLR => rst,
SINE => carr_out);
u3 : adder
port map (
A => msg_out,
Q => adder_out,
CLK => CLK);
u4 : mul
port map (
clk => clk,
a => carr_out,
b => adder_out,
q => mul_out);
----------------------------------------------------------------------
process(clk,rst)
begin
if(rst='1') then
clk_10M <= '0';
cnt <= 0;
elsif(clk'event and clk='1') then
if(cnt=4) then
clk_10M <= not clk_10M;
cnt<= 0;
else
cnt <= cnt +1;
end if;
end if;
end process;
----------------------------------------------------------------------
am_out <= mul_out(29 downto 16);
end Behavioral;
237
Chapter 12
AM Demodulation
In the demodulation process, the carrier is removed from the modulated signal to get back the original
message. Demodulation involves two steps: envelope detection and low pass filtering, as shown in Figure
12.41:
Envelope Detector
An envelope detector is realized in hardware using a diode, capacitor, and resistor (Figure 12.42). The
envelope detector takes the high frequency signal (in our case, the amplitude modulated signal) as input
and gives an output, which is the envelope of the original signal. The capacitor in the circuit stores the
charge on the rising edge and releases it slowly through the resistor, when the signal falls. The diode
ensures that the current does not flow backward to the input of the circuit. Fig 12.42 shows the envelope
detector:
238
Case Study: Implementation of a Communication System
239
Chapter 12
240
Case Study: Implementation of a Communication System
When you design filters, initially you need to generate the filter coefficients using MATLAB. These filter coefficients have
to be loaded in the .coe format.
vi. Click the Next button to go to the next page of the dialog box, as shown in Figure 12.46:
241
Chapter 12
242
Case Study: Implementation of a Communication System
entity am_demod is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
dmod_out : out STD_LOGIC_VECTOR (13 downto 0));
end am_demod;
------------------------------------------------------------------
-----------------INTERNAL SIGNAL DECLARATIONS---------------------
------------------------------------------------------------------
signal am_out1 :std_logic_vector(13 downto 0);
signal rfd,rdy :std_logic;
signal clk_10M :std_logic;
signal cnt :integer;
signal envelope :std_logic_vector(13 downto 0);
signal lpf_out :std_logic_vector(36 downto 0);
signal lpf_out1 :std_logic_vector(13 downto 0);
------------------------------------------------------------------
243
Chapter 12
------------------------------------------------------------------
-------------- COMPONENT DECLARATIONS ---------------------------
------------------------------------------------------------------
component am_mod
port(
clk :in std_logic;
rst : in std_logic;
am_out :out std_logic_vector(13 downto 0));
end component;
component lpf_norm
port (
sclr: IN std_logic;
clk: IN std_logic;
nd: IN std_logic;
din: IN std_logic_VECTOR(13 downto 0);
rfd: OUT std_logic;
rdy: OUT std_logic;
dout: OUT std_logic_VECTOR(36 downto 0));
end component;
------------------------------------------------------------------
begin
u5: am_mod
port map(
clk => clk,
rst => rst,
am_out => am_out1);
u6 : lpf_norm
port map (
sclr => rst,
clk => clk_10M,
nd => '1',
din => envelope,
rfd => rfd,
rdy => rdy,
dout => lpf_out);
------------------------------------------------------------------
------------------------------------------------------------------
------------- Clock Division Block -------------------------------
------------------------------------------------------------------
process(clk,rst)
begin
if(rst='1') then
cnt <= 0;
clk_10M <= '0';
244
Case Study: Implementation of a Communication System
------------------------------------------------------------------
------------------------------------------------------------------
-----------------State Machine Block -----------------------------
------------------------------------------------------------------
process(clk_10M,rst)
begin
if rst = '1' then
present_val <= 0;
else
present_val <= conv_integer(am_out1);
end if;
end process;
process(clk_10M,rst)
begin
if rst = '1' then
prev_val <= 0;
elsif (clk_10M'event and clk_10M = '1') then
prev_val <= present_val;
end if;
end process;
process(clk_10M,rst)
begin
if rst = '1' then
state_v <= s0;
out1 <= 0;
out1 <= 0;
when s1 =>
if (prev_val <= present_val) then
245
Chapter 12
when s2 =>
if prev_val < present_val then
state_v <= s1;
-- out2 <= prev_val;
elsif prev_val >= present_val then
state_v <= s2;
end if;
end case;
end if;
end process;
end Behavioral;
246
Case Study: Implementation of a Communication System
Device Utilization
You can find out the resource utilization of FPGA for the AM Modulation and Demodulation for a given
FPGA. Table 12.1 and Table 12.2 gives the device utilization summaries for the modulator and
demodulator when the design is synthesized using the target devices as XC4VSX35-12FF668:
Table 12.1: Device Utilization Summary for AM Modulator
Device Utilization Summary (Estimated Values)
Logic Utilization Used Available Utilization
Number of GCLKs 3 32 9%
Testing Environment
Based on user requirements, area constraints and pin assignments can be given during the physical design
implementation process to configure the digital design onto FPGA board. This section provides the
physical design implementation process for the given verified design. The procedure to assign input and
output pins to the DAC /ADC design and size of the chip is been described in this section in detail.
247
Chapter 12
signal is then modulated using the carrier generated in the FPGA. The modulated signal can be obtained
from one of the DAC outputs. After ensuring that you are getting the correct output (by observing the
waveform or spectrum), you can give this output as input to the second ADC. You can then demodulate
the signal in the FPGA and get back the message signal from the second DAC output. After testing the
communication system using a tone, you can give voice signal as input and check whether you are able to
get back the voice signal without any distortion using the setup, as shown in Figure 12.50:
Figure 12.50: Displaying the Test Setup for Testing the Communication System
248
Case Study: Implementation of a Communication System
When programming the FPGA, you need to check the data sheets to find out the format of the output of the ADC and
the input to the DAC.
The complete code for AM Modulation and Demodulation in real-time using the FPGA board are given in
Listing 12.3 and Listing 12.4, respectively:
Listing 12.3: AM Modulation in Real-Time
File name: am_mod.vhd
-- Create Date: 15:24:53 09/12/2010
-- Design Name:
-- Module Name: am_mod - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_SIGNED.ALL;
entity am_mod is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
message :in std_logic_vector(13 downto 0);
----------- DAC SETUPS -----------------------
-- dac reset signals
DAC1_RESET : out std_logic;
DAC2_RESET : out std_logic;
-- dac setup
DAC1_MOD0 : out std_logic;
DAC1_MOD1 : out std_logic;
DAC2_MOD0 : out std_logic;
DAC2_MOD1 : out std_logic;
-- dac clock divider setup
DAC1_DIV0 : out std_logic;
DAC1_DIV1 : out std_logic;
DAC2_DIV0 : out std_logic;
DAC2_DIV1 : out std_logic;
------------------------------------------------
249
Chapter 12
------------------------------------------------------------------------
-----------------INTERNAL SIGNAL DECLARATIONS --------------------------
------------------------------------------------------------------------
-----------------------------------------------------------------------
component carr
port (
CLK: IN std_logic;
ACLR: IN std_logic;
SINE: OUT std_logic_VECTOR(13 downto 0));
end component;
component adder
port (
A: IN std_logic_VECTOR(13 downto 0);
Q: OUT std_logic_VECTOR(15 downto 0);
CLK: IN std_logic);
end component;
component mul
port (
clk: IN std_logic;
a: IN std_logic_VECTOR(13 downto 0);
b: IN std_logic_VECTOR(15 downto 0);
q: OUT std_logic_VECTOR(29 downto 0));
end component;
--------------------------------------------------------------------
begin
250
Case Study: Implementation of a Communication System
u2 : carr
port map (
CLK => CLK_10M,
ACLR => rst,
SINE => carr_out);
u3 : adder
port map (
A => msg_out,
Q => adder_out,
CLK => CLK);
u4 : mul
port map (
clk => clk,
a => carr_out,
b => adder_out,
q => mul_out);
251
Chapter 12
end Behavioral;
Listing 12.4: AM Demodulation in Real-Time
-----------------------------------------------------------------------
--File name: am_demod.vhd
-- Create Date: 17:08:22 08/08/2007
-- Design Name:
-- Module Name: am_demod - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
-----------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_SIGNED.ALL;
entity am_demod is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
message :in std_logic_vector(13 downto 0);
am_in :in std_logic_vector(13 downto 0);
252
Case Study: Implementation of a Communication System
component am_mod
port(
clk :in std_logic;
rst : in std_logic;
message :in std_logic_vector(13 downto 0);
am_out :out std_logic_vector(13 downto 0));
end component;
component lpf_norm
port (
sclr: IN std_logic;
clk: IN std_logic;
nd: IN std_logic;
253
Chapter 12
begin
u6 : lpf_norm
port map (
sclr => rst,
clk => clk_10M,
nd => '1',
din => envelope,
rfd => rfd,
rdy => rdy,
dout => lpf_out);
254
Case Study: Implementation of a Communication System
end if;
end if;
end process;
process(clk_10M,rst)
begin
if rst = '1' then
prev_val <= 0;
elsif (clk_10M'event and clk_10M = '1') then
prev_val <= present_val;
end if;
end process;
process(clk_10M,rst)
begin
if rst = '1' then
state_v <= s0;
out1 <= 0;
out1 <= 0;
when s1 =>
255
Chapter 12
when s2 =>
if prev_val < present_val then
state_v <= s1;
elsif prev_val >= present_val then
state_v <= s2;
end if;
end case;
end if;
end process;
end Behavioral;
256
Case Study: Implementation of a Communication System
257
Chapter 12
Step 3:
Go to the Processes dialog box, select Generate Programming File, and run it.
It will generate the bit file, which you can locate in the project folder.
Step 4:
Generate the clock bit file for Virtex-2 (XC2V80-4CS144) after completion of the bit file generation for
am_dmod.vhd.
Create a new project and generate the required clock based on the source code, given in Listing 12.5:
Listing 12.5: Clock Generation
--Clock Generation
--Filename: clk_10m-vhd
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_SIGNED.ALL;
entity OSC_CLOCK is
Port ( OSC_IN : in std_logic;
rst : in std_logic;
DAC0_CLKp : out std_logic;
DAC0_CLKn : out std_logic;
DAC1_CLKp : out std_logic;
DAC1_CLKn : out std_logic;
ADC0_CLKp : out std_logic;
ADC0_CLKn : out std_logic;
ADC1_CLKp : out std_logic;
ADC1_CLKn : out std_logic;
clk_out : out std_logic
);
end OSC_CLOCK;
component IBUF
port ( I: in std_logic;
O: out std_logic
);
end component;
component OBUFDS
port ( O: out std_logic;
OB: out std_logic;
I: in std_logic
);
end component;
component OBUF
port ( I: in std_logic;
O: out std_logic
);
end component;
258
Case Study: Implementation of a Communication System
begin
process(clk,rst)
begin
if(rst='1') then
cnt <= 0;
clk_10M<= '0';
elsif(clk'event and clk='1') then
if(cnt=4) then
clk_10M <= not clk_10M;
cnt <=0;
else
cnt <= cnt+1;
end if;
end if;
end process;
clk_105M<= clk;
H6: IBUF port map (I => osc_in, O => clk);
H1: OBUFDS port map (I => clk_105M, O => DAC0_CLKp, OB => DAC0_CLKn);
H2: OBUFDS port map (I => clk_105M, O => DAC1_CLKp, OB => DAC1_CLKn);
H3: OBUFDS port map (I => clk_105M, O => ADC0_CLKp, OB => ADC0_CLKn);
H4: OBUFDS port map (I => clk_10M, O => ADC1_CLKp, OB => ADC1_CLKn);
H5: OBUF port map (I => clk_105M, O => CLK_OUT);
end Behavioral;
--End of source code
In the preceding code, 105 MHz is the clock frequency at which the FPGA board operates. You need to generate the
necessary clock frequency based on your requirements.
Step 5: Generate the bit file for clock by using the same procedure as explained in the steps 1, 2, 3, and 4.
Step 6: Open the FUSE software by clicking the following icon:
259
Chapter 12
260
Case Study: Implementation of a Communication System
Step 9: Give the inputs to the ADCs and observe the outputs of DACs on either an oscilloscope or a
spectrum analyzer.
You can connect the ADC output to an oscilloscope or a spectrum analyzer to observe the modulated
output. In addition, you can loop back, obtain the demodulated output, and observe the demodulated
signal at the DAC output.
Instead of giving the single tone as input, you can also input voice and observe the output. If the voice
output from the DAC is of the same quality as that of the voice input to the ADC, then you are sure that
your AM/demodulation implementation in the FPGA is working fine.
Summary
You can implement a communication system on an FPGA board that has the necessary ADC and DAC
components. The ADC and DAC have to be chosen keeping in view the frequencies of the input and
output signals. You can interface an ADC and a DAC to the FPGA. Then you can digitize the signal and
carry out the entire signal processing within the FPGA. This technique is used in various applications,
such as audio processing, video processing, imaging, software radio, and wireless communication. To
implement filters, such as low pass, high pass and band pass, you can generate the filter coefficients using
MATLAB and then use them in the Xilinx ISE. While implementing digital signal processing algorithms in
an FPGA, care needs to be taken by giving due consideration to the finite word length effects.
Questions
1. You can implement digital signal processing algorithms in an FPGA.
(a) True (b) False
2. A signal has a bandwidth of 20 KHz. The minimum sampling frequency is
(a) 20 KHz (b) 40 KHz (c) 80 KHz (d) 40 MHz
3. An anti-aliasing filter is an optional component before analog to digital conversion.
(a) True (b) False
4. The DDS is used to generate a signal of desired frequency
(a) True (b) False
5. Finite word length effects are not significant in an FPGA implementation.
(a) True (b) False
261
Chapter 12
Exercises
1. Study the data sheets for ADC and DAC components used in the development board described in this
chapter.
2. Instead of using a carrier frequency of 455 KHz, can you use a carrier frequency within the high
frequency band? What factors are to be considered to check whether the development board can
support this change in the carrier frequency?
262
13
Case Study:
System-On-Chip
Development
If you need an information on: See page:
System-On-Chip Requirements 264
Design 265
Implementation 266
Chapter 13
System-On-Chip Requirements
In the present day scenario, there have been great advancements in process technologies that lead to
high-speed devices, such as Application Specific Integrated Circuit (ASIC) chips, Random Access
Memory (RAM) chips, microprocessors, and multicore processors. The most challenging task for
electronic system designers is to meet the time-to-market deadline and chip size. Modern integrated
systems are designed with combination of many functional blocks comprising processor cores, dedicated
communication interfaces, on-chip memories, and buses to meet the market demands. These
advancements have made possible the development of System-On-Chip (SOC) devices.
SOC is an integrated circuit that includes a processor, a bus, and other elements on a single monolithic
substrate. These complete systems integrated onto a single chip are called SOC. It enables you to
combine a number of gates to build complex functions to meet market demands. In other words, this
enables semiconductor manufacturers to meet specific system requirements cost-effectively while
delivering competitive time-to-market advantage. Added advantage of integration onto one-chip is
reduction of power consumption and area.
Complex functionalities previously required using heterogeneous devices are placed on a Printed Circuit
Board (PCB). Digital systems designed with PCB result in area and power consuming digital systems.
These PCBs having several chips in one package are replaced into one single integrated chip with all the
components built in as SOCs. Present day digital products, such as those used in hand-held devices, are
replaced by SOC design.
Following are the examples of SOCs:
Smart phones with features of camera
Video Graphics Array (VGA) displays
Bluetooth
Multi format music players
Various components in a typical SOC components are given as follows:
Volatile memory systems and non-volatile memory systems
RAM, Electrically Erasable Programmable Read Only Memory (EEPROM), flash memories, and
on-chip memories
Processing units
Accelerated functional units and graphical processors units
General purpose processor- multiprocessor
Specific purpose processor – microcontroller
Digital signal processors
Mixed signal circuits and logic circuits
Analog-to-Digital Converter (ADC) and Digital-to-Analog Converter (DAC)
Micro electronic and mechanical systems
Oscillators and phase-locked loops
Optical input-output sensors
Radio frequency components
Communication channels
High speed bus and Direct Memory Access (DMA) controllers
Following are some of the advantages of SOC devices:
264
Case Study: System-On-Chip Development
Design
As already learned, requirements for SOC give a clear idea to design an efficient SOC. The designs of
SOC in several application domains are often subject to requirements in terms of processing
performance and flexibility. Programmability feature also plays a vital role in these single-chip
architectures; thereby, offering the desired flexibility in the design, while maintaining the advantages of
customized VLSI solutions, such as optimized power dissipation and processing performance.
To create a flexible and low-cost design in a short cycle, design reusability principle enables robustness,
modularity, and configurability in design. Design reusability implies that hardware and software
component designs for specific or general purpose can be reused to accomplish the task with
modifications. This method of designing SOC is called Intellectual Property (IP) based SOC design.
As time-to-market pressures and product complexities climb, the need to reuse complex building blocks
or components (known as IP or virtual component) also increases. Advantage of reusability is to ensure
correctness and decrease in design time. Some components, such as processor architectures (RISC,
SPARC, and ARM) and functions for specific domain, such as signal processing (DCT and FFT),
telecommunication, and multimedia (VLC and Turbo codes) are used as reusable components to build
SOCs. Therefore, an important issue arises that how to use these hardware or software components and
to what extent.
Depending on the application, various application-specific architectures using different execution
models and combinations of software and hardware components may be required; for example,
flexibility in programmability, performance, and power computing. Even the choice of the
265
Chapter 13
programmable processor is heavily dependent on the application. The processor communicates with
dedicated hardware accelerators through a standard on-chip hardware/software bus, such as Amba,
Avalon, and IBM CoreConnect, using control logic and specific memory blocks. Coprocessors and
hardware accelerators usage depends on the application complexity and the computing constraint
requirements. To give more flexibility and adaptability to the SOC, the reconfigurable technology plays
an important role.
IP-based designs are divided into three categories based on their flexibility feature to the designer’s
point of view to make an efficient and easy way to reuse the components.
Classification of IP-based design approaches is as follows:
Hard core/hard IP
Soft core/soft IP
Firm core/firm IP
Let’s learn about these approaches in detail.
Hard Core/Hard IP
Designers provide a design in a black box form, which is a layout of the component with details about
basic information, such as functionality, input, and output details. Designers can use it as a component
without changing the functionality, but input combinations can vary. These designs are encrypted and
optimized. The black boxes are verified, synthesized, and then given to the designer in the form of
layouts. The disadvantage of hard core/hard IP is that functionalities are very hard to modify. Example
of a hard core/hard IP is microprocessors.
Soft Core/Soft IP
A designer can choose soft core IP components where the components can be redesigned with minor
modifications based on specifications. Register transfer level design written in any Hardware
Description Language (HDL) is simulated and synthesized to ensure the correctness of functional
behavior. Designer is responsible to design with respect to timing, delay, and power constraints. This is
more flexible for designers. The advantages of soft core/soft IP are easy to modify functionalities and
easy to change processes.
Firm Core/Firm IP
A simulated netlist is given in the form of gate-level netlist to the designer. Gate-level netlist consists of
gates and the interconnections between the gates. There is flexibility to change the connections between
nodes and synthesize the design. The visibility of the design in this case is more as compared to the hard
core/hard IP to the designers. The disadvantage of firm IP is hard to modify the functionalities of
modules; however, its advantage is easy to change processes.
Typically, these cores act as a platform to generate a required application onto a single chip. Let’s now
discuss how these different types of cores are useful for SOC implementation.
Implementation
SOC implementation management requires a robust co-design environment to master the complexity
and different refinement steps of the system from a high-level specification.
Any embedded application can be built using common architecture blocks and customized specific
components. Processors, memories, and bus interfaces are some examples of common architectures;
whereas, IP tools and IP library components are examples of customized specific components. Common
architectures and supporting technology components to use these common architectures are called
266
Case Study: System-On-Chip Development
platforms. Cores are provided to the designers as a platform to build SOCs by stitching the components
together for a specific application with the help of platforms known as platform-based systems for
development applications.
Platforms are not just hardware components. They consists of IP blocks in the form of hardware
components (embedded computer processing unit and memory), supporting components (real world
interfaces and mixed signal blocks), and software components (device drivers, real-time operating
systems, and application codes) for developing applications onto SOCs,
IP blocks or cores can be taken in the hard form, soft form, or firm form and added onto the design to
generate SOC for the required application. These basic components can be packaged in terms of
hardware or software elements and delivered to the customer for application development. Components
used in this case are not silicon compilation but using the components that are provided by the
manufacturers include both hardware and software components. This method of designing is known as
platform-based architectures.
These design approaches can be performed in block-based or platform-based architectures.
Following are the various classes of platforms:
Full application platforms—These platforms allow derivative product designers to create complete
component by using the IP cores in terms of hardware modules and develop software on top of the
platform provided. For example, a complex dual processor architecture with hierarchical bus
systems combined to generate a specific application. A software component is to be developed to
use these platforms effectively. Examples of full application platforms are multiple processors
SOCs, hardware blocks, mixed signal elements, and customized software.
Processor centric platforms—Centered on specific processors (ARM), ST Microelectronics provide
software services, such as real time kernels to develop SOC on those platforms.
Communication centric platforms—Basic objective of these platforms is to provide communication
fabric optimized for applications related to communications.
Configurable Platforms—Designers can configure the device based on the applications. Field
Programmable Gate Arrays (FPGAs) are devices that consist of an array of configurable blocks with
programmable interconnects. With the help of these configurable blocks, designers can customize
the device in terms of both hardware and software. Altera and Xilinx are commercial vendors that
provide FPGAs devices. Altera FPGA devices consist of ARM core as IP library component;
whereas, Xilinx Virtex-II Pro consists of PowerPC.
267
Chapter 13
Summary
SOC consists of two or more complex components integrated onto a single chip. With the advent of deep
sub-micron technology, there are tight constraints on power consumption of VLSI circuits. Examples of
SOC devices are mobile devices that are hand-held and battery-operated with smart features integrated
on a chip. Based on design reuse principle, SOCs are generated for a specific application. Advantages of
SOC are power optimization and cost effective designs. The different forms of IP designs are hard, soft,
and firm. These forms create a platform, which consists of common architecture blocks in any of three
forms and software components associated to interconnect these blocks. The SOCs are implemented on
block-based designs or platform-based designs.
Questions
1. Why SOCs are performance oriented designs?
2. Write the details of various forms of IP designs.
3. What are the advantages of hard core IP over soft core IP?
4. What is platform? What are different types of platforms?
5. Explain the implementation strategy of SOC designs.
Exercises
1. Draw the SOC architecture for smart-mobile devices.
2. Discuss the requirements for network-based applications.
3. Device the requirement for network-on-chips.
4. Derive a procedure to design SOC for video conference.
268
14
Future Trends
If you need an information on: See page:
Ubiquitous Computing and Pervasive Computing Technologies 270
VLSI Design Trends 271
Chapter 14
The developments in the last few decades in Very Large Scale Integration (VLSI) technology paved way
for many exciting applications as well as miniaturization of computing devices. This is just the beginning.
In future, we are going to witness revolutionary developments in VLSI design with the invention of new
devices and their models as well as nano-technology, which is becoming a commercial viability. The
Electronic System Level (ESL) tools will make the design of VLSI chips a child’s play. All these
developments will result in invisible computing, which is extremely powerful computing devices that are
very small and invisible.
270
Future Trends
minimum power requirements need to be addressed. Existing devices that support pervasive computing
are smart devices with flexible/invisible transistor size, specific-purpose devices (Application Specific
Integrated Circuits), reconfigurable architectures (Field Programmable Gate Arrays), smart sensors, and
computing devices with network- on-chip/systems-on-chip. Apart from these challenges, issues to be
addressed in the areas, such as distributed computing, semantic Web, artificial intelligence, Web ontology,
reinforcement learning, and human computer interaction, are to develop a modeling language to express
complex nature of ontologies.
The research has been carried out actively at various leading institutions as a part of ubiquitous
computing. Some of the institutions with details of the projects undergoing in the ubiquitous/pervasive
computing field are listed as follows:
Xerox's PARC has been working on pervasive computing applications since 1980s.
IBM's project Planet Blue, focused on finding ways to integrate existing technologies with a wireless
infrastructure.
Carnegie Mellon University's Human Computer Interaction Institute (HCII) is working on a project
named Aura, whose stated goal is to provide each user with an invisible halo of computing and
information services that persists regardless of location.
Massachusetts Institute of Technology (MIT) has a project called Oxygen. MIT named their project
after oxygen because they envision a future of ubiquitous computing devices as freely available and
easily accessible as oxygen.
Let’s now learn about the importance of VLSI technologies to meet the challenges in pervasive
technologies.
271
Chapter 14
272
Future Trends
Summary
The topics presented in this chapter include the introduction of state-of-the-art computing technologies,
such as ubiquitous computing and its various challenges to come to a reality in present day era. The
challenges in pervasive computing need to be addressed by researchers are identified as a smart
environment to adapt new technologies in short-turnaround time. Interoperability feature is to be
incorporated across the devices and reliability for secure data transfers at the cost of location-ware
technologies.
273
Chapter 14
An insight about the projects related to pervasive/ubiquitous undergoing successfully at Xerox Palo Alto
research center, IBM, Carnegie Melon University, and MIT are detailed. In this chapter, the trends in VLSI
design are identified and discussed. An increase in circuit complexity and device count on a die is vital to
meet the demands of time-to-market trend for VLSI designs. Another important trend is increase in
designer’s productivity that leads to demand for highly sophisticated CAD tools. ESL tools provide
solutions to meet the requirements of designer’s productivity and reusability. Design flow of ESL tools
consists of three phases: specification, exploring, and refining. System C and Spec C are languages,
provided for behavioral level or abstraction level description of the design, are compiled with C/C++
compilers. These tools synthesize the high-level designs into RTL code and aid for further steps.
274
A
VHDL and Verilog Examples
This appendix contains the source code with simulation results to give the VHSIC Hardware Description
Language (VHDL) and Verilog Hardware Description Languages (HDLs) code usage.
The VHDL source code, test bench for functional simulation, simulation results using waveforms, and
synthesis report generated by the Xilinx ISE tool are given. Some of the examples listed as follows are also
solved:
4-bit comparator
4-bit binary counter
Decoder
De-multiplexer
D flip-flop
Dual Port Random Access Memory (DPRAM)
Queue
Verilog source code and test bench with sample output is listed for the following two examples:
4-bit ripple adder
4x4 sequential and array multiplier
Comparator
Block Diagram:-
Appendix A
DESCRIPTION:- A 4-bit two input comparator compares two inputs (inputa and inputb) and gives
output (comp) as high if both the inputs are equal; otherwise, the output remains low.
Input ports:
a. Inputa (3 downto 0) : 4-bit input data a
b. Inputb (3 downto 0) : 4-bit input data b
Output port:
a. comp : Single bit output to indicate whether inputa and inputb are equal or not. If they are equal, then
comp is asserted high.
----PROGRAM OF COMPARATOR----
-- Title : comparator
-- Project : jntu
-------------------------------------------------------------------------------
-- File : comparator.vhd
-- Author : <ICS@SOMESH>
-- Created : 2006/02/01
-- Last modified : 2006/02/01
-------------------------------------------------------------------------------
-- Description : comparator to compare to no.’s
-------------------------------------------------------------------------------
-- Modification history :
-- 2006/02/01 : created
-------------------------------------------------------------------------------
end my_comp;
begin -- my_comp
comp <= '1' when (inputa = inputb) else '0'; -- comparering both
the input
end my_comp_a;
276
VHDL and Verilog Examples
-- File : comparator_ts.vhd
-- Author : <ICS@SOMESH>
-- Created : 2006/02/07
-- Last modified : 2006/02/07
-------------------------------------------------------------------------------
-- Description :test bench for comprator
-------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY comparator_vhd IS
END comparator_vhd;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: my_comp PORT MAP(
inputa => inputa,
inputb => inputb,
comp => comp
);
tb : PROCESS
BEGIN
inputa <= inputa + 1; -- input to inputa
inputb <= inputb + 3; -- input to inputb
-- Wait 100 ns for global
reset to finish
wait for 100 ns;
277
Appendix A
SIMULATION RESULT
a. functional simulation
Timing summary:
----------------------------
Maximum path delay from/to any NODE: 5.836ns
278
VHDL and Verilog Examples
Counter
Block Diagram:-
DESCRIPTION:- A 4-bit counter has two inputs, reset (rst) and clock (clk), and two outputs, output (3
downto 0), which gives one count value on each positive (+ve) edge of clock and counth, which will be
high only for one clock cycle if the required count value is counted. For example, if we are counting 12,
then counth will be high as soon as we count 12. The advantage is that we do not have to add extra
comparator circuit with the counter as an extra hardware. Though there is one comparator inside the block
itself, which is used to compare only zero, it takes less hardware as compared to other comparators that
are used to compare any number.
In the generic of the source code, we have to specify that up to which value we want to count and its
required bit width. For example, in the following source code, 4 bits are given to count 15 in the generic
inputs, outputwidth and countupto.
Input ports:
a. rst : It is an active high reset
b. clock : Maximum operating frequency is 758.409 MHz
Output ports:
a. output(3 downto 0) : One count value on each +ve edge of clock
b. counth : High for one clock cycle as soon as the required count number is reached
given in the generic input, countupto
----PROGRAM OF counter----
-------------------------------------------------------------------------------
-- TITLE : 4 BIT COUNTER
-- PROJECT : COUNTER
-------------------------------------------------------------------------------
-- FILE : 4BITCOUNTER.VHD
-- AUTHOR : <ADMINISTRATOR@SOMESH>
-- CREATED : 2006/01/31
-- LAST MODIFIED : 2006/01/31
-------------------------------------------------------------------------------
-- DESCRIPTION :
-- 4 BIT COUNTER WITH ASYNCRONOUS RESET
-------------------------------------------------------------------------------
-- MODIFICATION HISTORY :
-- 2006/01/31 : CREATED
------------------------------------------------------------------------------------
--------------------------------------------------------
LIBRARY IEEE; -- LIBRARY DECLARATION
USE IEEE.NUMERIC_STD.ALL;
279
Appendix A
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
-- ENTITY DECLARATION
ENTITY COUNTER IS
GENERIC (COUNTUPTO : INTEGER := 15; -- NO. UP TO WHICH COUNTER TO COUNT
OUTPUTWIDTH : INTEGER := 4 -- NO. OF BITS REQUIRED FOR IT
);
-- INPUT PORTS
PORT (CLK : IN STD_LOGIC; -- CLOCK INPUT
RST : IN STD_LOGIC; -- RESET INPUT
-- OUTPUT PORTS
OUTPUT : OUT STD_LOGIC_VECTOR((OUTPUTWIDTH -1) DOWNTO 0);
counth : out std_logic -- it will high for one clock cycle
AFTER
-- counting spacified no.of count value
);
END COUNTER;
-- SIGNAL DECLARATION
SIGNAL COUNT : STD_LOGIC_VECTOR((OUTPUTWIDTH -1) DOWNTO 0);
SIGNAL COUNTPOINT : STD_LOGIC;
BEGIN --
4BIT_COUNTER_A
PROCESS (CLK, RST)
BEGIN -- PROCESS
--
ACTIVITIES TRIGGERED BY ASYNCHRONOUS RESET
IF RST = '1' THEN -- (ACTIVE HIGH)
COUNT <= STD_LOGIC_VECTOR(TO_UNSIGNED((COUNTUPTO -1),OUTPUTWIDTH));
--
ACTIVITIES TRIGGERED BY RISING EDGE OF CLOCK
ELSIF CLK'EVENT AND CLK = '1' THEN
IF CONV_INTEGER(COUNT) = 0 THEN -- COUNTER
COUNTPOINT <= '1';
COUNT <=STD_LOGIC_VECTOR(TO_UNSIGNED((COUNTUPTO - 1),OUTPUTWIDTH));
ELSE
COUNTPOINT <= '0';
COUNT <= COUNT - '1';
END IF;
END IF;
END PROCESS;
OUTPUT <= COUNT;
COUNTH <= COUNTPOINT;
END COUNTER_A;
------------------------------------------------------------------------------------
--------------------------------------------------------
280
VHDL and Verilog Examples
ENTITY counter_ts_vhd IS
END counter_ts_vhd;
--Inputs
SIGNAL clk : std_logic := '0';
SIGNAL rst : std_logic := '0';
--Outputs
SIGNAL output : std_logic_vector(3 downto 0);
SIGNAL counth : std_logic;
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: counter PORT MAP( clk => clk,
rst => rst,
output => output,
counth => counth
);
-- genrating clock
clk <= '1' after 10 ns when clk ='0' else '0' after 10 ns;
-- genrating reset
rst <= '1','0' after 20 ns,'1' after 300 ns,'0' after 400 ns ;
tb : PROCESS
BEGIN
-- Wait 100 ns for global reset to finish
wait for 100 ns;
IF NOW >= 40000 NS THEN
------------------------------------------------------------------------------------
--------------------------------------------------------
281
Appendix A
SIMULATION RESULT
1. functional simulation
Timing summary
----------------------------
Minimum period: 1.319ns (Maximum Frequency: 758.409MHz)
Minimum input arrival time before clock: 2.445ns
Maximum output required time after clock: 3.955ns
282
VHDL and Verilog Examples
Number of BUFG/BUFGCTRLs: 1 32 3%
DECODER
Block Diagram:-
DESCRIPTION:- A 3X8 decoder has four inputs: three selectl (2 downto 0) input lines for selecting the
output according to the inputs given to these input lines and enb to enable the decoder to function
according to the given input. It gives the desired output on eight output lines (output(7 downto 0)) one at
a time that go high according to the input line’s binary equivalent value.
It has one generic selectline input, which by default is defined.
Input ports:
a. selectl(2 downto 0) : Lines to select which output is to be high
b. enb : ENABLE should be high
Output port:
a. output(7 downto 0) : Output will be high according to the binary equivalent of selectl input lines
283
Appendix A
library ieee;
-- library declaration
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity decoder3x8 is
-- entity declaration
-- input ports
port (selectl : in std_logic_vector((selectline -1) downto 0);
-- input lines
enb : in std_logic;
-- enable it is active high
-- output ports
output : out std_logic_vector(((2**selectline)-1)downto 0)
);
end decoder3x8;
-- architecture declaration
architecture decoder3x8_a of decoder3x8 is
-- signal declaration
signal tempout : std_logic_vector(((2**selectline)-1)downto 0);
begin
284
VHDL and Verilog Examples
end loop;
-- (i) end of loop
end if;
end process;
output <= tempout;
end decoder3x8_a;
LIBRARY ieee;
-- library declaration
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
ENTITY decoder_ts_vhd IS
-- entity declaration
END decoder_ts_vhd;
-- Component Declaration
--signal declaration
--Inputs
SIGNAL enb : std_logic := '0';
SIGNAL selectl : std_logic_vector(2 downto 0) := (others=>'1');
--Outputs
285
Appendix A
enb <= '1','0' after 450 ns, '1' after 500 ns;
-- giving inputs to enable
testbench : PROCESS
BEGIN
END;
SIMULATION RESULT:
1. functional simulation
286
VHDL and Verilog Examples
3. showing delay
Timing summary:
----------------------------
Maximum path delay from/to any node: 7.260ns
287
Appendix A
DEMULTIPLEXERS
Block Diagram:
DESCRIPTION:- A 4 x 16 demultiplexer (DEMUX) has one data input, four select lines, and 16 output
lines. When input values are given to select lines, the decimal equivalent of that input value output signal
is assigned the input data; for example, 0010 means 2; therefore, output(2) is assigned input data.
Input ports:
a. input : Data input port
b. sel(3 downto 0) : Select line to select which output to assign input data Output port:
a. output(15 downto 0) : Output is assigned input data according to the select line input
288
VHDL and Verilog Examples
----PROGRAM OF DEMUX----
-------------------------------------------------------------------------------
-- Title : demux
-- Project : jntu
-------------------------------------------------------------------------------
-- File : demux.vhd
-- Author : <ICS@SOMESH>
-- Created : 2006/02/01
-- Last modified : 2006/02/01
-- Description :de multiplexer
-------------------------------------------------------------------------------
-- Modification history :
-- 2006/02/01 : created
-------------------------------------------------------------------------------
library ieee; -- library declaration
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
-- output
);
end demux;
begin --
demux_a
process (sel,input)
begin --
process
demux : for i in 0 to ((2**selectlines) -1) loop -- Genrating genric mux
if i = conv_integer(sel) then
output(i) <= input;
else
output(i) <= '0';
end if;
end loop demux;
end process;
end demux_a;
------------------------------------------------------------------------------------
---------------------------------------------
289
Appendix A
END COMPONENT;
--Inputs
SIGNAL input : std_logic := '0';
SIGNAL sel : std_logic_vector(3 downto 0) := (others=>'0');
--Outputs
SIGNAL output: std_logic_vector(15 downto 0);
BEGIN
tb : PROCESS
BEGIN
SEL <= SEL + 1;
-- Wait 10 ns for global reset to finish
wait for 10 ns;
if NOW >= 400 NS THEN
REPORT " SIMULATION IS SUCCESSFUL";
wait; -- will wait forever
END IF;
END PROCESS;
END;
------------------------------------------------------------------------------------
-----------------------
290
VHDL and Verilog Examples
SIMULATION RESULT:
a. functional simulation
Timing summary:
----------------------------
Maximum combinational path delay: 5.994ns
291
Appendix A
D FLIP-FLOP
Block Diagram: -
292
VHDL and Verilog Examples
DESCRIPTION:- The positive edge triggered D flip-flop samples its input and changes its output q and
q_bar at rising edge of controlling clock. The function of D flip-flop is the ability to hold the last value
stored. In the preceding block diagram, two types of D flip-flops with enable are shown: one with
synchronous reset and another with asynchronous reset. The function of enable is that when it is high,
external input is selected and used; and when it is low, current output of flip-flop is used.
In the following function table, every input is going on with rising edge of a clock:
----PROGRAM OF D Flip-flop----
-------------------------------------------------------------------------------
-- Title : D flip flop
-- Project : dff
-------------------------------------------------------------------------------
-- File : dff.vhd
-- Author : <Administrator@SOMESH>
-- Created : 2006/01/28
-- Last modified : 2006/01/28
-------------------------------------------------------------------------------
-- Description :
-- D Flip flop with syncronous and asynronous reset with enable
-------------------------------------------------------------------------------
-- Modification history :
-- 2006/01/28 : created
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity my_dff is
q : out std_logic; --
output Q
q1 : out std_logic;
q_bar : out std_logic; -- output q_bar
q_bar1: out std_logic
);
end my_dff;
293
Appendix A
begin -- my_dff_a
ENTITY dff_ts IS
END dff_ts;
294
VHDL and Verilog Examples
COMPONENT my_dff
PORT (
i_data : In std_logic;
i_data1 : In std_logic;
clk : In std_logic;
clk1 : In std_logic;
rst : In std_logic;
rst1 : In std_logic;
enb : In std_logic;
enb1 : In std_logic;
q : Out std_logic;
q1 : Out std_logic;
q_bar : Out std_logic;
q_bar1 : Out std_logic
);
END COMPONENT;
BEGIN
UUT : my_dff
PORT MAP (
i_data => i_data,
i_data1 => i_data1,
clk => clk,
clk1 => clk1,
rst => rst,
rst1 => rst1,
enb => enb,
enb1 => enb1,
q => q,
q1 => q1,
q_bar => q_bar,
q_bar1 => q_bar1
295
Appendix A
);
296
VHDL and Verilog Examples
STD.TEXTIO.write(TX_LOC, TX_TIME);
STD.TEXTIO.write(TX_LOC, string'("ns q_bar="));
IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, q_bar);
STD.TEXTIO.write(TX_LOC, string'(", Expected = "));
IEEE.STD_LOGIC_TEXTIO.write(TX_LOC, next_q_bar);
STD.TEXTIO.write(TX_LOC, string'(" "));
TX_STR(TX_LOC.all'range) := TX_LOC.all;
STD.TEXTIO.Deallocate(TX_LOC);
ASSERT (FALSE) REPORT TX_STR SEVERITY ERROR;
TX_ERROR := TX_ERROR + 1;
END IF;
END;
BEGIN
-- ------------- Current Time: 46ns
WAIT FOR 46 ns;
rst <= '0';
-- -------------------------------------
-- ------------- Current Time: 346ns
WAIT FOR 300 ns;
i_data <= '1';
-- -------------------------------------
-- ------------- Current Time: 746ns
WAIT FOR 400 ns;
i_data <= '0';
-- -------------------------------------
-- ------------- Current Time: 846ns
WAIT FOR 100 ns;
enb <= '1';
-- -------------------------------------
-- ------------- Current Time: 1146ns
WAIT FOR 300 ns;
i_data <= '1';
-- -------------------------------------
-- ------------- Current Time: 1746ns
WAIT FOR 600 ns;
i_data <= '0';
-- -------------------------------------
-- ------------- Current Time: 1846ns
WAIT FOR 100 ns;
i_data <= '1';
-- -------------------------------------
-- ------------- Current Time: 1946ns
WAIT FOR 100 ns;
i_data <= '0';
-- -------------------------------------
-- ------------- Current Time: 2046ns
WAIT FOR 100 ns;
i_data <= '1';
-- -------------------------------------
-- ------------- Current Time: 2246ns
WAIT FOR 200 ns;
i_data <= '0';
enb <= '0';
-- -------------------------------------
-- ------------- Current Time: 2546ns
297
Appendix A
298
VHDL and Verilog Examples
299
Appendix A
-- -------------------------------------
-- ------------- Current Time: 9646ns
WAIT FOR 300 ns;
i_data <= '0';
-- -------------------------------------
WAIT FOR 554 ns;
IF (TX_ERROR = 0) THEN
STD.TEXTIO.write(TX_OUT, string'("No errors or warnings"));
ASSERT (FALSE) REPORT
"Simulation successful (not a failure). No problems
detected."
SEVERITY FAILURE;
ELSE
STD.TEXTIO.write(TX_OUT, TX_ERROR);
STD.TEXTIO.write(TX_OUT,
string'(" errors found in simulation"));
ASSERT (FALSE) REPORT "Errors found during simulation"
SEVERITY FAILURE;
END IF;
END PROCESS;
300
VHDL and Verilog Examples
301
Appendix A
-- -------------------------------------
-- ------------- Current Time: 5285ns
WAIT FOR 600 ns;
i_data1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 5485ns
WAIT FOR 200 ns;
enb1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 5885ns
WAIT FOR 400 ns;
i_data1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 6285ns
WAIT FOR 400 ns;
i_data1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 6485ns
WAIT FOR 200 ns;
i_data1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 6685ns
WAIT FOR 200 ns;
enb1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 6885ns
WAIT FOR 200 ns;
enb1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 7085ns
WAIT FOR 200 ns;
i_data1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 7285ns
WAIT FOR 200 ns;
i_data1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 7685ns
WAIT FOR 400 ns;
i_data1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 7885ns
WAIT FOR 200 ns;
i_data1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 8685ns
WAIT FOR 800 ns;
i_data1 <= '1';
-- -------------------------------------
-- ------------- Current Time: 9085ns
WAIT FOR 400 ns;
i_data1 <= '0';
-- -------------------------------------
-- ------------- Current Time: 9485ns
WAIT FOR 400 ns;
302
VHDL and Verilog Examples
IF (TX_ERROR = 0) THEN
STD.TEXTIO.write(TX_OUT, string'("No errors or warnings"));
ASSERT (FALSE) REPORT
"Simulation successful (not a failure). No problems
detected."
SEVERITY FAILURE;
ELSE
STD.TEXTIO.write(TX_OUT, TX_ERROR);
STD.TEXTIO.write(TX_OUT,
string'(" errors found in simulation"));
ASSERT (FALSE) REPORT "Errors found during simulation"
SEVERITY FAILURE;
END IF;
END PROCESS;
END testbench_arch;
SIMULATION RESULT:
a. functional simulation
303
Appendix A
DPRAM
Block Diagram:-
DESCRIPTION:- In DPRAM, the generic inputs are declared such that it becomes 4-bit wide,16 depth
dual port RAM . It has two ports, ainout and binout, for both read and write operations through which we
can read and write simultaneously. Memory address is given by add_a for port ainout and add_b for port
binout. When both the address inputs target same memory location, following conditions for priority
arises, which are taken care in the RAM:
When both the ports are trying to write simultaneously on the same memory location, priority is
given to the port a. This implies that data send by port b at this extent is ignored.
When port a is writing and port b is reading, data read by port b is the new updated data. This
implies that the priority is given to writing and after this operation, reading will take place.
When port b is writing and port a is reading, data read by port a is the new updated data. This
implies that the priority is given to reading and after this operation, writing will take place.
When both ports are reading simultaneously on the same location, there will be no priority, which
implies that they can read at the same time.
304
VHDL and Verilog Examples
Input ports:
a. add_a : Address input for port a
b. add_b : Address input for port b
c. wr_a : Read-write enable for port a; if it is active high, then writing will take place;
else, if it is active low, then reading will take place
d. wr_b : Read-write enable for port a; If it is active high, then writing will take place;
else, if it is active low, then reading will take place
e. cs : Chip select active high
f. rst : Reset active high
g. clk : Clock
Inout ports:
a. ainout : Data input output port for port a
b. binout : Data input output port for port a
----PROGRAM OF dpram----
-------------------------------------------------------------------------------
-- Title : dpram
-- Project : dual port ram
-------------------------------------------------------------------------------
-- File : dpram.vhd
-- Author : <ICS@somesh>
-- Created : 2006/01/21
-- Last modified : 2006/01/21
-------------------------------------------------------------------------------
-- Description :
-- it has two ports through which we can simultaneously read and write
-- priority is given to "port a" when simultaneously reading and writing
-- and when one is reading and other is writing then first write will take
-- places after that reading is done on updated data
-------------------------------------------------------------------------------
-- Modification history
-- 2006/01/21 : created
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity dpram is
generic (width
: integer := 4;
addloc : integer := 4
);
port(add_a,add_b: in std_logic_vector((addloc-1) downto 0); --address input
wr_a,wr_b : in std_logic; -- write enable
cs : in std_logic; --
chip select
rst : in std_logic; --
asyncronous reset
305
Appendix A
begin
wr_a_b <= wr_a & wr_b;
ainout <= outtri_a when wr_a ='0' and cs = '1' else (others => 'Z');
binout <= outtri_b when wr_b ='0' and cs = '1' else (others => 'Z');
intri_a <= ainout when wr_a ='1' and cs = '1' else (others =>
'Z');
intri_b <= binout when wr_b ='1' and cs = '1' else (others =>
'Z');
process(clk,rst)
begin
if rst='1' then -- asyncronous reset (active high)
dpram <=(others => (others => '0'));
outtri_a <= (others => '0');
outtri_b <= (others => '0');
elsif cs = '1' then
if clk'event and clk ='1' then
if add_a = add_b then
case wr_a_b is
when "11" =>
dpram(conv_integer(add_a))<= intri_a;
when "10" =>
outtri_b <= intri_a;
dpram(conv_integer(add_a))<= intri_a;
306
VHDL and Verilog Examples
dpram(conv_integer(add_b))<= intri_b;
run
307
Appendix A
run
force -freeze sim:/dpram_ts_vhd/add_a 0010 0
run
force -freeze sim:/dpram_ts_vhd/add_a 1101 0
run
run
noforce sim:/dpram_ts_vhd/ainout
run
run
run
run
noforce sim:/dpram_ts_vhd/binout
run
run
run
308
VHDL and Verilog Examples
run
run
run
run
SIMULATION RESULT:
a. functional simulation
Timing Summary:
---------------
a. Minimum period : 2.564ns (Maximum Frequency: 390.038MHz)
b. Minimum input arrival time before clock : 4.882ns
c. Maximum output required time after clock : 3.935ns
d. Maximum combinational path delay : 5.790ns
309
Appendix A
QUEUE
Block Diagram:-
310
VHDL and Verilog Examples
DESCRIPTION: Queue using DPRAM as a component has generic inputs such that it becomes 4-bit
wide,16 depth DPRAM with port a is write only and port b is read only. The address for memory location
for port a is generated by the write counter, as it is write only port. Similarly, address for port b is
generated by the read counter.
The working of queue is such that data, which enters first, will go out first (FIFO operation). It will give
five output signals: one will give output data and others will behave as indicators when the queue is full,
going to full, empty, or going to empty. The corresponding indicator will be active high when any the
condition for that specified signal becomes true.
Input ports:
a. clk : Clock
b. Rst : Active high reset
c. cs : Chip select
d. wr : Write enable for port a
e. rd : Read enable for port b when rd is zero
f. Inputdata : Data input to the FIFO
Out ports:
a. Almost_full : Active high signal; high only when one memory location is left empty
during the write process
b. Almost_empty : Active high signal; high only when one memory location is left to be read
c. Full : Active high signal; high when all the memory locations are written
d. Empty : Active high signal; high when all the memory locations are empty
e. Output(3 downto 0) : Data output when rd is zero from memory location address by read counter
LIBRARY IEEE;
--LIBRARY DECLARATION
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
ENTITY MY_QUEUE IS
311
Appendix A
-- GENERIC DECLARATION
GENERIC (WIDTH : INTEGER := 4;
ADDLOC : INTEGER := 4
);
-- INPUT PORTS
PORT (CLK : IN STD_LOGIC; -- CLOCK
RST : IN STD_LOGIC; -- RESET
CS : IN STD_LOGIC; -- CHIP SELECT
WR : IN STD_LOGIC; -- WRITE ENABLE
RD : IN STD_LOGIC; -- READ ENABLE
INPUTDATA : IN STD_LOGIC_VECTOR((WIDTH-1) DOWNTO 0); -- INPUT DATA
-- OUTPUT PORTS
ALMOST_FULL : OUT STD_LOGIC;
ALMOST_EMPTY: OUT STD_LOGIC;
MPTY : OUT STD_LOGIC;
FULL : OUT STD_LOGIC;
OUTPUT : OUT STD_LOGIC_VECTOR((WIDTH -1)DOWNTO 0)
);
END MY_QUEUE;
-- INPUT PORTS
PORT(ADD_A : IN STD_LOGIC_VECTOR((ADDLOC-1) DOWNTO 0); -- ADDRESS INPUT
ADD_B : IN STD_LOGIC_VECTOR((ADDLOC-1) DOWNTO 0); -- ADDRESS INPUT
WR_A,WR_B : IN STD_LOGIC; -- WRITE ENABLE
CS : IN STD_LOGIC; -- CHIP SELECT
RST : IN STD_LOGIC; -- ASYNCRONOUS RESET
CLK : IN STD_LOGIC; -- CLOCK INPUT
AINOUT : IN STD_LOGIC_VECTOR((WIDTH -1) DOWNTO 0);-- DATA INPUT
--PORTS
END COMPONENT;
-- SUBTYPE DECLARATION
SUBTYPE F_E_INTEGER IS INTEGER RANGE 0 TO (2**ADDLOC);
-- SIGNAL DECLARATION
SIGNAL ADD_DECODER1,ADD_DECODER2 : STD_LOGIC_VECTOR((ADDLOC - 1) DOWNTO 0);-- TO
-- DECODE THE NEW ADDRESS
--FOR NEXT DATA AFTER WRITE
--OR READ CYCLE
312
VHDL and Verilog Examples
BEGIN -- MY_QUEUE_A
WR_DPRAM <= '1' WHEN (WR = '1' AND FULL_TEMP = '0') ELSE '0'; -- WRITE
RD_DPRAM <= '0' WHEN (RD = '0' AND EMPTY_TEMP = '0') ELSE '1'; -- READ
--------------------------------FIFO FULL----------------------------------
FULL_TEMP <= '1' WHEN F_E_COUNTER = ((2**ADDLOC) -1) AND WR = '1' ELSE '0';
ALMOST_FULL<= '1' WHEN F_E_COUNTER = ((2**ADDLOC) -2) AND WR = '1' ELSE '0';
--------------------------------FIFO EMPTY---------------------------------
EMPTY_TEMP <= '1' WHEN F_E_COUNTER = 0 AND RD = '0' ELSE '0';
ALMOST_EMPTY <= '1' WHEN F_E_COUNTER = 1 AND RD = '0' ELSE '0';
---------------------------------------------------------------------------
FULL <= FULL_TEMP;
EMPTY <= EMPTY_TEMP;
313
Appendix A
END CASE;
END IF;
END PROCESS ;
OUTPUT <= OUTPUTDATA;
END MY_QUEUE_A;
--------------------------------------------------------------------------------
TEST BENCH
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
USE IEEE.STD_LOGIC_TEXTIO.ALL;
USE STD.TEXTIO.ALL;
ENTITY queue_ts IS
END queue_ts;
COMPONENT my_queue
PORT (
clk : In std_logic;
rst : In std_logic;
cs : In std_logic;
wr : In std_logic;
rd : In std_logic;
inputdata : In std_logic_vector (3 DownTo 0);
almost_full : Out std_logic;
almost_empty : Out std_logic;
empty : Out std_logic;
full : Out std_logic;
output : Out std_logic_vector (3 DownTo 0)
);
END COMPONENT;
314
VHDL and Verilog Examples
BEGIN
UUT : my_queue
PORT MAP (
clk => clk,
rst => rst,
cs => cs,
wr => wr,
rd => rd,
inputdata => inputdata,
almost_full => almost_full,
almost_empty => almost_empty,
empty => empty,
full => full,
output => output
);
PROCESS
PROCEDURE CHECK_almost_empty(
next_almost_empty : std_logic;
TX_TIME : INTEGER
) IS
VARIABLE TX_STR : String(1 to 4096);
VARIABLE TX_LOC : LINE;
BEGIN
315
Appendix A
316
VHDL and Verilog Examples
317
Appendix A
318
VHDL and Verilog Examples
319
Appendix A
-- -------------------------------------
-- ------------- Current Time: 5466ns
WAIT FOR 180 ns;
inputdata <= "1001";
-- -------------------------------------
-- ------------- Current Time: 5586ns
WAIT FOR 120 ns;
wr <= '1';
-- -------------------------------------
-- ------------- Current Time: 5866ns
WAIT FOR 280 ns;
inputdata <= "1101";
-- -------------------------------------
-- ------------- Current Time: 6166ns
WAIT FOR 300 ns;
inputdata <= "1111";
-- -------------------------------------
-- ------------- Current Time: 6286ns
WAIT FOR 120 ns;
inputdata <= "1110";
-- -------------------------------------
-- ------------- Current Time: 6406ns
WAIT FOR 120 ns;
rd <= '1';
-- -------------------------------------
-- ------------- Current Time: 6706ns
WAIT FOR 300 ns;
inputdata <= "0110";
-- -------------------------------------
-- ------------- Current Time: 6846ns
WAIT FOR 140 ns;
inputdata <= "0010";
-- -------------------------------------
-- ------------- Current Time: 7106ns
WAIT FOR 260 ns;
wr <= '0';
-- -------------------------------------
-- ------------- Current Time: 7446ns
WAIT FOR 340 ns;
inputdata <= "0000";
-- -------------------------------------
-- ------------- Current Time: 7566ns
WAIT FOR 120 ns;
inputdata <= "0100";
-- -------------------------------------
-- ------------- Current Time: 7586ns
WAIT FOR 20 ns;
rd <= '0';
-- -------------------------------------
-- ------------- Current Time: 7626ns
WAIT FOR 40 ns;
wr <= '1';
-- -------------------------------------
-- ------------- Current Time: 7726ns
WAIT FOR 100 ns;
320
VHDL and Verilog Examples
IF (TX_ERROR = 0) THEN
STD.TEXTIO.write(TX_OUT, string'("No errors or warnings"));
STD.TEXTIO.writeline(RESULTS, TX_OUT);
321
Appendix A
END testbench_arch;
SIMULATION RESULT :
a. functional simulation
Verilog Examples
1. A 4-Bit Ripple Adder
// module top declaration
module rippleadder4(sum,cout,a,b,cin);
322
VHDL and Verilog Examples
input [3:0]a,b;
input cin;
output [3:0]sum;
output cout;
wire temp1;
wire temp2;
wire temp3;
// stimulus
`include "rippleadder4.v"
module stimulus;
rippleadder4 radder1(sum,cout,a,b,cin);
initial
$monitor($time, "sum= %d cout = %b a = %b b = %b cin = %b", sum,cout, a,b, cin);
initial
begin
#10 a=1'b1;b=1'b0;cin=1'b0;
323
Appendix A
#12 a=1'b1;b=1'b1;cin=1'b0;
end
endmodule
module mult4(a,b,y);
input [3:0]a,b;
output [7:0] y;
endmodule
`include "mult4.v"
module stimulus;
324
VHDL and Verilog Examples
initial
$monitor($time, "product= %d , a = %d b = %d ", y, a,b);
mult4 m1(a,b,y);
// stimulus
initial
begin
#1 a=4'd5; b=4'd3;
#1 a=4'd2; b=4'd4;
end
endmodule
product= x , a = x b = x
product= 15 , a = 5 b = 3
product= 8 , a = 2 b = 4
module arraymul4(a,b,y);
input [3:0]a,b;
output [7:0] y;
//wire declarations
325
Appendix A
wire temp1,ctemp2,temp2,ctemp3,ctemp1;
326
B
Internet Resources
References (4)
Internet Resources
www.actel.com Actel
www.altera.com Altera
www.atmel.com Atmel
Internet Resources
www.synplicity.com Synplicity
www.telelogic.com Telelogic
www.xilinx.com Xilinx
Reference Books
Douglas A. Pucknell, Fundamentals of Digital Logic Design: with VLSI circuit applications, Prentice
Hall Inc., 1990.
Douglas L. Perry, VHDL Programming by Example, 4th Edition, Tata McGraw Hill, 2002.
Farzad Nekoogar and Faranak Nekoogar, From ASICs to SOCs: A Practical Approach, Pearson
Education, 2003.
JanM. Rabaey, Anantha Chandakasan and Borivoje Nilolic, Digital Integrated Circuits: A Design
Perspective, Pearson Education, 2003.
John P. Uyemura, Introduction to VLSI Circuits and Systems, John Wiley & Sons, 2005.
Kamran Eshraghian, Douglas A. Pucknell, Sholeh Eshraghian, Essentials of VLSI Circuits and
Systems, Prentice Hall, 2005.
Peter Marwedel, Embedded System Design, Kluwer Academic Publishers, Netherlands, 2003.
Prasad K.V.K.K. Embedded/Real Time Systems: Design, Concepts and Programming, Black Book,
Dreamtech Press, 2005.
Sivarama P. Dandamudi, Guide to RISC Processors for Programmers and Engineers, Springer
Science+Business Media Inc., 2005.
Sung-Mo Kang and Yusuf Leblebici, CMOS Digital Integrated Circuits: Analysis and Design, Tata
McGraw Hill, 2006.
Uwe Meyer-Baese, Digital Signal Processing with FPGAs, Springer Verlag, 2001.
328
C
Acronyms and
Abbreviations
AOI AND-OR-INVERT
CE Chip Enable
CLK Clock
CS Chip Select
DR Design Rule
330
Acronyms and Abbreviations
FI Fan In
FO Fan Out
331
Appendix C
IC Integrated Circuit
LC Logic Cell
MUX Multiplexer
332
Acronyms and Abbreviations
OAI OR-AND-INVERT
PE Processor Element
333
Appendix C
SOC System-On-Chip
SOI Silicon-On-Insulator
SR Software Radio
TG Transmission Gate
UV Ultraviolet
XOR Exclusive OR
334
Glossary
ASIC two bits; whereas, the full adder is a circuit
that performs the addition of three binary bits.
Stands for Application Specific Integrated
Circuit. It is an integrated circuit used to Asynchronous
design digital logic based on full-custom
design. Refers to a logic that is not synchronized by a
clock.
ALU
ATM
Stands for Arithmetic Logic Unit. It is a digital
circuit that performs addition, subtraction, Stands for Asynchronous Transfer Mode. It is
multiplication, division, and other Boolean a dedicated-connection switching technology
functions. that organizes digital data into 53-byte cell
units and transmits them over a physical
ATPG medium using digital signal technology.
Stands for Automatic Test Pattern Generation. ADC
It is an electronic design automation test
generation tool to verify the given digital Stands for Analog-to-Digital Converter. It is a
design by determining the input test sequence circuit, which takes analog input and transmits
that, when applied to a digital circuit, enables the digital output.
automatic test equipment to distinguish
between the correct circuit behavior and the
faulty circuit behavior caused by defects. The Back annotation
generated patterns are used to test Refers to a process of assigning delays from a
semiconductor devices after their manufacture given source file for the cells in a netlist during
to determine the reasons of failure. netlist simulation.
BIT CPLD
Stands for Binary Digit. It is the basic unit of Stands for Complex Programmable Logic
information represented in digital systems in Device. It is a programmable logic device that
two forms, logic 0 and logic 1. is used to implement the digital designs by
using a set of macro cells.
Bitstream
Refers to a Field Programmable Gate Array CAD
(FPGA) configuration file, which is a Stands for Computer-Aided Design. It is
contiguous sequence of bits, representing a software used to design products, such as
stream of data, transmitted continuously over electronic circuit boards in computers.
a communications path, serially (one at a time)
loaded onto FPGAs. CLB
Stands for Configurable Logic Block. It is a
Bottom up design logic element that is used in Xilinx FPGA
Refers to a design approach that begins with devices.
the lowest-level blocks and builds the design
upward to the top level. Dual port
Refers to the two independent data ports
Black box allowing access to the same memory.
Refers to the testing of an Integrated Circuit
(IC) block whose internal details are hidden DFT
from the designer. Stands for Design for Test. It is a set of design
techniques that makes the test generation and
Bipolar test verification methods.
Refers to a process technology that employs
two junction transistors, NPN and PNP. DAC
Stands for Digital -to-Analog Converter. It
BiCMOS converts the data into an analog format.
Stands for Bipolar Complementary Metal Oxide
Semiconductor. It is a mixed technology Embedded systems
process that consists of bipolar transistors and Refers to the microcomputer embedded in
CMOS logic. control system that is non-accessible to users.
336
Glossary
Gate array
Front-end design Refers to an ASIC where transistors are
Refers to a sequence of steps to design ICs, predefined and interconnection pattern is
which include design capture, verification, customized.
and synthesis.
Half byte
Fan-in Refers to a four-bit data.
Refers to a number of inputs that drives the
gate. For a two input AND gate, the fan-in is Harvard architecture
two. Refers to a processor architecture in which
separate buses are used to access program
Fan-out memory and data memory.
Refers to the maximum number of lines that
the output of the gate can drive. Hierarchical design
Refers to a design description in multiple
layers.
337
Glossary
HVL Mapping
Stands for Hardware Verification Language. It Refers to the process of assigning portions of
is used to test and validate the design logic design to a physical design.
represented in behavioral, Register-Transfer
Level (RTL), and gate-level descriptions. Masking
Refers to the process in which an operation
IC can be performed on a single bit.
Refers to a semiconductor circuit with
electronic devices (transistors, resistors, and Memory map
capacitors) and interconnect wiring integrated Refers to the documentation that lists or shows
in or on the chip. the function of each location in memory.
Place and route: Refers to one of the important
ISE
steps in design process where all the logic is
Stands for Integrated Software Environment, placed onto logic blocks in FPGA and
which is an EDA tool by Xilinx Corporation. interconnection between the logic blocks is
done.
LUT
Stands for LookUp Table, which is a function NCD
generator with n-inputs and a single output. Stands for Native Circuit Description, which is
Two LUTs can be used to build any Boolean an output of the simulation and synthesis tool
function of up to two variables, that is, 16 in the form of netlists.
Boolean functions. Similarly, three LUTs can
be used to build 256 Boolean functions. Netlist
Refers to the textual representation of logic
JTAG
and interconnects.
Stands for Joint Test Action Group, which is a
serial protocol used to transfer the binary bits OCM
onto a board, such as FPGA. Stands for On-Chip Memory, which is an
interface that supports the attachment of
IP
additional memory to the instruction and data.
Stands for Intellectual Property. It is a block of
predesigned blocks, also called cores, macros, Optimization
or virtual components. Refers to the design change to improve the
performance of the optimized circuit based on
MOS
area of the chip, power consumption, and
Stands for Metal Oxide Semiconductor. It is a delay optimization.
transistor formed with a P or N source and
drain, and a metal gate over an insulator forms Placement
an N or P channel when a charge is put on the Refers to the process of assigning specific parts
metal gate of the design to particular locations on the
chip in FPGAs.
MUX
Stands for Multiplexer, which is a Pipeline processing
combinational circuit that selects one of the Refers to a technique to run multiple
inputs using select lines. instructions concurrently in a single cycle.
338
Glossary
PLD SOC
Stands for Programmable Logic Device, which Stands for System-On-Chip, which is an IC
is a digital circuit that can be programmable. that consists of processor, memory, and
input/output devices; for example, FPGA and
PLL ASIC.
Stands for Phase Locked Loop, which is an
electronic circuit that controls an oscillator so Simulation
that it maintains a constant phase angle Refers to the functional verification of the
relative to a reference signal. circuit.
Register SRAM
Refers to a memory location that is part of a Refers to the Static Random Access Memory. It
memory or processor. is a type of memory where the bistable
latching is used to store the data. Refreshing is
RAM not required due to bistable logic.
Refers to the form of data storage where the
data can be accessed randomly from any Static timing
location. Refers to the detailed description of on-chip
logic and interconnection delay.
ROM
Refers to a memory, which is fabricated with Test vector
the desired data to be stored permanently in it. Refers to the set of vectors used to determine
faults in a circuit.
RTL
Stands for Register Transfer Language, which Test vectors
is a behavioral description of the design at Refers to the sequence of binary bits used to
abstract level. verify the functionality of the circuit.
339
Glossary
USB VCD
Stands for Universal Serial Bus. It is a standard Stands for Value Change Dump. It is an ASCII
serial bus that supports higher data rates than file generated by simulation tools capturing
RS232. You can connect up to 127 devices to a the value changes on selected variables in a
USB host. simulation.
Yield
Refers to the percentage of defect-free (usable)
die on a silicon wafer.
340
Index
CPLD, 148, 151, 152, 157, 158, 200, 330
A
ADC, 73, 210, 211, 212, 247, 248, 249, 257, 258,
D
259, 261, 262, 264, 329 DAC, 73, 211, 212, 247, 248, 249, 251, 253, 254,
Adder, 55, 56, 57, 62, 98, 146, 147, 181, 182, 257, 258, 259, 261, 262, 264, 330
183, 184, 185, 187, 231, 232, 234, 322, 323, DUT, 65, 66, 137, 141, 295, 296, 315, 331
330
ALU, 10, 14, 329 E
ASIC, 3, 6, 7, 9, 10, 13, 14, 64, 66, 70, 76, 78, 79,
EDA, 2, 6, 9, 13, 75, 76, 77, 79, 81, 83, 85, 87, 89,
83, 100, 102, 137, 141, 143, 150, 151, 152, 154,
91, 93, 95, 97, 99, 100, 102, 271, 272, 327, 328,
164, 264, 328, 329
331
Asynchronous, 27, 31, 60, 61, 96, 221, 292, 334
EEPROM, 79, 147, 148, 151, 157, 264
B Emulation, 97
EPROM, 79, 147, 148, 151, 157, 264, 331
BiCMOS, 37, 38, 46, 47, 48, 329
Bipolar, 38, 329 F
BIST, 329
Fan-out, 34, 69
BIT, 279, 280
Fault, 65, 66, 67, 74
342
Index
Register, 12, 79, 96, 130, 136, 141, 175, 176, 179,
233, 266, 272, 332, 333
V
ROM, 57, 58, 59, 62, 79, 104, 146, 147, 148, 150, Verilog, 7, 8, 10, 11, 12, 14, 77, 79, 81, 82, 84,
151, 152, 157, 158, 162, 264, 331, 333 85, 86, 97, 99, 101, 102, 107, 127, 128, 129,
130, 131, 132, 134, 135, 136, 137, 140, 141,
Routing, 10, 11, 201
142, 157, 158, 159, 180, 182, 200, 214, 215,
RTL, 12, 79, 80, 91, 92, 97, 98, 99, 101, 141, 142, 216, 222, 272, 275, 277, 279, 281, 283, 285,
272, 273, 274, 333 287, 289, 291, 293, 295, 297, 299, 301, 303,
305, 307, 309, 311, 313, 315, 317, 319, 321,
S 322, 323, 324, 325, 328
Schematic, 19, 20, 22, 41, 81, 84, 91, 92, 184, VHDL, 7, 8, 10, 11, 12, 77, 79, 81, 82, 84, 85, 86,
185, 200, 214 87, 88, 93, 97, 99, 101, 102, 103, 104, 105, 106,
107, 109, 111, 113, 115, 117, 119, 121, 125,
Simulation, 12, 90, 92, 93, 94, 95, 97, 100, 101,
136, 137, 141, 142, 157, 158, 159, 160, 164,
103, 105, 107, 108, 109, 110, 111, 112, 113,
165, 170, 171, 175, 176, 179, 180, 181, 182,
114, 115, 116, 117, 118, 119, 120, 121, 123,
183, 185, 186, 187, 188, 189, 191, 193, 195,
124, 125, 127, 129, 131, 132, 133, 134, 135,
196, 197, 198, 200, 208, 214, 215, 216, 217,
136, 137, 139, 141, 142, 170, 175, 179, 191,
218, 222, 223, 235, 239, 242, 272, 275, 277,
194, 195, 197, 201, 209, 217, 225, 226, 230,
279, 281, 283, 285, 287, 289, 291, 293, 295,
238, 246, 300, 303, 321
297, 299, 301, 303, 305, 307, 309, 311, 313,
Skew, 71, 72 315, 317, 319, 321, 323, 325, 328, 334
SOC, 2, 3, 6, 264, 265, 266, 267, 268, 328, 334
SRAM, 149, 150, 154, 157, 179, 210, 334 X
Static timing, 77, 95, 160, 162 Xilinx, 9, 12, 14, 76, 77, 79, 83, 88, 89, 90, 91, 93,
Synthesis tool, 78 94, 96, 100, 103, 106, 107, 109, 111, 113, 117,
119, 122, 137, 142, 148, 150, 151, 154, 155,
U
UART, 61, 334
USB, 205, 208, 210, 334
343