com/
Dinesh Sharma
Microelectronics group
EE Department, IIT Bombay
http://www.satishkashyap.com/
1
http://www.satishkashyap.com/
In this booklet, we review the fundamentals of Semiconductor Physics and basics
of device operation. We shall concentrate largely on elemental semiconducors such
as silicon or germanium, and most numerical values used for examples are specific to
silicon.
Semiconductor fundamentals
A semiconductor has two types of mobile charge carriers: negatively charged electrons and positively charged holes. We shall denote the concentrations of these charge
carriers by n and p respectively. The discussions in this booklet apply to elemental semiconductors (like silicon) which belong to group IV of the periodic table. We
can intentionally add impurities from groups III and V to the semiconductor. These
impurities are called dopants. Impurities from group III are called acceptors while
those from group V are called donors. Each donor atom has an extra electron, which
is very loosely bound to it. At room temperature, there is sufficient thermal energy
present, so that the loosely bound electron breaks free from the donor, leaving the
donor positively charged. This contributes an additional electron to the free charge
carriers in the semiconductor, and a positive ionic charge at a fixed location in the
semiconductor. Similarly, an acceptor atom captures an electron, thus producing a
mobile hole and becoming negatively charged itself. A semiconductor without any
dopants is called intrinsic. An unperturbed semiconductor must be charge neutral as
a whole. If we denote the concentration of ionised donors by Nd+ and the concentration of ionised acceptors by Na , we can write for the net charge density at any point
in the semiconductor as:
= q(Nd+ Na + p n)
(1)
where q is the absolute value of the electronic charge. In an unperturbed semiconductor, will be zero everywhere. Electrons and holes are generated thermally - the
availability of energy equal to the band gap of the semiconductor results in the generation of an electron - hole pair. Simultaneously, electrons and holes can recombine
to annihilate each other, giving out energy which is equal to the band gap of the
semiconductor. Thus we have the reversible reaction:
e + h + *
) Eg
Where Eg is the band gap energy of the semiconducor.
Applying the law of mass action to the above reaction, we can write for the equilibrium
concentration of holes and electrons:
n p = constant
The above relation applies to doped as well as intrinsic semiconductors. But for an
intrinsic semiconductor,
n = p ni
Therefore, the constant in the equation connecting n and p must be n2i . Thus, for
a semiconductor in equilibrium,
n p = n2i
(2)
Since n and p are not independent, but are constrained by the above relation, we can
define a single independent variable, the Fermi potential by
KB T p
KB T n i
http://www.satishkashyap.com/
F
ln =
ln
q
ni
q
n
2
(3)
http://www.satishkashyap.com/
Where KB is the Boltzmann constant, T is the absolute temperature and q is the
absolute value of the electronic charge. At room temperature, KB T /q is approximately 26 mV and ni is of the order of 1010 /cm3 for silicon. Now electron and hole
concentrations are given by:
n = ni e
qF
BT
qF
p = n i e KB T
(4)
qF
= ln(p/ni ) = ln(ni /n)
KB T
then:
n = ni euF
p = n i e uF
(5)
1.1
Band Diagrams
The above concepts are often visualised with the help of band diagrams. The arrangement of atoms in a semiconductor results in certain electron energies which are not
permitted. Thus, the energy range is divided into bands of permitted energy values
alternating with forbidden gaps.
The highest such band which is nearly filled with electrons is called the valance
band. Unoccupied levels in this band correspond to holes. For stability, electrons
seek the lowest energy level available. If a vacancy is available at a lower energy - an
electron at a higher energy will drop to this level. The vacancy thus bubbles up to a
higher level. Therefore, holes seek the highest electron energy available.
The band just above the valance band is called the conduction band. In a semiconductor, this is partially http://www.satishkashyap.com/
filled. Conduction in a semiconducor is caused by electrons
in the conduction band (which are normally to be found at the lowest energy in the
3
http://www.satishkashyap.com/
conduction band) or holes in the valance band - (found at the highest electron energy
in the valance band). Band diagrams are plots of electron energies as a function of
position in the semiconductor. Typically, the top of the valance band (corresponding
to minimum hole energy) and the bottom of the conduction band are plotted. We can
show the Fermi potential and the corresponding Fermi energy(= -qF ) in the band
diagram of silicon as a level in the band gap. We use the halfway point between the
conduction and the valence band as the reference for energy and potential. When
n = p = ni , the Fermi potential is 0 (from eq. 3) and correspondingly, the Fermi
energy lies at the intrinsic Fermi level halfway in the band gap. (Actually, this level
can be slightly away from the middle of the band gap depending on the density of
allowed states in the conduction and valance bands - but for now, well ignore this).
When holes are the majority carriers, F is positive and the Fermi energy (= -q F )
lies below the mid gap level, as shown in the adjoining figure. When electrons are the
majority carriers, F is negative, and the Fermi energy lies above the mid gap level.
Ec
n = n 0 e KB T
p = p0 e
KqT
B
(6)
q
KB T
(7)
(8)
http://www.satishkashyap.com/
1.3
Non-equilibrium case
(9)
Where uFn and uFp are the dimensionless versions of quasi Fermi levels Fn and
Fp defined as in equation(7)). The np product is now given by
np = n2i e(uFp uFn )
(10)
http://www.satishkashyap.com/
concentration gradient become equal and opposite. In equilibrium, The electron as
well as hole currents must be zero individually (principle of detailed balance). Writing
the electron and hole current densities as sums of their respective drift and diffusion
current densities:
n
) + qDn
x
x
p
= pqp ( ) qDp
x
x
Jn = nqn (
Jp
(11)
From equation(9)
n
= ni e(uuFn ) (u uFn )
x
x
p
(uFp u)
= ni e
(uFp u)
x
x
or
q
n
= n
( Fn )
x
KB T x
p
q
= p
(Fp )
x
KB T x
Using Einstein relations ( KBq T D = ), and Substituting in the relations for Jn and Jp ,
) + nqn ( Fn )
x
x
Jn = nqn (
Jp
Which leads to
Fn
;
x
Fp
= pqp
;
x
Jn = nqn
Jp
(12)
KB T
ln(Na /ni)
q
KB T
q ln(Nd /ni)
P side : x < 0
N side : x > 0
KB T
q
ln
Nd Na
n2i
in contact, the Fermi levels have equalised on the two sides, the built in voltage must
be equal and opposite to this potential, taking the P side to a negative potential and
the N side to a positive potential. We can write for the magnitude of the built in
voltage:
!
KB T
Na Nd
Vbi =
ln
(13)
q
n2i
http://www.satishkashyap.com/
6
http://www.satishkashyap.com/
2.1
The diode is reverse biased when we apply a voltage such that the n side is more
positive as compared to the p side. In this case, the applied voltage is in the same
direction as the built-in field, which opposes the movement of majority carriers and
widens the depletion regions on either side of the junction. We analyse the reverse
biased diode by making the depletion approximation. We assume that in reverse bias,
the depletion regions have zero carrier density, and the field is completely confined to
depletion regions. Solving Poissons equation in P region (x < 0) and the N region
(x > 0)
2
a
= qN
si
2
x
2
d
= qN
si
x2
(for x < 0)
(for x > 0)
a
= qN
x + c1
si
x
d
= qN
x + c2
si
x
(for x < 0)
(for x > 0)
where c1 and c2 are constants of integration, which can be evaluated from the condition
that the field vanishes at the edge of the depletion regions at -Xdp and at Xdn . This
leads to
a
= qN
(x + Xdp )
si
x
d
(x Xdn )
= qN
si
x
(for x < 0)
(for x > 0)
(14)
(15)
qNa
si
d
= qN
si
x2
2
x2
2
+ Xdp x + c3
(for x < 0)
Xdn x + c4
(for x > 0)
Where the constants of integration c3 and c4 can again be evaluated from the boundary
conditions at -Xdp and Xdn . If we require that the potential is 0 at -Xdp and V at Xdn ,
qNa 2
X
2si dp
qNd 2
= V
X
2si dn
c3 =
c4
Substituting these values, we get:
qNa
si
2
x2 +Xdp
2
+ Xdp x
(for x < 0)
2
http://www.satishkashyap.com/
x2 +Xdn
d
= V qN
Xdn x
(for x > 0)
si
2
7
(16)
http://www.satishkashyap.com/
Since the potential at x = 0 should be continuous,
qNd 2
qNa 2
Xdp = V
X
2si
2si dn
so, V =
q
2
2
(Na Xdp
+ Nd Xdn
)
2si
(17)
2
qNa Xdp
(Nd + Na )
=
2si Nd
2
qNd Xdn
=
(Nd + Na )
2si Na
which leads to
Xdp =
2si V
Nd
q(Nd + Na ) Na
Xdn =
2si V
Na
q(Nd + Na ) Nd
(18)
2si V
q(Nd + Na )
Nd
+
Na
Na
Nd
which gives
Xd =
2si V
q
1
1
+
Na Nd
(19)
The voltage V in the above expressions is the total voltage across the junction. Since
there is a reverse bias of Vbi for a zero applied voltage, that will add (in magnitude)
to the applied reverse voltage. Using equation(13) we can write:
V = Vbi + Vappl
KB T
Na Nd
= Vappl +
ln
q
n2i
(20)
If we apply an external voltage, such that the P side is made positive with respect
to the N side, the applied voltage will reduce the built in voltage across the junction.
The magnitude of the built-in voltage is such that it balances the drift and diffusion
currents, resulting in zero net current. But if the voltage across the junction is reduced,
a net current will flow through the diode. This is the forward mode of operation.
Because of this flow of current, electrons are injected into the P side and holes into
the N side. Consequently, the concentration of carriers is no longer at the equilibrium
value. We denote the equilibrium value of electron and hole concentrations on P and
N side by np0 , nn0 , pp0 , pn0 respectively. Since the majority carrier concentration in
equilibrium is equal to the doping density, we have:
nn 0 N d ,
pp0 http://www.satishkashyap.com/
Na
and
np0 = n2i /Na ,
8
http://www.satishkashyap.com/
According to equation(10)
np = n2i e(uFp uFn )
As we make the potential of P type more positive compared to N type, the np product
in forward bias is greater than n2i . From relations(12), we see that the change in quasi
Fermi levels is small wherever the carrier concentration is high. Thus, we can assume
that the quasi Fermi levels of the majority carriers at either side of the junction remain
at their equilibrium values. Hence the voltage across the junction is given by
V = Fp Fn
and therefore the non-equilibrium np product is given by
np =
n2i e
qV
KB T
therefore,
np
n2i
=
e
pp
pn
n2i
=
e
nn
qV
KB T
qV
KB T
= n p0 e
= p n0 e
qV
KB T
qV
KB T
(21)
(22)
(particle concentration)
t
Jn
=U
x q
!
Jp
=U
x q
where U is the net recombination rate. Using relation(11), we have
!
nn
nn n
Dn
= U
x
x
x
!
pn
p n p
+ Dp
= U
x
x
x
or
nn
2
2 nn
n
+ n nn 2 D n
= U
x x
x
x2
pn
2
2 pn
p
+ p pn 2 + Dp 2 = U
x x
x
x
Assuming the regions outside the small depletion regions to be charge neutral,
(nn nn0 ) (pn pn0 )
http://www.satishkashyap.com/
9
http://www.satishkashyap.com/
We define ambipolar diffusion and lifetime by the relations
nn + p n
nn /Dp + pn /Dp
nn n n 0
p n p n0
=
U
U
Da
a
(23)
(24)
multiplying the electron continuity equation with p pn and the hole continuity equation with n nn and combining, we get
2 pn
p n p n0
pn
nn p n
+ Da 2 +
=0
a
x
nn /p + pn /n x x
(25)
If we make the low injection assumption (pn << nn nn0 ), this reduces to
2 pn
pn
p n p n0
+ Dp 2 + p
=0
p
x
x x
(26)
=0
x2
Dp p
(27)
This can be solved with the boundary condition given by relation(21) and noting that
pn = pn0 at x = to give:
p n p n0 = p n0 e
where
Lp
qV
KB T
1 e
xxn
Lp
(28)
Dp p
(29)
qV
qDp pn0
pn
Jp = qDp
=
e KB T 1
x
Lp
(30)
qV
np
qDn np0
=
e KB T 1
x
Ln
(31)
J = Jp + Jn = Js e
Where Js
qV
KB T
(32)
(33)
http://www.satishkashyap.com/
4.1
The parallel plate capacitor consists of two parallel metallic plates of area A, separated
by an insulator of thickness ti and dielectric constant . If we place a charge Q on the
upper plate, it attracts charges of opposite sign in the bottom plate, while repelling
charges of the same sign.
If the bottom plate is connected to ground, the repelled charge flows to ground.
Now the two capacitor plates hold equal and opposite charge. This charge resides just
next to the insulator on either side of it. This is true, whatever the quantity or sign
of charge placed on the upper plate. The inducing and induced charge are always
separated by the thickness of the insulator, ti . Therefore this structure has a constant
capacitance given by:
A
Ctotal =
ti
Since there are no charges inside the dielectric, the electric field in the insulator is
constant and the electrostatic potential changes linearly from one plate to the other.
4.2
http://www.satishkashyap.com/
11
http://www.satishkashyap.com/
Accumulation
Inversion
Capacitance
Depletion
4.3
Quantitative Analysis
Ideal Case
Let the back surface of Si be at zero potential and the voltage applied to the gate
terminal be Vg . Let the electrostatic potential at any point x be denoted by (x) and
let the potential at the silicon-oxide interface be s .
We construct a Gaussian box passing through
the interface and extending to +. According
to Gauss law, the integral of the outward pointM O
S
M
ing D vector around the box should be equal to
the charge contained inside. The only boundary
where D is non zero is the one passing through
the interface. Therefore,
Area ox
s V g
= Total Charge in silicon
tox
Gaussean Box
Qsi
Cox
Thus, the surface potential and the applied gate voltage can be related to each other.
If the surface potential is known, we can evaluate the semiconductor charge by intehttp://www.satishkashyap.com/
grating the Poissons equation
in the semiconductor, once.
12
http://www.satishkashyap.com/
We can write the Poissons equation in the semiconductor as
D=
or
2
= q(Nd+ Na + p n)
x2
Since the electrostatic potential is dependent only on x, we can change partial derivatives to total derivatives.
si
d2
d
d
2 =
dx
dx
dx
d
(E)
dx
d
dx
d
d
1 d 2
(E) = E (E) =
E
d
d
2 d
If we define
u
where
q
KB T
We get
d 2
1 d 2
d2
(34)
E =
E
2 =
dx
2 d
2 du
The right hand side of the Possons equation represents the charge density. In the
absence of an applied voltage, this must be zero everywhere. Therefore,
q(Nd+ Na + p0 n0 ) = 0
where p0 and n0 represent the hole and electron density in the absence of an applied
field. therefore,
Nd+ Na = (p0 n0 )
Sustituting equation(34) and the above in the Poissons equation,
so
si d 2
E = q [p p0 (n n0 )]
2 du
"
d 2
2qp0 p
n0
E =
1
du
si p0
p0
n
1
n0
#
From equation(8)
n = n 0 eu
and
p = p0 eu
So,
"
d 2
2qp0 u
n0
E =
e 1 (eu 1)
du
si
p0
2qp0 u
n0
E =
e 1 + u (eu 1 u)
si
p0
2
Therefore
s
"
2qp0 u
n0
E = http://www.satishkashyap.com/
e 1 + u (eu 1 u)
si
p0
13
#1
http://www.satishkashyap.com/
And thus, the displacement vector D can be evaluated as:
s
"
2qp0 si u
n0
D = si E =
e 1 + u (eu 1 u)
p0
#1
(35)
=
us
and
LD
"
#1
2
n0 us
2si us
1 + us +
e
(e 1 us )
LD
p0
s
q
K T
sB
si
(36)
Notice that Qsi is the charge in the semiconductor per unit area. In this treatment,
we shall use symbols of the type Q and C with various subscripts to denote the corresponding charges and capacitance values per unit area. Qsi consists of mobile as
well as fixed charge. The mobile charge is contributed by holes when us < 0 and
by electrons when us > 0 (for a P type semiconductor). As we shall see later, the
mobile electron charge is substantial only when the positive surface potential exceeds
a threshold value.
The fixed charge is contributed by the depletion charge when the surface potential
is positive. The depletion charge per unit area can be calculated by the depletion
formula.
q
(s > 0)
Qdepl = qNa Xd = 2qNa si s
A somewhat more accurate expression for depletion charge accounts for slightly lower
charge density at the edge of the depletion region by subtracting KB T/q from s .
http://www.satishkashyap.com/
Qdepl = qNa Xd = 2qNa si (s KB T /q)
(s > KB T /q)
q
14
(37)
http://www.satishkashyap.com/
1e05
1e06
Maj. Carrier
Charge
Q
total
1e07
Depl.
1e08
1e09
0.4
0.2
0.2
0.4
0.6
0.8
Practical case
A practical MOS structure will differ from the ideal case assumed above in a few
respects. There is a built-in potential difference between the metal used and Si, due
to the difference between their work functions. This shifts the relationship between
Vg and s . Also, there is a fixed oxide charge which resides essentially at the siliconoxide interface. Thus, the total charge in the Gaussian box includes this fixed charge
and the semiconductor charge. These two non-idealities can be accounted for by
modifying the relationship between Vg and s to be
Vg = ms + s
Qsi + Qox
Cox
(38)
http://www.satishkashyap.com/
1.0
0.8
0.6
0.4
0.2
0.0
0.2
4.0
2.0
0.0
2.0
GATE VOLTAGE (V)
4.0
1e06
total
Q
1e07
inv
depletion
1e08
1e09
2
Inversion converts a p type semiconductor to n type at the surface. We can use this
fact to construct a transistor. We place semiconductor regions strongly doped to N
type on either side of a MOS capacitor made using P type silicon. Now if we try
S
n+
GATE
D
n+
P type Si
Figure 7: A MOS Transistor
to pass a current between these two N regions when inversion has not occurred, we
encounter series connected NP and PN diodes on the way. Whatever the polarity of
the voltage applied to passhttp://www.satishkashyap.com/
current, one of these will be reverse biased and practically
no current will flow.
16
http://www.satishkashyap.com/
However, after inversion, the intervening P region would have been converted to
N type. Now there are no junctions as the whole surface region is n type. Current
can now be easily passed between the two n regions. This structure is an n channel
MOS transistor. PMOS transistors can be similarly made using P regions on either
side of a MOS capacitor made on n type silicon. When current flows in an n channel
transistor, electrons are supplied by the more negative of the two n+ contacts. This
is called the source electrode. The more positive n+ contact collects the electrons and
is called the drain. The current in the transistor is controlled by the metal electrode
on top of the oxide. This is called the gate electrode.
6.1
http://www.satishkashyap.com/
L
W
Y
S
D
Z
X
dy
Integrating the current density over a semi-infinite plane at the channel position y (as
shown in the figure 8) will then give the drain current.
Id =
x=0
W
z=0
n(x, y)q
V (y)
dzdx
y
x=0
n(x, y)
V (y)
dx
y
the value of n(x,y) is non zero in a very narrow channel near the surface. We can
assume that Vy(y) is constant over this depth. Then,
Id
V (y)
= W q
y
x=0
n(x, y)dx
but q x=0
n(x, y)dx = Qn (y) where Qn (y) is the electron charge per unit area in the
semiconductor at point y in the channel. (Qn (y) is negative, of course). therefore
Id = W
V (y)
Qn (y)
y
(39)
Id dy = W
Id L = W
L
0
Qn (y)
Vd
0
V (y)
dy
y
Qn (y)dV (y)
http://www.satishkashyap.com/
W Vd
So, Id =
Qn (y)dV (y)
L 0
18
Z
http://www.satishkashyap.com/
We now use the assumption that the surface potential due to the vertical field saturates
around 2F if we are in the inversion region. Therefore, the total surface potential at
point y is V(y) + 2 F . Now, by Gauss law and continuity of normal component of
D at the interface,
Cox Vg MS s = (Qsi + Qox )
therefore,
Qsi = Qn + Qdepl
So
Qn (y) = Qsi (y) + Qdepl
We have assumed the depletion charge to be constant along the channel. Let us define
VT MS + 2F
(Qox + Qdepl )
Cox
then
Qn (y) = Cox (Vg VT V (y))
and therefore,
Id
W Vd
= Cox
(Vg VT V (y))dV (y)
L 0
1
W
= Cox [(Vg VT )Vd Vd2 ]
L
2
Z
(40)
This derivation gives a very simple expression for the drain current. However, it
requires a lot of simplifying assumptions, which limit the accuracy of this model.
If we do not assume a constant depletion charge along the channel, we can apply the
depletion formula to get its dependence on V(y).
q
Id = Cox
W
L
Qox
1
Vg MS 2F +
Vd Vd2
Cox
2
#
2 2si qNa
3/2
3/2
(Vd + 2F ) (2F )
3 Cox
http://www.satishkashyap.com/
19
http://www.satishkashyap.com/
6.2
The treatment in the previous section is valid only if there is an inversion layer all the
way from the source to the drain. For high drain voltage, the local vertical field near
the drain is not adequate to take the semiconductor into inversion. Several models
have been used to describe the transistor behaviour in this regime. The simplest of
these defines a saturation voltage at which the channel just pinches off at the drain
end. The current calculated for this voltage by the above models is then supposed
to remain constant at this value for all higher drain voltages. The pinchoff voltage is
the drain voltage at which the channel just vanishes near the drain end. Therefore,
at this point the gate voltage Vg is just less than a threshold voltage above the drain
voltage Vd . Thus, at this point,
Vdsat = Vg VT
The current calculated at Vdsat will be denoted as Idss . Thus,
Idss = Cox
W
1
[(Vg VT )2 (Vg VT )2 ]
L
2
(41)
The drain current is supposed to remain constant at this Vd independent value for all
drain voltages > Vg VT .
6.2.1
Assuming a constant current in the saturation region leads to an infinite output resistance. This can lead to exaggerated estimates of gain from an amplifier. Therefore,
we need a more realistic model for the transistor current in the saturation region.
One of these is a generalisation of the model proposed by James Early for bipolar
transistors. This model is not strictly applicable to MOS transistors. However, due
to its numerical simplicity, it is often used in compact models for circuit simulation.
A geometrical interpretation of the Early model states that the drain current
increases linearly in the saturation region with drain voltage, and if saturation characteristics for different gate voltages are produced backwards, they will all cut the
drain voltage axis at the same (negative) drain voltage point. The absolute value of
this voltage is called the Early Voltage VE .
The current equations in saturation mode now become:
Idss Id (Vg , Vdss )
Vd + V E
Id = Idss
Vdss + VE
(42)
Any model can be used for calculating the drain current for Vd < Vdss . The value of
Vdss will be determined by considerations of continuity of the drain current and its
derivative at the changeover point from linear to saturation regime. For example, if
http://www.satishkashyap.com/
20
http://www.satishkashyap.com/
we use the simple model described in eq. 40,
W
Id
= Cox (Vg VT Vd )
For Vd Vdss
Vd
L
Id
Idss
=
For Vd Vdss
Vd
Vdss + VE
W
1 2
Idss Cox
(Vg VT ) Vdss Vdss
L
2
And
Where
On matching the value of
Id
Vd
Vdss = VE 1 +
2 (Vg VT )
1
VE
Vg V T
' (Vg VT ) 1
2VE
(43)
Simulation Model
Since the value of Vdss does not change substantially from the ideal saturation case,
a simpler approach can be tried. The drain current is calculated using the ideal
saturation model and its value is multiplied by a correction factor = (1 + Vd ) in
saturation as well as in linear regime. This automatically assures continuity of Id and
its derivative. is a fit parameter, whose value is 1/VE . This approach is used in
SPICE, a popular circuit simulation program.
http://www.satishkashyap.com/
21
http://www.satishkashyap.com/
Dinesh Sharma
Microelectronics Group, EE Department
IIT Bombay, Mumbai
May 2006
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Design Flow
http://www.satishkashyap.com/
Electronic Design
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Abstraction Levels
Types and levels of modeling
Structural
Geometric
Low
Levels of
Abstraction
High
As we go to lower levels of
abstraction, the level of detail
goes up.
It is advantageous to do as
much work as possible at
higher levels of abstraction,
when thw detail is low.
http://www.satishkashyap.com/
Y chart
Gajski and Kahn
Functional
Design Flow
http://www.satishkashyap.com/
Floor Plan
Geometric
Unit Cells
Stick Diagrams
Polygons
Y chart
Gajski and Kahn
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Structural
Functional
Blocks
Registers
Gates
Transistors
Y chart
Gajski and Kahn
Design Flow
http://www.satishkashyap.com/
Functional
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Debug
OK?
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
Hierarchical Design
Design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Design Flow
http://www.satishkashyap.com/
level.
and to synthesize (structure from behaviour).
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Timing
Concurrency
Hardware Simulation process which involves:
Analysis
Elaboration
and Simulation
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
HDL Uses
http://www.satishkashyap.com/
Test Benches
Synthesis
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Delays
http://www.satishkashyap.com/
In
Delay = 30uS
Out
Out <= In AFTER 30 uS;
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Delay: Inertial
In 30uS
Out
In
x
out
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Delay: Transport
In
Optical Fibre
Out
Delay=30uS
In
Out
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Modeling Delay
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Handling Concurrency
http://www.satishkashyap.com/
Hardware Simulation
http://www.satishkashyap.com/
Simulation Event
driven simulation is carried out.
Dinesh Sharma, May 2006
Analysis
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Elaboration
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Sensitivity List
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
Scheduling
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
A Simulation Example
20
50
Sensitivity List
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
At Time = 0, update A = 0.
Time A B C
Initial X X X
0
0 X X
A has an event.
Inverter and NAND are sensitive to A.
After Re-sim
Initial
Time
Trans.
Re-evaluate:
Time Trans.
6
C=1
0
A=0
Inverter: B 1 at 8;
8
B=1
A=1
20
NAND:
C 1 at 6
20
A=1
50
A = 0http://www.satishkashyap.com/
50
A=0
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
At Time = 6, update C = 1.
Time A B C
0
0 X X
6
0 X 1
C has an event.
No module is sensitive to C.
A
B
10
20
30
40
Initial
After Re-sim
Time Trans.
Time
Trans.
Re-evaluate:
6
C=1
8
B=1
8
B=1
A=1
20
None Required
20
A=1
50
A
=0
50
A = 0http://www.satishkashyap.com/
Dinesh Sharma, May 2006
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
At Time = 8, update B = 1.
Time A B C
6
0 X 1
8
0 1 1
B has an event.
Only NAND is sensitive to B.
A
B
10
20
30
40
After Re-sim
Initial
Time
Trans.
Time Trans.
Re-evaluate:
8
B=1
14
C=1
NAND: C 1 at 14
A=1
A=1
20
20
50
A = 0http://www.satishkashyap.com/50
A=0
Dinesh Sharma, May 2006
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
A
B
10
20
30
40
Initial
After Re-sim
Time Trans.
Re-evaluate:
Time Trans.
14
C=1
20
A=1
A=1
20
None Required
A=0
50
50
A = 0http://www.satishkashyap.com/
Dinesh Sharma, May 2006
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
A
B
10
20
30
40
After Re-sim
Initial
Re-evaluate:
Time Trans.
Time Trans.
26
C=0
Inverter: B 0 at 28;
20
A=1
B=0
28
NAND:
C 0 at 26
A = 0http://www.satishkashyap.com/
50
50
A=0
Dinesh Sharma, May 2006
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
6
B
A
B
10
20
30
40
Initial
After Re-sim
Time Trans.
Re-evaluate:
Time Trans.
26
C=0
28
B=0
B=0
28
No update is required.
A=0
50
50
A = 0http://www.satishkashyap.com/
Dinesh Sharma, May 2006
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
Initial
Time Trans.
28
B=0
A=0
50
Re-evaluate:
NAND:
C 1 at 34
A
B
10
30
40
After Re-sim
Time Trans.
34
C=1
A=0
50
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
20
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
Initial
Time Trans.
34
C=1
A=0
50
Re-evaluate:
No evaluation needed.
A
B
10
30
40
After Re-sim
Time Trans.
50
A=0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
20
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
A
B
10
20
30
40
After Re-sim
Time Trans.
Inverter: B 1 at 58;
56
C=1
NAND:
C
1
at
56
B=1
http://www.satishkashyap.com/58
Initial
Time Trans.
50
A=0
Re-evaluate:
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
Initial
Time Trans.
56
C=1
B=1
58
Re-evaluate:
No re-evaluation
required.
A
B
10
30
40
After Re-sim
Time Trans.
58
B=1
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
20
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
Initial
Time Trans.
58
B=1
Re-evaluate:
NAND:
C 1 at 64
A
B
10
30
40
After Re-sim
Time Trans.
64
C=1
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
20
50
60
http://www.satishkashyap.com/
A Simulation Example
20
50
Initial
Time Trans.
64
C=1
Re-evaluate:
No re-evaluation
required.
A
B
10
30
40
50
After Re-sim
Time ordered list is
empty.
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
20
60
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
0 In := 0
In
Inertial 30uS
Out
40 In := 1
45 In := 0
In
0
40 45
80
130
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
30 out :=0
Out
40 In := 1
45 In := 0
In
0
40 45
80
130
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
40 In := 1
45 In := 0
In
0
40 45
80
130
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
45 In := 0
In
0
40 45
80
70 Out := 1
130
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
70 Out := 1
130
75 Out :=0
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
130
75 Out :=0
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
130
Out
30
110
80 In := 1
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
130
Out
30
110
160
110 Out := 1
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
130
Out
30
110
160
130 In := 0
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
http://www.satishkashyap.com/
Time Transaction
In
Inertial 30uS
Out
In
0
40 45
80
130
Out
30
110
160
http://www.satishkashyap.com/
160 Out := 0
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
Concurrent Descriptions
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
Sequential Descriptions
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
Sequential Descriptions
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
Sequential Descriptions
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma, May 2006
concurrent Descriptions
Sequential Descriptions
http://www.satishkashyap.com/
This ends
The first part of the lecture series on
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Marshnil Dave
Amit Vishnani
Navin Kacharappu
Sandeep Waikar
Girish Naik
Dinesh Sharma
Supreet Joshi
Rajkumar Satkuri
Mahavir Jain
M. Veerraju
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Part I
http://www.satishkashyap.com/
Scaling
http://www.satishkashyap.com/
http://www.satishkashyap.com/
MOS model
http://www.satishkashyap.com/
1.4
Vg = 3.5
1.2
1.0
3.0
0.8
0.6
For Vgs VT ,
Ids = 0
2.5
0.4
2.0
0.2
0.0 0.5
1.5
1.0
1.0 1.5 2.0 2.5 3.0 3.5
Drain Voltage (V)
K Cox
W
L
4.0 4.5
ox
tox
(Gate capacitance Cox is per unit area)
Cox
http://www.satishkashyap.com/
Consequences of Scaling
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Impact of scaling
http://www.satishkashyap.com/
However . . .
The above improvements apply to active circuits.
What about passive components?
Also, reduced voltages imply a lower signal to noise ratio.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
R=
tm
L
,
Wtm
C=
LW
ti
ti
Charge Time RC =
L2
tm ti
http://www.satishkashyap.com/
Relative Frequency
http://www.satishkashyap.com/
Interconnect Delay =
2
tm ti L
AL2
http://www.satishkashyap.com/
Buffer Insertion
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
L 2
L
L
AL + ( 1) = ALL + ( 1)
L
L
L
L
= 0, so AL2 =
L2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
This direction signal must also be routed with the bus and
should have its own buffers. It should reach the
bidirectional buffers ahead of the data.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
One has to anticipate the wire length, and then design the
active circuits to meet total delay specifications.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
v
Mp1
Mp2
v1
i1
Mn1
i2
v2
i1 = gmn1 v1 = gmp1 (v v2 )
i2 = gmn2 v1 = gmp2 v2
mn2 i1
v2 = ggmn2
v1 = ggmp2
gmn1
mp2
i1 = gmp1 v +
Mn2
define
gmn2 /gmn1
gmp2 /gmp1
gmn2 /gmn1
i1
gmp2 /gmp1
then, i1 (1 ) = gmp1 v
http://www.satishkashyap.com/
1
C.-K. Kim et al, High Injection Efficiency Readout Circuit for Low
Resistance Infrared Detector, IEE Electronic Letters, 35, 1507, 1999.
Robustness of design
http://www.satishkashyap.com/
In saturation,
1
W
Cox (Vg VT )2
2
L
r
W
W
So, gm = Cox (Vg VT ) = 2Cox Id
L
L
s
(W /L)n2 I2
gmn2 /gmn1 =
(W /L)n1 I1
s
(W /L)p2 I2
gmp2 /gmp1 =
(W /L)p1 I1
s
(W /L)n2 /(W /L)n1
gmn2 /gmn1
Therefore
=
gmp2 /gmp1
(W /L)p2 /(W /L)p1
Id =
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vref
Iint
Mp1
i1
Mp2
v1
Mn1
i2
Iout
v2
Mn2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Low Swing Voltage mode
Line
Buffer/amp
Low swing
Driver
Receiver
RL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Receiver
RL
Possible Improvements
Inductive Peaking
Dynamic Over-driving
http://www.satishkashyap.com/
http://www.satishkashyap.com/
R0
R0
R0
R0
L
DRIVER
C0
C0
C0
C0
RL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vref
v
Mp1
i1
Mp2
v1
Mn1
i2
v2
Mn2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Zin =
1 =
Cg1
gmn1
3 = Cg3 rop1
=
gmp1 /gmp2
gmn1 /gmn2
2 =
4 =
Cg2
gmp2
Cg3
gmp1
R1 =
1
gmn1
R3 = rop1
k=
1
gmn1 rop1
1
gmp1 + rop1
R1
R3
int
Cg1
(1 ) +
Rin =
1/gmp2
Cg3
http://www.satishkashyap.com/
i2
1/gmn1
Cg2
i2 = gmn2 vg1
http://www.satishkashyap.com/
If the first zero occurs a decade prior to the first pole, input
impedance is inductive
Leff
=
+
gmn11rop1 > 0.9 and any two time constants being equal
ensures that a zero occurs a decade prior to the first pole
Cg1
Cg2
rop1
+
gmp1 rop1 + 1 gmn1 gmp2
Cg3
Cg2
+
gmp2 gmn1 rop1 gmn1 gmp1 rop1
(1
Zin
Req
Ceq
) + gmn11rop1
1
gmp1http://www.satishkashyap.com/
+ rop1
Reff
Ceff
= KCgx
Leq
http://www.satishkashyap.com/
Vdd
Mp11
Mp22
Mn11
Mn22
Source Type
Beta Mult.
Inv Amp
Input
Vref
Mp1
Mp2
Mn1
Mn2
Sink Type
Beta Mult.
Simulation Results
http://www.satishkashyap.com/
Delay
(ps)
420
500
1000
Throughput
(Gbps)
2.56
2.45
2.85
Power
( W )
310
380
3000
Area
(m2 )
2.00
2.00
12.53
http://www.satishkashyap.com/
[1] M Dave et. al., ISLPED 2008, [2] V. Venkatraman et. al. ISQED 2005
http://www.satishkashyap.com/
VDD
Swing Control (High)
p Drive
Input
n Drive
Swing Control (Low)
http://www.satishkashyap.com/
Dynamic (Strong)
Driver
VDD
Input
Wire
Feedback
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dynamic (Strong)
Driver
VDD
Input
Wire
Feedback
http://www.satishkashyap.com/
http://www.satishkashyap.com/
p
p
static
http://www.satishkashyap.com/
= peak
t
RL = 4k, l = 4H
Iavg
t +I
(tt )
Comparison of Delay
http://www.satishkashyap.com/
With Large Overdrive (Ipeak = 500A)
http://www.satishkashyap.com/
For low power and low data rate applications, the use of
inductive peaking can give 26% improvement in throughput
over RC
For low power and low data rate applications, the use of
inductive peaking can give 16% improvement in delay over
RC
For low power and low data rate applications, the use of
dynamic overdrive along with inductive peaking can further
improve throughput by 20%
http://www.satishkashyap.com/
Part II
http://www.satishkashyap.com/
Variation Tolerant Current Mode Signaling
Need for Process Variation Tolerance
Effect of Process Variations on different CMS Schemes
The Proposed Variation Tolerant CMS Scheme
Performance Evaluation
Bidirectional Links
Simulated Performance of Bidirectional Link
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Intra-die http://www.satishkashyap.com/
variations cause mismatch in parameters of
transmitter and receiver transistors.
Robustness requirements
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Ideal
VcmRx
Transmitter
Receiver
Misaligned
VcmRx
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Strong
Driver
Weak
Driver
VDD
Receiver Eq. Circuit
Wire
Input
LineRx
RxOut
RL
+ Vcm Rx
I1
Feedback
Wire
Weak
Driver
VDD
Receiver Eq. Circuit
Wire
Input
RxOut
LineRx
RL
I1
Feedback
Vcm Rx
Wire
VCMRx
VMTx
http://www.satishkashyap.com/
Weak
Driver
Fixed Width
Pulse Generator
Input
VDD
Receiver Eq. Circuit
Wire
LineRx
RxOut
Delay
RL
tp
Vcm Rx
http://www.satishkashyap.com/
Throughput
can degrade significantly in skewed corners
http://www.satishkashyap.com/
Short p MOS
Vbp
Long n MOS
Vdd
Long p MOS
Vbn
Short n MOS
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Weak Dr.
Vdd
p Bias Gen
Short
pMOS
Vbp
Long
nMOS
Vdd
Wire
Rx
Output
Delay
Input
n Bias Gen
Vdd
Long
pMOS
RxBias
Vbn
Inv.
Amp
Short
nMOS
Ipeak
http://www.satishkashyap.com/
Simulation Setup
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Percentage Degradation
Delay
Throughput
25
33
10
14
4
9.5
http://www.satishkashyap.com/
2
http://www.satishkashyap.com/
Signaling System/
Logic Circuit
CMS-Fb
CMS-Fpw
CMS-Bias
Voltage Mode
Ring Oscillator Freq
Percentage Degradation
SS
SNFP FNSP
17.5
5.7
2.9
32
33.6
34.9
18.75
8.2
7.14
27
<1
2.8
23
2.88
3
Overall Comparison
http://www.satishkashyap.com/
Delay
(ps)
700
503
490
1100
Throughput
(Gbps)
2.56
2.65
2.56
2.85
Power
( W )
146
114
113
655
Area
(m2 )
2.00
2.40
3.07
12.53
Overall Comparison
http://www.satishkashyap.com/
10000
1.5
1
0.5
Data Rate(Mbps)
800
400
200
10
12
10
100
1000
Data Rate(Mbps)
600
Line =1.5mm
200
10
100
(c)
Data Rate = 500 Mbps
X 6.6
400
10000
150
(f)
4 6 8 10 12 14
Line Length (mm)
Line=6mm
1
0.1
50
0
4 5 6 7 8 9 10
0
Line Length (mm)
DODFpw+RxFb [2]
DODFb+RxFb [1]
2
X8
100
200
(d)
600
4
6
8
10
Line Length (mm)
800
(b)
Line=6mm
125 Mbps
1000
Power (uW)
Energy (pJ)
(a)
Power (uW)
Power (uW)
Delay (ns)
2.5
0.01
10
100
1000
10000
4 6 8 10 12 14
Data Rate (Mbps)
Line Length (mm)
Proposed
DODFpw+RxBMul [3]
Voltage Mode
http://www.satishkashyap.com/
Bidirectional Links
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Back-to-Back Connected
Tri-state Buffers
En
En=
En
En
En
Direction
Signal
Wire
Segment
Wire
Segment
Wire
Segment
En
En
En
En
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Transmitter Part
Receiver Part
Strong
Driver
Short
PMOS
Weak
Driver
Terminator
Vbp
Tx/Rx
Long
NMOS
Inverter
Amplifier
Vbp
Tx/Rx
Tx_ip_1
In
Data
Delay
element
Vbn
out
Wire
Long
PMOS
Tx_ip_0
Tx/Rx
Vbn
Tx/Rx
Short
NMOS
(a)
VMBid
(b)
Power (uW)
Delay (ns)
2.5
2
1.5
1
0.5
0
2
35%
3 4 5 6 7
Line Length (mm)
(d)
Line=4mm
1e3
Crossover
Data Rate (Mbps)
Power (uW)
1e2
100Mbps
1e2
7x
1e3
(c)
10e3
180
5X
100
Data Rate(Mbps)
1000
CMBid
Power
140
100
60
20
2
VMBid
Power
http://www.satishkashyap.com/
Peak Current Drawn From Supply
Specs
TT
SS
FF
FNSP
Delay (ns)
VM-Bid CM-Bid
1.35
0.81
1.57
0.90
1.21
0.69
1.35
0.80
Power (W)
VM-Bid CM-Bid
2127
567
2055
435
2163
727
2113
572
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Part III
http://www.satishkashyap.com/
Motivation
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
S 0
S 1
RO
RO with
Wire
Tx Wire Rx
L3
L1
L2
CMS Link
Demux
Mux
I
N
V
E
R
T
E
R
S
D
E
M
U
X
M
U
X
L1
Transmitter
Wire
L3
Receiver
L2
L3=L1+L2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
S 0
S 1
RO
RO with
Wire
L3
L1
Tx Wire Rx
L2
CMS Link
Demux
Mux
I
N
V
E
R
T
E
R
S
D
E
M
U
X
M
U
X
L1
Transmitter
Wire
L3
Receiver
L2
L3=L1+L2
Delay = 0.5
1
fRO
1
fsystem
http://www.satishkashyap.com/
http://www.satishkashyap.com/
fRO
fsystem
We call this the Calculated Delay
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Line Length
(mm)
4
6
10
14
Simulated
Delay (ps)
501
661
1068
1575
Calculated
Delay (ps)
507
658
1077
1599
% Error
1.2
0.4
0.8
1.5
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
Vref
Mn0
Mn1
Clock
I
Test Pulse
Input
0
1
Delayed
System Input
Under Test
Pulse Select
Delay =
Value of http://www.satishkashyap.com/
k is found experimentally using a calibration pulse
of known duration.
CV
I
= kV
http://www.satishkashyap.com/
Line
Length
(mm)
4
6
10
14
Simulated Delay
rising
falling
(ps)
(ps)
380
393
478
497
730
769
1065
1149
Calculated Delay
rising
falling
(ps)
(ps)
378
398
482
503
733
781
1078
1171
Error
rising falling
%
%
0.8
1.0
0.8
1.2
0.4
1.8
1.2
1.9
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Measurement Results
http://www.satishkashyap.com/
Delay
(ns)
1.191
1.006
0.938
Energy
(pJ)
4.54
1.52
0.851
EDP
(pJns)
5.328
1.52
0.799
Measured at
Data Rate (Mbps)
371
400
621
http://www.satishkashyap.com/
http://www.satishkashyap.com/
(a) VM
CMSFb
Power (mW)
Delay (ns)
10
1.2
40%
0.8
Energy/bit (pJ)
(c)
5
6
7
Line Length (mm)
180
Power
of
CMSBias
At least 7 lower
power in the worst
process corner
65% reduction in
peak current
Power
of
VM
100
4
5
6
7
Line Length (mm)
140
(d)
Line=6mm
0.1
Breakeven
Data Rate (Mbps)
0.4
CMSBias
(b)
1.6
8
66.66 Mbps
100
Data Rate(Mbps)
1000
60
20
2
4
5
6
7
Line Length (mm)
http://www.satishkashyap.com/
Source
JSSCC
2006
Sim./Measured Meas.
Tech.
130nm
Line (mm)
10
Gain in Delay
32%
Gain in Energy/bit 35.48%
Gain in EDP
56.5%
Data Rate (Gbps)
3
Activity
1.0
CICC
ESSCIRC
This This*
2006 2005(CMS-Fb) work work
Meas.
Meas.
Meas. Sim.
250nm
130nm
180nm 180nm
5
10
6
6
28.3%
53%
22.5% 32%
67%
25%
81.0% 87%
76.8%
65.5%
85% 90%
2
0.7
0.62
1
1.0
NA
1.0
1.0
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Signaling
Scheme
CM-Bid
Delay
(ns)
1.16
Power
(W )
680
PDP
(mWns)
0.788
Data rate
of Measurement(Gbps)
0.56
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Parameters
Isatn (mA)
Isatp (mA)
Vtn (mV)
Vtp (mV)
Ioffn (pA)
Ioffp (pA)
Idsn /Idsp @ Vgs
Idsn @0.9 (A)
Idsp @0.9 (A)
Idsn @1.2 (A)
Idsp @1.2 (A)
Idsn @1.8 (A)
Idsn @1.8 (A)
TT
http://www.satishkashyap.com/
CMSBid (Measured)
VMBid (MMP )
Power (uW)
Delay (ns)
1.7
1.5
1.3
1.1
0.9
2200
1700
1200
700
200
PDP (X 1e12)
1.6
1.7
Vdd (V)
1.8
2.8
2.3
1.8
1.3
0.8
0.3
1.6
1.7
Vdd (V)
Improvement in Specs
For Simulations using MMP
Vdd (V)
1.6
1.6
1.7
Vdd (V)
1.8
Delay(%) Power(x)
1.8
PDP(x)
36.8
4.5
7.2
1.7
34.4
4.39
6.8
1.8
34.21
4.01
6.0
http://www.satishkashyap.com/
Conclusion
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Contents
1 Introduction
1.1 Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Unscaled Interconnect Delay . . . . . . . . . . .
1.2 Buffer Insertion for Delay Reduction . . . . . . . . . .
1.2.1 Optimum Buffer Insertion . . . . . . . . . . . .
1.3 Concerns with Voltage mode Buffer Insertion Technique
1.3.1 Timing closure . . . . . . . . . . . . . . . . . .
1.3.2 Problem with bi-directional data transmission .
1.3.3 Signal Integrity . . . . . . . . . . . . . . . . . .
1.4 Current signaling . . . . . . . . . . . . . . . . . . . . .
1.4.1 Zero input impedance circuit . . . . . . . . . . .
1.5 Other low impedance line terminations . . . . . . . . .
1.5.1 Digital Designers need not panic! . . . . . . . .
1.6 Reduced swing signaling . . . . . . . . . . . . . . . . .
1.7 Improvment in Current Mode Signaling . . . . . . . . .
1.7.1 Inductive Peaking . . . . . . . . . . . . . . . . .
1.7.2 Simulation Results . . . . . . . . . . . . . . . .
1.7.3 Dynamic Overdriving . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
2
2
3
3
4
4
5
5
5
6
8
8
9
10
10
15
15
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22
22
22
22
23
23
24
24
25
25
26
27
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
http://www.satishkashyap.com/
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
http://www.satishkashyap.com/
2.7
2.8
Performance Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bidirectional Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.1 Simulated Performance of Bidirectional Link . . . . . . . . . . . . . . .
http://www.satishkashyap.com/
28
30
31
http://www.satishkashyap.com/
Chapter 1
Introduction
1.1
Scaling
VLSI technology has used device scaling to continually improve the performace of circuits.
In constant field scaling, all device dimensions as well as all voltages are scaled down by
some factor S. This leads to improved packing density: ( S 2 ), improved speed (delay S),
and improved power consumption ( S 2 ). However these improvements apply only to active
circuits. What about passive components?
1.1.1
Consider an interconnect in a chip. This is made of a metal layer of thickness tm running over
an insulator of thickness ti .
tm
ti
Figure 1.1: Delay through an Interconnect
R=
L
,
W tm
C=
LW
ti
L2
(1.1)
tm ti
To first order, delay is independent of W. This is because increasing W reduces resistance
but increases capacitance in the same ratio. Unfortunately W is the only parameter that the
circuit designer can decide! (L is fixed by the distance between the points to be connected,
Charge Time RC =
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Relative Frequency
If we see the distribution of wirelengths on a design, there are a large number of wires
with short lenths which connect a gate to the other locally. At the same time, there is a con-
1.2
Global Interconnect delay can be the determining factor for the speed of an integrated system.
The L2 dependence of interconnect delay is a source of particular concern. This problem can
be somewhat mitigated by buffer insertion in long wires. We define some critical wire length
L and when a wire segment exceeds this length, we insert a buffer.
1.2.1
What is the optimum wire length after which we should insert a buffer? Consider a long wire
in which we insert buffers after every segment of length L. From eqn 1.2,
Segment wire Delay =
L2
= AL2
tm ti
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Let buffer delay = . For n segments, there will be n-1 buffers, and L = nL . If the total
Length = L
L
L
L
2
AL
+
(
1)
=
ALL
+
(
1)
L
L
L
L
= 0, so AL2 =
2
L
(1.3)
Since AL2 is the wire delay for the segment, this equation tells us that L should be so chosen
that the wire segment delay = . Total delay is proportional to n and so, is linear in L.
1.3
Currently, buffer insertion is the most widely used method to control interconnect delay.
However, there are several difficulties with buffer insertion. Buffers consume power and silicon
area. Also, we normally do floor planning and layout first and then put in the interconnects.
When the wire length reaches L, we need to put in a buffer. However, it is quite possible that
at this point, there is active circuitry underneath, and there is no room to put in a buffer!
Then we either have to live with buffer insertion at non-optimal wire lengths or create space
by pushing out existing cells and modifying the lay out.
1.3.1
Timing closure
Global interconnects are placed after active circuit design and layout is complete. One has to
anticipate the wire length, and then design the active circuits to meet total delay specifications.
If the actual wire length is different from what was anticipated, one has to re-design the active
circuits after layout. After a fresh layout, wire lengths and hence, delays are changed. This
leads to a design-layout-redesign iteration known as Timing Closure. This iteration becomes
longer and longer when total delays are dominated by interconnect delay.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1.3.2
Global interconnects often include data busses, which may require bidirectional data transmission. (For example, a bus connecting a processor and memory). However, buffer insertion
fixes the direction of data flow! Therefore, if we need bidirectional transmission, we need to
replace buffers with bidirectional transceivers. These require a direction signal, which will
enable the buffers pointing in the desired direction. This direction signal must also be routed
with the bus (and should have its own buffers) and it should reach the bidirectional buffers
ahead of the data.
1.3.3
Signal Integrity
As interconnect wire separation is reduced, there is a serious signal integrity problem because
of electrostatic coupling between long wires. Inter-signal interference can lead to unpredictable
delay variations. Grounded shielding wires must often be inserted to avoid interference. This
leads to extra capacitance and CV 2 f power loss.
1.4
Current signaling
Because of these problems with voltage mode signaling, we propose that 1s and 0s be signaled
by the presence or absence of a current and not by a high or a low voltage. This has several
advantages:
Current rise time is limited by inductance rather than capacitance. Typically, inductive
effects are much smaller than capacitive effects. (After all, 4, = 1 for insulators
used in ICs). So electromagnetic coupling is lower than electrostatic coupling.
Signal voltage swings are limited by scaled down supply voltages: this does not restrict
current swings.
In fact, we can use multiple current values to send more than one bit down the same
wire!
If we hold the Voltage on the interconnect nearly constant dynamic power will be negligible
and latency will be much lower.
We also have the option of using multiple current levels to transmit multiple bits simultaneously. This can give higher Throughput and lower interconnect area.
Current mode transmission offers the possibility for improving Latency, Throughput and
Power simultaneously!
Since V 0, while I 6= 0,
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1.4.1
Low rin amps are used for photo-detectors [?]. Once such configuration is shown below: This
Vref
v
Mp1
i1
Mp2
v1
i2
Mn1
v2
Mn2
i1 = gmp1 v +
gmn2 /gmn1
i1
gmp2 /gmp1
We define
gmn2 /gmn1
gmp2 /gmp1
(1.4)
then, i1 (1 ) = gmp1 v
Which gives rin = (1 )/gmp1
(1.5)
By making close to 1, we can reduce the input impedance to 0. In fact we can set the
input impedance to any value, (for example, the characteristic impedance of a transmission
line) by a proper choice of and gmp1 . However, we should make sure that does not exceed
1, because that will lead to a negative input impedance, and instability. Therefore it is of
some interest to determine how accurately we may set the value of inspite of power supply,
process and temperature variations.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Robustness of design
In saturation,
1
W
Id = Cox (Vg VT )2
2
L
W
So, gm = Cox (Vg VT ) =
L
gmn2 /gmn1
gmp2 /gmp1
2Cox
W
Id
L
v
u
u (W/L)n2 I2
=t
(W/L)n1 I1
v
u
u (W/L)p2 I2
=t
(W/L)p1 I1
v
u
(W/L)n2 /(W/L)n1
gmn2 /gmn1 u
Therefore
=t
gmp2 /gmp1
(W/L)p2 /(W/L)p1
(1.6)
This means that depends only on transistor geometries and is independent of supply voltage,
bias values, transistor parameters or temperature. This enables us to choose a value of very
close to 1, which in turn can provide very low input impedence.
Receiver Design - Input stage
Just by adding another current mirror transistor and a current to voltage converter, we can
use the beta multiplier as a receiver for current mode data signaling.
Iint
Vref
Mp1
i1
Mp2
v1
i2
Mn1
Iout
v2
Mn2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1.5
The beta multiplier is not the only choice for providing low input impedance. Simpler circuits
like a diode connected MOS transistor are often used. Another option is to use an inverter
with its output shorted to its input as the termination. This is equivalent to terminating the
line to ground through a diode connected n channel transistor and to Vdd through a diode
connected p channel transistor. The effective terminating admittance is the sum of gm values
of n and p channel transistors.
Indeed in our later work, we have preferred a reference inverter with its output shorted
to input as the line termination. Low input impedance can be achieved by adjusting the
Vdd
1.5.1
We suggest that only the interface works in current mode. Rest of the circuit remains traditional.
A library circuit will do the voltage mode to current conversion (transmitter) and another
will convert the current back to voltage mode (receiver).
9
http://www.satishkashyap.com/
http://www.satishkashyap.com/
To put this plan into action, we need a receiver with very low input impedance. (If inductive
effects are to be taken into account, we would like to terminate the line into its characteristic
impedance.)
1.6
The main advantage of the current mode signaling comes from the fact that the line voltage
is held nearly constant. This is somewhat similar to low swing signaling in voltage mode.
Low swing signaling in voltage mode involves driving high capacitive loads like interconnects
Low Swing Voltage mode
Line
Buffer/amp
Low swing
Driver
Receiver
RL
In reduced swing voltage mode signaling, the line is not terminated in a low impedance.
Current mode signaling terminates the line in a low impedance.
This reduces the time constant, increases bandwidth.
However, this also leads to static power consumption.
10
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1.7
Traditional current mode signaling consumes Static Power and presents a trade-off between
speed, static power and signal to noise ratio. Its performance can be improved by two techniques:
Inductive Peaking
Dynamic Over-driving
1.7.1
Inductive Peaking
R0
R0
R0
L
DRIVER
C0
C0
C0
C0
RL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
(a)
(b)
Vref
v
Mp1
i1
Mp2
v1
i2
Mn1
v2
Mn2
forms a gyrator circuit with two Gm elements connected back to back along with the parasitic capacitance of the transistors. So Beta Multiplier Circuits can exhibit inductive input
impedance for some frequency range if designed properly.
12
http://www.satishkashyap.com/
http://www.satishkashyap.com/
i1
ro_p1
1/gmp2
Cg3
i2
1/gmn1
Cg1
Cg2
i2 = gmn2 vg1
Figure 1.11: Small Signal Equivalent Circuit of Beta Multiplier
We define:
g1
1 gCmn1
3 Cg3 rop1
2
4
Cg2
gmp2
Cg3
gmp1
gmp1 /gmp2
gmn1 /gmn2
1
R1 gmn1
R3 rop1
R1
R3
(1.7)
Correspondingly, the resistive part of the input impedance can be expressed as:
Rin =
1
gmn1 rop1
1
gmp1 + rop1
(1 ) +
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Zin
Req
Ceq
Leq
Ref f
rop1
Cg1
Cg2
=
+
gmp1 rop1 + 1 gmn1 gmp2
)
Cg2
Cg3
+
+
gmp2 gmn1 rop1 gmn1 gmp1 rop1
(1 ) + gmn11rop1
=
1
gmp1 + rop1
Cef f = KCgx
(1.8)
(1.9)
(1.10)
(1.11)
http://www.satishkashyap.com/
http://www.satishkashyap.com/
of hundreds of nano Henries for a practical range of input current and transistor geometries.
Its effective resistance can be controlled by ratios of transconductances while its effective
inductance depends on the absolute value of transconductance. It is possible to control Rin
and Lef f with very little interaction between the two. Inductance changes from 100nH to
980nH while the value of effective resistance remains within 12% of its nominal value for
20A change in the current.
Current Mode Receiver Circuit with Beta Multiplier
Vdd
Source Type
Beta Mult.
Mp11
Mp22
Mn11
Input
Mp1
Mp2
Mn1
Mn2
Sink Type
Beta Mult.
Figure 1.14: Current mode receiver with inductinve peaking using beta multipliers
We can design a current mode receiver with inductive peaking using two beta multipliers
as shown in fig. 1.14 above. One of the beta multipliers sources current while the other sinks
current. The Effective impedance offered by the receiver is equal to the parallel combination
of the impedance offered by individual beta multipliers. Voltage at the input node swings
around Vref . The small voltage swing on the line is sensed and amplified by the inverting
amplifier. Vref is generated by shorting the input and output of an inverter to ensure that
the value of Vref is the same as the switching threshold of receiver amplifier across all process
corners.
rout of Vref generation circuit comes in series with beta multiplier Zin and hence beta
multiplier has to be sized accordingly.
Vref generation circuit consumes static power.
15
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1.7.2
Simulation Results
To see the effectiveness of inductive termination, we should compare the power as well as speed
of the voltage mode buffer insertion scheme, Diode connected MOS terminated current mode
scheme and the beta multiplier based inductive peaking scheme. Simulations were performed
for a 6mm long line at a rate of 1 Gbps. Results of the comparison are summarized in the
table below:
(line=6 mm, Power measured at 1Gbps)
Signaling
Delay Throughput Power Area
Scheme
(ps)
(Gbps)
( W ) (m2 )
CMS-BMul(30 mV)[1]
420
2.56
310
2.00
CMS-Diode-CC(30 mV)[2] 500
2.45
380
2.00
Voltage Mode
1000
2.85
3000
12.53
Inductive termination gives 16% improvement in delay and about 18 % improvement in power
compared to Diode termination. Compared to Voltage Mode scheme, we see more than 50 %
improvement in delay and an order of magnitude lower power [?, ?].
1.7.3
Dynamic Overdriving
Inductive peaking attempts to correct the low pass nature of the line by putting a high pass
termination at the receiver end. However, by the time the signal reaches the receiver, its
high frequency components have been severely attenuated. Therefore boosting them back to
normal level will also boost high frequency noise.
Rather than boosting the high frequency components at the receiver end, why dont we
boost them before attenuation at the transmitter itself? This technique of boosting the high
frequency components before passing them through a low pass channel is know as preemphasis.
Concept of Dynamic Overdriving/Pre-emphasis
Current mode transmission can be speeded up by using high drive current. However, this
increases static power consumption. One possible solution is to dump high drive current only
when the state of the line needs to be changed from 0 to 1 or from 1 to 0. When the line
remains at 1 or at 0 from one bit to the next, we use a small drive current to maintain the
line at the required voltage. This is called Dynamic Over Driving. Dynamic Overdriving
essentially means amplifying high frequency components of the input signal
16
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
VDD
Input
Wire
Feedback
18
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Figure 1.17: Current drive from a Dynamic Over Drive (DOD) type transmitter
To answer this question, the following four current mode signaling schemes were simulated:
CMS Scheme with DOD and Resistive Load
CMS Scheme with Simple Driver and Resistive Load
CMS Scheme Inductive Load
CMS Scheme with DOD and Inductive Load
Dynamic Overdriving driver was implemented by an ideal voltage controlled current source
(VCCS) with the output current wave shape as shown in fig 1.17. The Simple driver was
implemented as a Voltage Controlled Current Sounce with a square output current wave
shape. The drive current in this case is Iavg for a 0 at the input and +Iavg for a 1 at the
input. For a fair comparison, Iavg for the simple driver is equal to the weighted mean of the
current used for dynamic overdrive transmitter.
Iavg =
Ipeak tp + Istatic (t tp )
t
http://www.satishkashyap.com/
(1.12)
http://www.satishkashyap.com/
Comparison of Delay
With Large Overdrive (Ipeak = 500A)
Dynamic overdriving shows 5 improvement in delay over RC
Inductive peaking does not offer substantial additional advantage when combined with
dynamic overdriving.
Inductive peaking alone shows 25% of improvement in delay over RC
With Small Overdrive (Ipeak = 50A)
Dynamic Overdriving alone and inductive peaking alone give nearly the same delay
Inductive peaking along with dynamic overdriving shows around 20% improvement in
delay over dynamic overdriving alone
20
http://www.satishkashyap.com/
http://www.satishkashyap.com/
21
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Figure 1.18: Eye diagram for different schemes at data rates where the eye opening is 32
mV
22
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Chapter 2
Variation Tolerant Current Mode
Signaling
2.1
Current mode signaling derives its advantages over voltage mode due to the reduced swing on
the line. Careful design is necessary, otherwise small changes in device parameters can have a
disproportionate effect on the performance of the system. In modern short channel processes,
variations in transistor parameters are large some of the parameters can vary by as much
as 40% of their nominal values. We have to design circuits, so that they are robust with
respect to batch-to-batch variations, as well as variations between devices on the same die.
Batch-to-batch or inter-die variations can shift operating points and drive strengths, while
intra-die variations cause mismatch in parameters of transmitter and receiver transistors.
2.2
Robustness requirements
Process, Supply Voltage and Temperature (PVT) variations will affect the core logic as well
as data communication circuitry. The requirement for data transmission is therefore not of
complete invariance with respect to PVT variations. We have to ensure that throughput and
delay properties of the interconnect are at least as good as data generation and clock rates.
Thus the deterioration in interconnect properties should be no worse than the deterioration
in general logic.
2.2.1
Due to process, voltage and temperature variations, the drive capabilities and operating
points of various circuits used for data transmission will vary. The cumulative effect of all
23
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.2.2
Because global interconnects, by definition, connect remote points on the die, on chip variations can, in fact, be of even greater concern. On chip variations will result in different
common mode voltages at the transmitter and the receiver end. In case of ideal match, small
Ideal
VcmRx
Transmitter
Receiver
Misaligned
VcmRx
2.3
Variations in the following parameters have a strong influence on the performance of the
signaling scheme:
1. Ipeak : Peak current supplied by the strong driver during input transition
2. tp : Duration for which the strong driver is ON
24
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.4
Several current mode signaling schemes have been suggested in the literature. We shall
concentrate on three schemes here.
2.4.1
This scheme uses feedback at both the transmitter and the receiver ends to adjust the operating points of these circuits. [?] The transmitter used by this scheme is shown below:
The feedback inverter converts low swing logic levels on the line to full rail to rail CMOS
Strong
Driver
Weak
Driver
VDD
Input
Wire
Feedback
From
Wire
I1
25
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.5
2.5.1
Weak
Driver
VDD
Receiver Eq. Circuit
Wire
Input
LineRx
RxOut
RL
I1
Feedback
Vcm Rx
Wire
VCMRx
VMTx
26
http://www.satishkashyap.com/
http://www.satishkashyap.com/
malfunction.
The same phenomenon will occur for the high to low transition if VCM T x > VCM Rx .
2.5.2
Weak
Driver
VDD
Fixed Width
Pulse Generator
Input
LineRx
RxOut
Delay
RL
Vcm Rx
27
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.6
Vdd
Short p MOS
Vbp
Long n MOS
Long p MOS
Vbn
Short n MOS
Weak Dr.
Vdd
p Bias Gen
Short
pMOS
Vbp
Long
nMOS
Vdd
Wire
Rx
Output
Delay
Input
n Bias Gen
Vdd
Long
pMOS
RxBias
Inv.
Amp
Vbn
Short
nMOS
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1
V = Istatic RL remains the same across all corners, RL = gmn +g
mp
The inverter with input-output shorted and the inverter amplifier are designed using
fingers and placed close to each other so that their switching thresholds are closely
matched across all corners.
This makes the proposed circuit less sensitive to intra die process variations as well.
2.7
Performance Evaluation
Simulation Setup
Foundry specified four corner model files and mismatch model file for Montecarlo simulations were used.
All the signaling schemes offer the same input capacitance (equivalent to one minimum
sized inverter).
All signaling scheme drive FO4 load.
Line RLC used were: Rline = 244 /mm, Lline = 1.5nH/mm, Cline = 201f F /mm.
All schemes were designed for a throughput of 2.65Gbps.
Current mode schemes are designed for Ipeak = 500A
Effect of Intra-die Process Variations
Mismatch in Vm of an inverter can be up to 40 mV. 1 . For a mismatch of 40 mV in the Vm
value of the inverters,
CMS system
CMS-Fb
CMS-Fpw
CMS-Bias
1
Percentage Degradation
Delay
Throughput
25
33
10
14
4
9.5
29
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Delay Throughput
(ps)
(Gbps)
700
2.56
503
2.65
490
2.56
1100
2.85
Power Area
( W ) (m2 )
146
2.00
114
2.40
113
3.07
655
12.53
The CMS-Fb scheme consumes higher power than other schemes due to static power
consumption in the feedback inverter
The proposed scheme shows 78% improvement in area over voltage mode scheme whereas
other schemes, CMS-Fb and CMS-Fpw show 84% and 80% respectively
10000
1.5
1
0.5
Data Rate(Mbps)
800
400
200
10
12
10
100
1000
Data Rate(Mbps)
600
100
Line =1.5mm
200
0
10000
(c)
Data Rate = 500 Mbps
X 6.6
400
10
150
(f)
4 6 8 10 12 14
Line Length (mm)
Line=6mm
1
0.1
50
0
4 5 6 7 8 9 10
0
Line Length (mm)
DODFpw+RxFb [2]
DODFb+RxFb [1]
2
X8
100
200
(d)
600
4
6
8
10
Line Length (mm)
800
(b)
Line=6mm
1000
125 Mbps
Power (uW)
Energy (pJ)
(a)
Power (uW)
Power (uW)
Delay (ns)
2.5
0.01
10
100
1000
10000
4 6 8 10 12 14
Data Rate (Mbps)
Line Length (mm)
Proposed
DODFpw+RxBMul [3]
Voltage Mode
30
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.8
Bidirectional Links
Bidirectional Links
In many applications, on-chip buses need to carry signal in both directions.
For example, the bus between processor and memory, main processor and floating point
multiplier etc.
Often bidirectional buffers with direction control are used for this.
Limitations of Conventional Bidirectional Buffer
En
En=
En
En
En
Direction
Signal
Wire
Segment
Wire
Segment
En
En
Wire
Segment
En
En
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Receiver Part
Strong
Driver
Short
PMOS
Weak
Driver
Inverter
Amplifier
Terminator
Vbp
Tx/Rx
Long
NMOS
Vbp
Tx/Rx
Tx_ip_1
In
Data
Delay
element
Tx_ip_0
Wire
out
Vbn
Long
PMOS
Tx/Rx
Vbn
Tx/Rx
Short
NMOS
2.8.1
(a)
VMBid
(b)
Power (uW)
Delay (ns)
2.5
2
1.5
1
0.5
0
2
35%
7x
1e3
1e2
3 4 5 6 7
Line Length (mm)
(c)
(d)
Line=4mm
100Mbps
1e3
1e2
Crossover
Data Rate (Mbps)
Power (uW)
10e3
180
5X
100
1000
CMBid
Power
140
100
60
20
2
Data Rate(Mbps)
1.7 lower power for 2mm lines and 7 lower power for 8mm line
32
http://www.satishkashyap.com/
VMBid
Power
http://www.satishkashyap.com/
For lines longer than 2mm communicating at data-rates more than 180Mbps, the proposed
scheme consumes less power than voltage-mode
Designed in 180nm for Vdd =1.8V using nominal Vt devices
Line Characteristics: R=211/mm and C=0.245pF/mm
33
http://www.satishkashyap.com/
http://www.satishkashyap.com/
June 1,2006
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
A simple model
Drain Current (mA)
1.4
Vg = 3.5
1.2
1.0
3.0
0.8
0.6
2.5
0.4
2.0
0.2
0.0 0.5
1.5
1.0
1.0 1.5 2.0 2.5 3.0 3.5
Drain Voltage (V)
Ids = K
(Vgs VT )2
2
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
0.0
0.2
0.4
1.4 1.6
0.0
2(V
V
)
gs
T
define Vdss VE 1 +
1
VE
Vgs VT
(Vgs VT ) 1
2VE
1 2
and Idss K (Vgs VT )Vdss Vdss
1.0
2.0
3.0
4.0
5.0
2
Drain Voltage (V)
1 2
for Vgs > VT and Vds Vdss Ids = K (Vgs VT )Vds Vds
2
V + VE
and Vds > Vdss Ids = Idss d
for Vgs > VT http://www.satishkashyap.com/
Vdss + VE
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
CMOS Inverter
The simplest of CMOS logic structure is the inverter.
CMOS inverter is the basic gate.
Vdd
Vi
Vo
http://www.satishkashyap.com/
geometries of the pull up and pull down
networks to single transistors.
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Static Characteristics
Inverter Transfer Curve
The range of input voltages can be divided into
several regions.
OH
OL
iL
iH
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
OH
OL
iL
iH
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
OH
OL
iL
iH
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
1
Vo ) (Vdd Vo )2
2
Kn
(Vi VTn )2
2
http://www.satishkashyap.com/
have their usual meanings.
Where symbols
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
If Kn = Kp ; ( = 1),
q
Vo = (Vi + VTp ) + (Vdd VTn VTp )(Vdd 2Vi + VTn VTp )
Vdd + VTn VTp
2
for Vi
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
,
1+
3.0
VoH
Output Voltage
2.5
2.0
V +V
Tn Tp
1.5
1.0
0.5
VoL
0.0
0.0
0.5
1.0
1.5
2.0
ViL
ViH
Input Voltage
Vi VTn Vo Vi + VTp
2.5 3.0
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
(Vdd Vi VTp )2
1 2
(Vi VTn )Vo +
Vohttp://www.satishkashyap.com/
=0
2
2
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
(Vdd Vi VTp )2
1 2
Vo (Vi VTn )Vo +
=0
2
2
This has solutions
Vo = (Vi VTn )
(Vi VTn )2
(Vdd Vi VTp )2
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
OH
OL
iL
iH
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Noise Margins
For robust design, the output levels must be interpreted
correctly at the input of next stage even in the presence of
noise.
For the high level, we require that the output of one stage
should still be interpreted as high at the input of the next
gate even when pulled down a little due to noise.
Therefore VoH should be > ViH .
Similarly VoL should be < ViL
The difference, ViL VoL is the low noise margin. and
VoH ViH is the high noise level.
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Logic Levels
A digital circuit should distinguish logic levels, but be
insensitive to the exact analog voltage at the input.
Therefore flat portions of the transfer curve (where
small) are suitable for digital logic.
Vo
Vi
is
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Vdd
Vi
Vo
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
This gives
3Vdd + 5VTn 3VTp
8
+
V
7V
Vdd VTn VTp
Tn + VTp
dd
= http://www.satishkashyap.com/
= Vdd
8
8
ViL =
VoH
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Dynamic Characteristics
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Rise time
Vdd
ViL
Idp = C
Vo
dVo
dt
so,
dt
dVo
=
C
Idp
Integrating both sides, we get
Z VoH
rise
dVo
=
http://www.satishkashyap.com/
C
Idp
0
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
rise
=
C
VoH
dVo
Idp
Z
Z
ViL +VTp
dVo
Kp
2 (Vdd
0
VoH
ViL +VTp
Kp (Vdd
ViL VTp )2
dVo
ViL VTp )(Vdd Vo ) 12 (Vdd Vo )2
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
rise =
+
2C(ViL + VTp )
Kp (Vdd ViL VTp )2
Vdd + VoH 2ViL 2VTp
C
ln
Kp (Vdd ViL VTp )
Vdd VoH
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Fall Time
Vo
V
iH
dVo
dt
Separating variables and integrating from the initial voltage
(= Vdd ) to some terminal voltage VoL gives
Idn = C
fall
=
C
voL
Vdd
dVo
Idn
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Fall time
fall
=
C
voL
Vdd
dVo
Idn
C
Idn
Vi VTn Idn
Vdd
Z Vdd
dVo
=
Kn
2
Vi VTn 2 (Vi VTn )
Z Vi VTn
dVo
+
http://www.satishkashyap.com/
Kn [(Vi VTn )Vo 21 Vo2
VoL
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Fall time
fall
2(Vi VTn ) VoL
V Vi + VTn
1
= Kdd
+
ln
n
2
C
Kn (Vi VTn )
VoL
2 (Vi VTn )
The first term represents the time taken to discharge at
constant current in the saturation regime, whereas the second
term is the quasi-resistive discharge in the linear regime.
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
CMOS Inverter
Inverter Static Characteristics
Noise margins
Dynamic Characteristics
Conversion of CMOS Inverters to other logic
http://www.satishkashyap.com/
D
C
E
Out
Implementation
of A.B + C.(D + E ) in CMOS logic design style.
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
CMOS summary
Logic consumes no static power in CMOS
design style.
Vdd
Vi
Vo
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Vdd
Out
in
Gnd
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Static Characteristics
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Low input
Vdd
Out
in
Gnd
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
V1 V2 V1 + (Vi VTn )2 = 0
http://www.satishkashyap.com/
2
2
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
V1 V2 V1 + (Vi VTn )2 = 0
2
2
The solutions are:
q
V1 = V2 V22 (Vi VTn )2
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
V
)
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Noise Margins
We find points on the transfer curve where the slope is -1.
When the input is low and output high, we should use
q
Vo = VTp + (Vdd VTp )2 (Vi VTn )2
and
Vdd VTp
ViL = VTn + p
( + 1)
s
(V VTp )
http://www.satishkashyap.com/
+ 1 dd
VoH = VTp +
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
(Vdd VTp )
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Ratioed Logic
To make the output low value lower than VTn , we get the
condition
1 Vdd VTp 2
>
3
VTn
This places a requirement on the ratios of widths of n and
p channel transistors. The logic gates work properly only
when this equation is satisfied.
Therefore this kind of logic is also called ratioed logic.
In contrast, CMOS logic is called ratioless logic because it
does not place any restriction on the ratios of widths of n
and p channel transistors for static operation.
The noise
margin for pseudo nMOS can be determined
http://www.satishkashyap.com/
easily from the expressions for ViL , VoL , ViH , VoH .
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Rise Time
Vdd
ViL
Vo
This gives
rise
2VTp
Vdd + VoH 2VTp
C
+ ln
=
Kp (Vdd VTp ) Vdd VTp
Vdd VoH
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Fall Time
Vdd
Out
in
Gnd
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Fall Time
If we assume that the pMOS current remains constant at its
saturation value,
Kp
(Vdd VTp )2
Ip =
2
. We can write the KCL equation at the output node as:
In Ip + C
dVo
=0
dt
which gives
fall
=
C
VoL
Vdd
dVo
In Ip
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Fall Time
Vdd
Out
in
Gnd
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Fall Time
fall
=
C
V1
Vdd
dVo
1
2
2 Kn V1 Ip
VoL
V1
dVo
Kn (V1 Vo 12 Vo2 ) Ip
so,
fall
V V1
= 1 dd 2
+
C
2 Kn V1 Ip
V1
VoL
dVo
Kn (V1 Vo 12 Vo2 ) Ip
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Static Characteristics
Noise margins
Dynamic characteristics
Pseudo nMOS design Flow
http://www.satishkashyap.com/
Vdd
Out
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
xi
f1
xi
F
f2
f1
f2
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
A
A+B
A+B
B
B
A+B
A+B
B
XORXNOR
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
A.B
B
A.B
A
B
A+B
A+B
B
A.B
A+B
A+B
A.B
B
ORNOR
ANDNAND
http://www.satishkashyap.com/
xi
f1
y=F
F
f2
xi
xi
f1
y=F
f2
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
xi
xi
f1
y=F
f2
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
Therefore, thehttp://www.satishkashyap.com/
multiplexer output cannot be pulled low unless
the transistor geometries are appropriately ratioed.
Dinesh Sharma
http://www.satishkashyap.com/
Vdd
Out
Out
A
http://www.satishkashyap.com/
Vdd
Out
Out
A
http://www.satishkashyap.com/
Vdd
Out
Out
A
http://www.satishkashyap.com/
Vdd
Out
Out
A
http://www.satishkashyap.com/
Out
A
A
http://www.satishkashyap.com/
Dynamic logic
In this style of logic, some nodes are required to hold their
logic value as a charge stored on a capacitor.
These nodes are not connected to their drivers
permanently.
The driver places the logic value on them, and is then
disconnected from the node.
Due to leakage etc., the logic value cannot be held
indefinitely.
Dynamic circuits therefore require a minimum clock
frequency to operate correctly.
Use of dynamic circuits can reduce circuit complexity and
http://www.satishkashyap.com/
substantially.
power consumption
Dinesh Sharma
http://www.satishkashyap.com/
B
C
Ck
CL
http://www.satishkashyap.com/
Ck
Ck
(A+B).C = TRUE
A
B
C
Out
(A+B).C = FALSE
CL
Ck
Out
Out
http://www.satishkashyap.com/
In phase 1 node P is
pre-charged.
Ck23
P
A
B
C
Ck12
http://www.satishkashyap.com/
evaluates in phase 3 and is
valid in phases 4 and 1.
Dinesh Sharma
http://www.satishkashyap.com/
Drive cycles
Drive Sequences
Type 1
Type 2
Type 4
http://www.satishkashyap.com/
Domino Logic
P
A
B
C
Ck
http://www.satishkashyap.com/
Dinesh Sharma
http://www.satishkashyap.com/
Zipper Logic
Instead of using an inverter, we can alternate n and p
evaluation stages.
Vdd
B
C
Ck
E
D
Ck
Dinesh Sharma
http://www.satishkashyap.com/
Logic Design
Dinesh Sharma
Microelectronics group
EE Department, IIT Bombay
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Contents
1 Transistor Models
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
7
7
11
13
16
17
17
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
19
19
20
21
22
23
24
24
25
25
26
28
30
31
32
33
33
http://www.satishkashyap.com/
.
.
.
.
.
.
.
.
http://www.satishkashyap.com/
List of Figures
1.1 MOS characteristics according to the simple analytic model . . . . .
1.2 MOS characteristics with non zero conductance in saturation . . . .
2.1
2.2
2.3
2.4
2.5
.
.
.
.
.
.
.
.
.
.
8
10
13
15
18
3.1
3.2
3.3
3.4
3.5
.
.
.
.
22
24
25
26
.
.
.
.
.
.
.
.
.
.
.
.
26
27
27
28
28
29
29
30
32
32
33
34
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.15
3.16
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
http://www.satishkashyap.com/
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
4
http://www.satishkashyap.com/
Chapter 1
Transistor Models
In this booklet, we shall use simple analytical models for MOS transistors. We
use a sign convention according to which, voltage and current symbols associated
with the pMOS transistor (such as VT p ) have positive values. Then, the n channel
formulae can be used for both transistors and we shall assign signs to quantities
explicitly.
1.4
Vg = 3.5
1.2
1.0
3.0
0.8
0.6
2.5
0.4
2.0
0.2
0.0 0.5
1.5
1.0
1.0 1.5 2.0 2.5 3.0 3.5
Drain Voltage (V)
4.0 4.5
http://www.satishkashyap.com/
(1.1)
http://www.satishkashyap.com/
(1.2)
(Vgs VT )2
2
(1.3)
0.0
0.2
1.4 1.6
0.0
1.0
2.0
3.0
4.0
Drain Voltage (V)
5.0
It is assumed that the current increases linearly in the saturation region. All linear
4
http://www.satishkashyap.com/
http://www.satishkashyap.com/
1
= K (Vgs VT )Vds Vds2
2
(1.4)
Vd + VE
Vdss + VE
(1.5)
Where VE is the Early Voltage. Here Vdss and Idss are saturation drain voltage
and drain current respectively. Since the current values must match at either side
of Vds = Vdss , we must have:
Idss
1 2
K (Vgs VT )Vdss Vdss
.
2
(1.6)
For the curve to be smooth and continuous at Vd = Vdss , the value of the first
derivative should match on either side of Vdss . Therefore,
K(Vgs VT Vdss ) =
Idss
Vdss + VE
So,
1 2
K(Vgs VT Vdss )(Vdss + VE ) = K (Vgs VT )Vdss Vdss
2
This leads to a quadratic equation in Vdss
1 2
V + VE Vdss (Vgs VT )VE = 0
2 dss
(1.7)
(1.8)
2(Vgs VT )
= VE 1 +
1
VE
(1.9)
Vgs VT
(Vgs VT ) 1
2VE
http://www.satishkashyap.com/
(1.10)
http://www.satishkashyap.com/
Characteristics of a MOS transistor using this model are shown in fig.1.2. While
accurate modeling of the output conductance is essential for linear design, the
simpler model assuming constant Id in saturation is often adequate for preliminary
digital design. In any case, final designs will have to be validated with detailed
simulations. In this booklet, we shall use the simple model for MOS devices to
keep the algebra simple.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Chapter 2
Static CMOS Logic Design
Static logic circuits are those which can hold their output logic levels for indefinite
periods as long as the inputs are unchanged. Circuits which depend on charge
storage on capacitors are called dynamic circuits and will be discussed in a later
chapter.
2.1
The most common design style in modern VLSI design is the Static CMOS logic
style. In this, each logic stage contains pull up and pull down networks which are
controlled by input signals. The pull up network contains p channel transistors,
whereas the pull down network is made of n channel transistors. The networks are
so designed that the pull up and pull down networks are never on simultaneously.
This ensures that there is no static power consumption.
2.2
CMOS Inverter
The simplest of such logic structures is the CMOS inverter. In fact, for any CMOS
logic design, the CMOS inverter is the basic gate which is first analyzed and
designed in detail. Thumb rules are then used to convert this design to other more
complex logic. The basic CMOS inverter is shown in fig. 2.1. We shall develop
the characteristics of CMOS logic through the inverter structure, and later discuss
ways of converting this basic structure more complex logic gates.
2.2.1
Static Characteristics
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
Vi
Vo
Kn
1
(Vi VT n )2
(Vdd Vi VT p )(Vdd Vo ) (Vdd Vo )2 =
2
2
(2.1)
(Vdd Vi VT p )2 (Vi VT n )2
8
http://www.satishkashyap.com/
(2.2)
(2.3)
(2.4)
http://www.satishkashyap.com/
These equations are valid only when the pMOS is in its linear regime. This requires
that
Vdp Vdd Vo Vdd Vi VT p
Therefore, we must choose the negative sign. Thus
Vdd Vo = (Vdd Vi VT p )
Therefore,
Vo = Vi + VT p +
Vdd Vi VT p )2 (Vi VT n )2
(Vdd Vi VT p )2 (Vi VT n )2
(2.5)
(2.6)
Vdd +
VT n VT p
1+
(2.7)
In the case where we size the n and p channel transistors such that
Kn = Kp ; so = 1
we have
Vo = (Vi + VT p ) +
with
Vi
(2.8)
Vdd + VT n VT p
2
Vdd + VT n VT p
Vi =
(2.9)
1+
both transistors are saturated. Since the currents of both transistors are independent of their drain voltages in this condition, we do not get a unique solution for
Vo by equating drain currents. The currents will be equal for all values of Vo in
the range
Vi VT n Vo Vi + VT p
Thus the transfer curve of an inverter shows a drop of VT n + VT p at a voltage near
Vdd /2. This is actually an artifact of the simple transistor model chosen for this
9
http://www.satishkashyap.com/
http://www.satishkashyap.com/
3.0
VoH
Output Voltage
2.5
2.0
1.5
V +V
Tn Tp
1.0
0.5
VoL
0.0
0.0
0.5
1.0
1.5
2.0
ViL
ViH
Input Voltage
2.5 3.0
analysis, which assumes perfect saturation of drain current. In a real case, the
drain current does depend on the drain voltage (albeit weakly) in the saturation
region. If the model incorporates an Early Voltage like effect, the drop near the
middle of the characteristic is more gradual.
Vdd + VT n VT p
(2.10)
http://www.satishkashyap.com/
(2.11)
http://www.satishkashyap.com/
(Vi VT n )2
(Vdd Vi VT p )2
(2.12)
Since the equations are valid only when the n channel transistor is in the linear
regime (Vo < Vi VT n ), we choose the negative sign. This gives,
Vo = (Vi VT n )
(Vi VT n )2
(Vdd Vi VT p )2
(2.13)
(2.14)
Output Voltage
3
2.5
2
1.5
1
0.5
0
0
0.5
1.5
2.5
Input Voltage
The plot produced by SPICE for this circuit with realistic models is quite similar.
2.2.2
Noise margins
The requirement from a digital circuit is that it should distinguish logic levels,
but be insensitive to the exact analog voltage at the input. This implies that
11
http://www.satishkashyap.com/
http://www.satishkashyap.com/
o
the flat portions of the transfer curve (where V
is small) are suitable for digital
Vi
o
logic. We select two points on the transfer curve where the slope ( V
) is -1.0.
Vi
The coordinates of these two points define the values of (ViL ,VoH ) and (ViH ,VoL ).
Robust digital design requires that the output high level be higher than what is
acceptable as a high level at the input (VoH > ViH ). The difference between these
two levels is the high noise margin. This is the amount of noise that can ride
on the worst case high output and still be accepted as a high at the input of
the next gate. Similarly, we require VoL < ViL . The difference, ViL VoL is the
low noise margin. Obviously, it is of interest to evaluate the values of these noise
margins. For the discussion which follows, we shall use the expressions derived
earlier for = 1 to keep the algebra simple.
Vo = (Vi + VT p ) +
Vo
Vi
Vo
= 1 = 1
Vi
Vdd VT n VT p
Vdd + VT n VT p 2Vi
(2.15)
This gives
VoH =
7Vdd + VT n + VT p
Vdd VT n VT p
= Vdd
8
8
(2.16)
(2.17)
Vdd VT n VT p
2Vi Vdd VT n + VT p
http://www.satishkashyap.com/
(2.18)
(2.19)
http://www.satishkashyap.com/
and
VoL =
Vdd VT n VT p
8
(2.20)
Vdd VT n + 3VT p
4
(2.21)
Vdd + 3VT n VT p
4
(2.22)
The two noise margins can be made equal by choosing equal values for VT n and
VT p .
2.2.3
Dynamic Considerations
In this section, we analyze the dynamic behaviour of the inverter. For the calculation of rise and fall times, we shall assume that only one of the two transistors
in the inverter is on. (Notice that this is more conservative than the input high
and low conditions determined by slope considerations in eq.2.19 and 2.16). We
shall continue to use the simple model described at the beginning of this booklet.
Rise time
When the input is low, the n channel transistor is off, while the p channel transistor is on. The equivalent circuit in this condition is shown in fig. 2.3. From
Vdd
ViL
Vo
13
http://www.satishkashyap.com/
http://www.satishkashyap.com/
dVo
dt
dt
dVo
=
C
Idp
This separates the variables, with the LHS independent of operating voltages and
the RHS independent of time. Integrating both sides, we get
rise
=
C
VoH
dVo
Idp
Till the output rises to ViL + VT p , the p channel transistor is in saturation. Since
the current is constant, the integration is trivial. If VoH > ViL + VT p (which is
normally the case), the integration range can be broken into saturation and linear
regimes. Thus
rise
=
C
ViL +VT p
Kp
(Vdd
2
dVo
ViL VT p )2
dVo
VoH
ViL +VT p
2
2C
V2
2V1 V2 V12
V2
The integral can be evaluated as
dV1
2V1 V2 V12
V2
Z V2
1
1
1
=
+
dV1
2V2 Vdd VoH V1 2V2 V1
V2
1
V1
=
ln
2V2
2V2 V1 Vdd VoH
1
2V2 Vdd + VoH
ln
=
2V2
Vdd VoH
Therefore,
Vdd VoH
Kp rise
ViL + VT p
1
2V2 Vdd + VoH
=
+
ln
2
2C
V2
2V2
Vdd VoH
14
http://www.satishkashyap.com/
http://www.satishkashyap.com/
or
Kp rise
1
2V2 Vdd + VoH
ViL + VT p
=
+
ln
2C
(Vdd ViL VT p )2 2(Vdd ViL VT p )
Vdd VoH
Thus,
C(ViL + VT p )
ViL VT p )2
C
Vdd + VoH 2ViL 2VT p
+
ln
Kp (Vdd ViL VT p )
Vdd VoH
rise =
Kp
(Vdd
2
(2.23)
The first term is just the constant current charging of the load capacitor. The
second term represents the charging by the pMOS in its linear range. This can be
compared with resistive charging, which would have taken a charge time of
= RC ln
Vdd ViL VT p
Vdd VoH
Vo
Vi H
http://www.satishkashyap.com/
http://www.satishkashyap.com/
The n channel transistor will be in saturation till the output voltage falls to Vi - VT n .
Below this voltage, the transistor will be in its linear regime. Thus, we can divide
the integration range in two parts.
Z Vi VT n
f all
dVo Z VoL dVo
=
C
Idn
Vi VT n Idn
Vdd
Z Vdd
dVo
=
Kn
Vi VT n
(Vi VT n )2
2
Z Vi VT n
dVo
+
Kn [(Vi VT n )Vo 21 Vo2
VoL
Therefore
Kn f all
dVo
Vdd Vi + VT n Z Vi VT n
=
+
2
2C
(Vi VT n )
2Vo (Vi VT n ) Vo2
VoL
!
Z Vi VT n
1
Vdd Vi + VT n
1
1
+
dVo
=
+
(Vi VT n )2
2(Vi VT n ) VoL
Vo 2(Vi VT n ) Vo
Which gives
"
Vdd Vi + VT n
1
Kn f all
Vo
=
+
ln
2
2C
(Vi VT n )
2(Vi VT n )
2(Vi VT n ) Vo
=
#Vi VT n
VoL
1
Vdd Vi + VT n
2(Vi VT n ) VoL
+
ln
2
(Vi VT n )
2(Vi VT n )
VoL
and therefore
f all =
C
C(Vdd Vi + VT n )
2(Vi VT n ) VoL
+
ln
Kn
Kn (Vi VT n )
VoL
(Vi VT n )2
2
(2.24)
Again, the first term represents the time taken to discharge at constant current in
the saturation regime, whereas the second term is the quasi-resistive discharge in
the linear regime.
2.2.4
http://www.satishkashyap.com/
http://www.satishkashyap.com/
2.2.5
The CMOS inverter forms the basis of most static CMOS logic design. More complex logic can be designed from it by simple thumb rules. A common (though not
universal) design requirement is symmetric charge and discharge behaviour and
equal noise margins for high and low logic values. This requires matched values
of Kn and Kp and equal values of VT n and VT p . For a constant load capacitance,
rise and fall times depend linearly on Kn and Kp . Thus it is a straightforward
calculation to determine transistor geometries if speed requirements and technological parameters are given. However, as transistor geometries are made larger,
self loading can become significant. We now have to model the load capacitance
as
CLoad = Cext + Kn
where we have assumed that = Kn /Kp is kept constant. is a technological
constant. We use the expressions for K /C which depend only on voltages. Once
these values are calculated, the geometry can be determined.
In the extreme case, when self capacitance dominates the load capacitance, K/C
becomes constant and becomes geometry independent. There is no advantage
in using wider transistors in this regime to increase the speed. It is better to use
multi-stage logic with tapered buffers in this regime. This will be discussed in the
module on Logical Effort.
2.2.6
Once the basic CMOS inverter is designed, other logic gates can be derived from
it. The logic has to be put in a canonical form which is a sum of products with a
bar (inversion) on top. For every . in the expression, we put the corresponding
n channel transistors in series and the corresponding p channel transistors in parallel. for every +, we put the n channel transistors in parallel and the p channel
transistors in series. We scale the transistor widths up by the number of devices
(n or p) put in series. The geometries are left untouched for devices put in parallel. Fig.2.5 shows the implementation of A.B + C.(D + E) in CMOS logic design
style.
17
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
A
D
C
E
Out
18
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Chapter 3
Beyond Static CMOS
3.1
CMOS design style ensures that the logic consumes no static power. This is because the pull down and pull up networks are never on simultaneously. However,
this requires that signals have to be routed to the n pull down network as well as
to the p pull up network. This means that the load presented to every driver is
high. This fact is exacerbated by the fact that n and p channel transistors cannot
be placed close together as these are in different wells which have to be kept well
separated in order to avoid latchup.
Pseudo nMOS design style reduces dynamic power (by reducing capacitive
loading) at the cost of having non-zero static power by replacing the pull up
network by a single pMOS transistor with its gate terminal grounded. The pseudo
nMOS inverter is shown below.
Vdd
Out
in
Gnd
Notice that since the pMOS is not driven by signals, it is always on. The effective
gate voltage seen by the pMOS transistor is Vdd . Thus the overvoltage on the p
channel gate is always Vdd - VT p . When the nMOS is turned on, a direct path
between supply and ground exists and static power will be drawn.
19
http://www.satishkashyap.com/
http://www.satishkashyap.com/
3.1.1
Static Characteristics
As we sweep the input voltage from ground to Vdd , we encounter the following
regimes of operation:
nMOS off
This is the case when the input voltage is less than VT n . The output is high and
no current is drawn from the supply.
nMOS saturated, pMOS linear
As the input voltage is raised above VT n , we enter this region. The input voltage
is assumed to be sufficiently low that the output voltage exceeds the saturation
voltage Vi VT n . Normally, this voltage will be higher than VT p , so the p channel
transistor is in linear mode of operation. Equating currents through the n and p
channel transistors, we get
Kp
Kn
1
(Vdd VT p )(Vdd Vo ) (Vdd Vo )2 =
(Vi VT n )2
2
2
(3.1)
V1 V2 V1 + (Vi VT n )2 = 0
2
2
with solutions
(3.2)
V22 (Vi VT n )2
V1 = V2
substituting the values of V1 and V2 and choosing the sign which puts Vo in the
correct range, we get
Vo = VT p +
(Vdd VT p )2 (Vi VT n )2
(3.3)
VT p +
The nMOS is now in its linear mode of operation. We shall not derive the expression for the output voltage in this mode of operation in the discussion here. The
solution is straightforward, though algebraically tedious.
20
http://www.satishkashyap.com/
http://www.satishkashyap.com/
which gives
1 2
(Vdd VT p )2
Vo (Vo VT n )Vo +
2
2
This can be solved to get
Vo = (Vi VT n )
3.1.2
(Vi VT n )2 (Vdd VT p )2 /
(3.4)
Noise margins
As in the case of CMOS inverter, we find points on the transfer curve where the
slope is -1.
When the input is low and output high, we should use eq(3.3). Differentiating
this equation with respect to Vi and setting the slope to -1, we get
Vdd VT p
ViL = VT n + q
( + 1)
and
VoH = VT p +
(Vdd VT p )
+1
(3.5)
(3.6)
When the input is high and the output low, we use eq(3.4). Again, differentiating
with respect to Vi and setting the slope to -1, we get
2
(Vdd VT p )
ViH = VT n +
3
and
VoL =
(Vdd VT p )
To make the output low value lower than VT n , we get the condition
1 Vdd VT p
>
3
VT n
2
21
http://www.satishkashyap.com/
(3.7)
(3.8)
http://www.satishkashyap.com/
3.1.3
Dynamic characteristics
In the sections above, we have derived the behaviour of a pseudo nMOS inverter
in static conditions. In the sections below, we discuss the dynamic behaviour of
this inverter.
Rise Time
When the input is low and the output rises from low to high, the nMOS is off.
The situation is identical to the charge up condition of a CMOS gate with the
pMOS being biased with its gate at 0V. This gives
rise
"
2VT p
Vdd + VoH 2VT p
C
+ ln
=
Kp (Vdd VT p ) Vdd VT p
Vdd VoH
(3.9)
Fall Time
Analytical calculation of fall time is complicated by the fact that the pMOS load
continues to dump current in the output node, even as the nMOS tries to discharge
the output capacitor.
Vdd
Out
in
Gnd
http://www.satishkashyap.com/
http://www.satishkashyap.com/
remains constant at its saturation value through the entire discharge process. (This
will result in a slightly pessimistic value of discharge time). Then,
Ip =
Kp
(Vdd VT p )2
2
f all
=
C
dVo
=0
dt
VoL
Vdd
dVo
In Ip
1
2
C
Kn (V1 Vo 12 Vo2 ) Ip
Vdd 2 Kn V1 Ip
V1
so,
3.1.4
Vdd V1
f all
= 1
+
C
K V 2 Ip
2 n 1
V1
VoL
dVo
Kn (V1 Vo 12 Vo2 ) Ip
We design the basic inverter first and then map the inverter design to other logic
circuits. The load device size is calculated from the rise time. From eq. 3.9 we
have
"
#
C
2VT p
Vdd + VoH 2VT p
+ ln
rise =
Kp (Vdd VT p ) Vdd VT p
Vdd VoH
Given a value of rise , operating voltages and technological constants, Kp and
hence, the geometry of the p channel transistor can be determined.
Geometry of the n channel transistor in the reference inverter design can be
determined from static considerations. Using eq. 3.4, the output low level is
given by:
q
Vo = (Vi VT n ) (Vi VT n )2 (Vdd VT p )2 /
If the desired value of the output low level is given, we can calculate . But
Kn /Kp and Kp is already known. This evaluates Kn and hence, the geometry
of the n channel transistor.
23
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
Out
3.1.5
Once the basic pseudo nMOS inverter is designed, other logic gates can be derived
from it. The procedure is the same as that for CMOS, except that it is applied
only to nMOS transistors. The p channel transistor is kept at the same size as
that for an inverter.
The logic is expressed as a sum of products with a bar (inversion) on top.
For every . in the expression, we put the corresponding n channel transistors in
series and for every +, we put the n channel transistors in parallel. We scale
the transistor widths up by the number of devices put in series. The geometries
are left untouched for devices put in parallel. Fig.3.2 shows the implementation of
A.B + C.(D + E) in pseudo NMOS logic design style.
3.2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
xi
xi
F
f1
f2
F
f1
f2
Figure 3.3: Basic Multiplexer with logic restoring inverters
other gates of the same type, it must produce the outputs also in true and complement forms. Thus each signal is carried by two wires. This logic style is called
Complementary Passgate Logic or CPL for short.
3.2.1
3.2.2
Since both true and complement outputs are generated by CPL, we do not need
separate gates for AND and NAND functions. The same applies to OR-NOR, and
XOR-XNOR functions.
To take an example, let us consider the XOR-XNOR functions. Because of the
inverter, the multiplexer for the XOR output first calculates the XNOR function
given by A.B +A.B. If we put A = 1, this reduces to B and for A = 0, it reduces to
B. Similarly, for the XNOR output, we generate the XOR expression = A.B +A.B
which will be inverted by the logic level restoring inverter. The expression reduces
to B for A = 1 and to B for A = 0. This leads to an implementation of XOR25
http://www.satishkashyap.com/
http://www.satishkashyap.com/
A
A+B
A+B
B
A+B
A+B
B
XORXNOR
Figure 3.4: Implementation of XOR and XNOR by CPL logic.
A.B
B
A.B
A+B
A
B
A+B
A
B
A.B
A+B
A.B
A+B
ANDNAND
ORNOR
Figure 3.5: Implementation of (a) AND-NAND and (b) OR-NOR functions using
complementary passgate logic.
Implementation of AND and OR functions is similar. In case of AND, the
multiplexer should output A.B to be inverted by the buffer. This reduces to B
when A = 1. When A = 0, it evaluates to 1 = A. For NAND output, the
multiplexer should output A.B, which evaluates to B for A = 1 and to 0 (or A)
when A = 0.
3.2.3
The circuit configuration described above uses nMOS multiplexers. This limits
26
http://www.satishkashyap.com/
http://www.satishkashyap.com/
xi
xi
f1
y=F
F
f2
the high output of the multiplexer (node y - which is the input for the inverter)
to Vdd - VT n . Consequently, the pMOS transistor in the buffer inverter never quite
turns off. This results in static power consumption in the inverter. This can be
xi
xi
f1
y=F
F
f2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
0
0 ->1
0
3.3
Vdd
Out
A
http://www.satishkashyap.com/
http://www.satishkashyap.com/
gates cannot be made in a single stage. However, We can create the OR function
by using a NAND of A and B as shown in figure 3.10. But then what about the
Vdd
Out
A
B
Out
A
A
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Like CPL, this logic requires both True and Complement signals. It also
provides both True and complement outputs. (Dual Rail Logic).
Like pseudo nMOS, the inputs present a single transistor load to the driving
stage.
The circuit is self latching. This reduces ratioing requirements.
3.4
Dynamic Logic
In this style of logic, some nodes are required to hold their logic value as a charge
stored on a capacitor. These nodes are not connected to their drivers permanently. The driver places the logic value on them, and is then disconnected from
the node. Due to leakage etc., the logic value cannot be held indefinitely. Dynamic
circuits therefore require a minimum clock frequency to operate correctly. Use of
dynamic circuits can reduce circuit complexity and power consumption substantially. When the clock is low, pMOS is on and the bottom nMOS is off. The output
Vdd
Out
A
B
C
CL
Ck
Figure 3.12: CMOS dynamic gate to implement (A + B).C.
is pre-charged to 1 unconditionally. When the clock goes high, the pMOS turns
off and the bottom nMOS comes on. The circuit then conditionally discharges the
output node, if (A+B).C is TRUE. This implements the function (A + B).C.
30
http://www.satishkashyap.com/
http://www.satishkashyap.com/
3.4.1
B
C
CL
Ck
Ck
(A+B).C = FALSE
Out
Ck
(A+B).C = TRUE
X
Out
When (A+B).C is TRUE, X takes some time to discharge. During this time,
charge placed on the output leaks away as the input to nMOS of the inverter is
not 0.
31
http://www.satishkashyap.com/
http://www.satishkashyap.com/
3.4.2
Out
B
C
Ck12
Type 1
Type 2
Type 4
Type 3
http://www.satishkashyap.com/
http://www.satishkashyap.com/
types 3 and 4. We can use a 2 phase clock if we stick to type 1 and type 3 gates
(or type 2 and type 4 gates) as these can drive each other.
3.4.3
Domino Logic
P
A
B
C
Ck
3.4.4
Zipper logic
33
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
B
C
E
D
Ck
Ck
Gnd
34
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Microelectronics Group, EE Department
IIT Bombay, Mumbai
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Linear Mode
OH
OL
ViL
ViH
Circuits needhttp://www.satishkashyap.com/
to be biased for operation in the linear regime.
http://www.satishkashyap.com/
Linear Mode
OH
OL
ViL
ViH
Circuits needhttp://www.satishkashyap.com/
to be biased for operation in the linear regime.
http://www.satishkashyap.com/
Linear Mode
OH
OL
ViL
ViH
Circuits needhttp://www.satishkashyap.com/
to be biased for operation in the linear regime.
http://www.satishkashyap.com/
Linear Mode
OH
OL
ViL
ViH
Circuits needhttp://www.satishkashyap.com/
to be biased for operation in the linear regime.
http://www.satishkashyap.com/
I
d
v
o
v
i
Vg
I
Id
dVg + d dVd
Vg
Vd
Id
= gm (Transconductance)
Vg
V
d
Id
= go (O/P conductance)
Vd
go
http://www.satishkashyap.com/
Transistor Characteristics
Transistor Characteristics
gm and go depend on the transistor characteristics.
In saturation,
K
Id (Vgs VT )2
2
where, K is the conductivity factor given by:
W
W
Cox
K =K
L
L
VT is the threshold voltage
W and L are transistor width and length respectively.
is the mobility
and Cox is thehttp://www.satishkashyap.com/
gate oxide capacitance per unit area.
http://www.satishkashyap.com/
Transistor Characteristics
Transconductance
Let VGT (Vgs VT )
2
KVGT
Then Id =
2
2Id
VGT =
K
I
W
gm = d = KVGT = K
VGT
Vg
L
s
r
p
2Id
W
Also gm = KVGT = K
= 2KId = 2K
Id
K
L
Similarly, K =
2Id
and
; Therefore gm =
2Id
VGT =
VGT
VGT
http://www.satishkashyap.com/
2
2Id
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Which formula?
W
L
To increase gm
should we increase VGT ?
s
or decrease it?
W
Is gm linearly dependent on
Id
gm = 2K
L
transistor size?
dependent on its square root?
2I
gm = d
or is it independent of transistor
VGT
size?
In fact, which formula should be applied depends on how the
transistor is biased and sized. If size and VGT are known, the
first formula applies. If the drain current and size are known, the
second one does. If gate voltage and drain current are given
http://www.satishkashyap.com/
and the transistor
is accordingly sized, the third formula should
be used.
gm = K
VGT
http://www.satishkashyap.com/
Transistor Characteristics
Output conductance
Assuming a simple Early effect like model, we can write for go :
go Id /L
where L is the channel length and is a technology dependent
parameter. In terms of geometry and VGT , we can write:
go =
K W 2
V
2 L2 GT
http://www.satishkashyap.com/
Voltage Gain
The voltage gain in terms of geometry and VGT :
Ao =
2L
V
GT
Id
Thus, if the transistor is biased at constant current, the DC gain
is determined by the square root of the gate area.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
AC Behaviour
Cgd
vo
G
vi Cg
S
gm vi
ro
D
Co
S
vo
sCo vo = 0
ro
1
gm vo sCgd + + sCo = 0
ro
sCgd (vi vo ) gm vi
vi sCgd
1 sCgd /gm
vo
AC gain A1 =
So the http://www.satishkashyap.com/
= gm ro
vi
1 + sro (cgd + co )
http://www.satishkashyap.com/
Bandwidth
A1 = gm ro
1 sCgd /gm
1 + sro (cgd + co )
1 sCgd /gm
1 + sro Ctot
Ao
1 + sro Ctot
This describes
the frequency response of a system with one
http://www.satishkashyap.com/
dominant pole. The bandwidth is given by 1/ro Ctot .
http://www.satishkashyap.com/
Gain (db)
Ao
A - 3db
o
0 db
BW
GBW
Frequency
GBW = gm ro
1
gm
=
ro Ctot
Ctot
http://www.satishkashyap.com/
The gain bandwidth
product (or the cutoff frequency) is
independent of ro .
http://www.satishkashyap.com/
Maximum GBW
GBW is max. when there is no load connected and the load is
entirely due to the device capacitance itself. Then the load
capacitance is proportional to the device width.
Ctot = W where is a technological parameter.
GBWmax =
gm
W
K VGT
L
r
1 2K Id
=
WL
2I
d
http://www.satishkashyap.com/
=
WVGT
GBWmax
http://www.satishkashyap.com/
Summary
K WL VGT
go
2
K WVGT
2
2L
Ao
2L
VGT
GBW
GBW max
K WVGT
LCtot
K VGT
L
2K W
L Id
Id
qL
2K WL
Id
2K WId 1
qL Ctot
2K Id
1
WL
2Id
VGT
Id
L
2L
VGT
2Id
VGT Ctot
K VGT
L
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Technological Constraint
Ao GBWmax
2L
K VGT
1
=
=
VGT
L
So Ao GBWmax =
2K WL 1
Id
2K Id
WL
2K
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Cascode Amplifier
ref
Vg2
Vg1
v in
v out
So gmeq =
Id
with dVd2 = 0
Vg1
and goeq =
Id
with dVg1 = 0
Vd2
M2
V
d1
M1
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Equivalent gm of Cascode
Id
Vg1
= dVd1 ,
gmeq =
I
dVds2
V
d2
V
ref
Vg2
Vg1
v in
v out
M2
M1
dVgs2 = dVd1
id
id
So vd1
V
d1
with dVd2 = 0
id
+g
m2
o2
gmeq = d = gm1
gm1
http://www.satishkashyap.com/
vg1
go1 + go2 + gm2
http://www.satishkashyap.com/
Equivalent go of Cascode
goeq =
dVgs1 = 0,
I
d
V
d2
ref
Vg2
Vg1
v in
with dVg1 = 0
dVgs2 = dVd1 ,
dVds2 = dVd2 dVd1
i
id = 0 + go1 vd1 ,
sovd1 = d
go1
v out
M2
V
d1
Id
Vd2
gm2 + go2
+ go2 vd2
go1
id
go1 go2
=
v
g
+
go2 + gm2
o1
d2
M1
go2
http://www.satishkashyap.com/
goeq go1
gm2
goeq =
http://www.satishkashyap.com/
DC gain of Cascode
gmeq
gm1 (gm2 + go2 ) g01 + g02 + gm2
=
goeq
g01 + g02 + gm2
g01 g02
gm1 (gm2 + go2 )
gm1
gm2
=
1+
So
Ao =
g01 g02
g01
g02
gm1
Let
A01
common source gain
g01
gm2
And A02 1 +
common gate gain
g02
Ao =
Then,
Ao = A01 A02
DC gain = thehttp://www.satishkashyap.com/
product of the DC gain of the two transistors.
http://www.satishkashyap.com/
AC Behaviour of Cascode
AC Behaviour of Cascode
I
d
V
d2
ref
Vg2
Vg1
v in
v out
M2
vi
Cg1 gm1 vi
S
V
d1
M1
ro2
Cdg1
vx
vo
ro1
gm2 vx
Co
http://www.satishkashyap.com/
http://www.satishkashyap.com/
AC Behaviour of Cascode
ro2
Cdg1
vx
vi
Cg1 gm1 vi
S
gm2 vx +
vx =
vo
ro1
gm2 vx
Co
vx vo
= sCo vo
ro2
1 + sro2 Co
1 + sro2 Co
vo =
vo
1 + gm2 ro2
A2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
AC Behaviour of Cascode
ro2
Cdg1
vx
vi
Cg1 gm1 vi
S
vo
ro1
gm2 vx
Co
vx
+ sCo vo
ro1
vo
A1 A2
=
vi
1 + sro1 Co (A2 + ro2 /ro1 )
http://www.satishkashyap.com/
http://www.satishkashyap.com/
AC Behaviour of Cascode
ref
v in
Load capacitance = 1 pF
The two transistors in cascode
I
configuration have identical geometries
d
V
d2
v out
and the load is an ideal current source.
Vg2
M2
Assume the following technological
V
parameters:
d1
Vg1
Kn = 150A/V 2, VTn = 0.5V , VE = 20V
M1
http://www.satishkashyap.com/
Assume the supply voltage to be 3.3V.
http://www.satishkashyap.com/
AC Behaviour of Cascode
Calculation of gm
The gain bandwidth product is given by
2 108 =
gm
C .
So,
gm
gm1
=
C
1012
So gm1 = 628.3S
Since the same current flows through the two transistors and
they have the same geometry, gm1 = gm2 , go1 = go2 .
Let A =
gm1
gm2
=
go1
go2
Therefore,
gm2
gm1
1+
= A(A + 1)
2500 =
http://www.satishkashyap.com/
go1
go2
This gives A 49.5.
http://www.satishkashyap.com/
AC Behaviour of Cascode
49.5 =
628.3 106
go1
so go1 = 12.7S
Id
I
= d
VE
20
Therefore gm = 628.3S,
http://www.satishkashyap.com/
AC Behaviour of Cascode
Bias Voltages
1 W 2
Id = K VGT
2
L
d
V
d2
ref
Vg2
Vg1
v in
v out
M2
V
d1
M1
So VGT =
2 254
= .81V
150 5.2
http://www.satishkashyap.com/
AC Behaviour of Cascode
DC level incompatibility
The output DC level of a cascode amplifier is higher than the
input DC level. This causes problems with direct connection to
the next stage, or with DC feed back to itself.
These problems can be reduced if we use
a complementary arrangement of n and p
channel transistors for cascoding.
The upper transistor of the cascode
arrangement can be thought of as a
source follower to its bias voltage, which
keeps the drain voltage of the lower
amplifier transistor (nearly) constant.
Vdd
Load
Vbiasn
Vout
Vin
Gnd
http://www.satishkashyap.com/
AC Behaviour of Cascode
Alternative Cascode
Vdd
M1
Gnd
http://www.satishkashyap.com/
M2
Vbiasp
Vout
Load
http://www.satishkashyap.com/
Folded Cascode
Folded Cascode
Vdd
Vbiasp1
M3
M2
Vin
M1
Gnd
Vbiasp2
Vout
Load
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Io
M1
Vref
M2
K
(Vref VT )2
2
r
2Iref
K
If M2 is also saturated, Io = Iref
Therefore Vref = VT +
http://www.satishkashyap.com/
Vbiasp2
Vbiasn
Vin
Gnd
Vout
http://www.satishkashyap.com/
Vx
M1
Io
http://www.satishkashyap.com/
Io
M3
Vb
Vx
Vy
M1
Vref
http://www.satishkashyap.com/
http://www.satishkashyap.com/
M2
Vbiasp2
Vout
Vbiasn2
Vin
M1
Vbiasn1
Gnd
http://www.satishkashyap.com/
http://www.satishkashyap.com/
M2
Vbiasp2
Vout
Vbiasn2
Vin
M1
Vbiasn1
Gnd
http://www.satishkashyap.com/
Differential Amplifiers
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Some definitions
It is more convenient to represent the two input voltages and
the two output voltages by their mean and difference values.
vid
vicm
vod
vocm
vi1 vi2
vi1 + vi2
2
vo1 vo2
vo1 + vo2
http://www.satishkashyap.com/
For a good diff amp, the differential gain should be high and
independent of input common mode voltage, whereas the
common mode gain should be as low as possible. The
common mode rejection ratio is:
CMRR 20 log
Adiff
dB
Acm
http://www.satishkashyap.com/
http://www.satishkashyap.com/
vi 2
http://www.satishkashyap.com/
vi 2
Vs
Is
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Mp1
Mp2
i out
vi 1
Mn1
Mn2
Vs
Is
vi 2
http://www.satishkashyap.com/
Mp1
Mp2
i out
vi 1
Mn1
Mn2
Vs
vi 2
Is
http://www.satishkashyap.com/
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
http://www.satishkashyap.com/
v2
R1
C1
Output Stage
gm22 v2
v0
R2
C2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
op-amp Compensation
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Pole Splitting
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Differential Stage
Cc
Output Stage
v2
R1
gm11 v1
v0
C1
R2
C2
gm22 v2
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Miller Compensation
C
A2
A1
ro 1C
http://www.satishkashyap.com/
Slew rate
Miller compensation also sets the slew rate of the op amp.
For large signal input, the output current of the
Vdd
Mp3
Mp1
Mp2
OTA = tail current.
i out
vout
The effective load capacitance for this stage is
vi 1
Mn1 Mn2 vi 2
Vs
A2 C.
dV
Mn3
Vbias
Mn4
= I(Mn4)
A2 C
dt
Output of the OTA slews at a rate
I(Mn4)
A2 C .
I(Mn4)
C .
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Design Equations-I
All transistors must be saturated
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
I(Mn1) = I(Mn2) =
I(Mn1) = I(Mp1)
I(Mp1) = I(MP2)
I(Mn4)
2
(Series connection)
(Mirror)
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Design Equations-II
Mp3 has the same Vs , Vg as Mp1.
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
If
I(Mp3)
W /L(Mp3)
=
I(Mp1)
W /L(Mp1)
http://www.satishkashyap.com/
Design Equations-III
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
GBW =
Mn3
Mn4
gm (Mn2)
C
Since the current as well as gm of Mn1 and Mn2 are now known
p
gm (Mn2) =
2K W /L(Mn2)I(Mn2)
W /L(Mn1) = W /L(Mn2)
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Design Equations-IV
Currents through Mn2,Mp2, Mp3 and Mn3 are known
(go = Id /VA )
gm (Mn2)gm (Mp3)
(go (Mn2)||go (Mp2))(go (Mp3)||go (Mn3))
As gm for Mn2 and all go values are known, this determines the
gm for MP3.
Once we know the gm as well as the current for Mp3, we can
http://www.satishkashyap.com/
calculate its geometry.
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Example Design-1
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
20
106
= 40A
http://www.satishkashyap.com/
Example Design-2
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
gm (Mn2)
2 1012
http://www.satishkashyap.com/
Example Design-3
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
2
20
http://www.satishkashyap.com/
DC gain = 10000 =
http://www.satishkashyap.com/
Example Design-4
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
http://www.satishkashyap.com/
Example Design-5
Vdd
Mp1
Mp3
Mp2
i out
vi 1
Mn1
Vbias
Mn2
Vs
vi 2
vout
Mn3
Mn4
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Vdd
Vbiasp2
Vbiasp1
+
-
Vout
Vbiasn2
Vin +
Gnd
Vin -
Vbiasn1
http://www.satishkashyap.com/
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Folded Cascode
The common mode voltage incompatibility of a telescopic
cascode can be solved by using a folded cascode.
Vdd
Vbiasp1
Vbiasp2
Vin +
Vin -
Vout
Vbiasn2
Vbiasn1
Gnd
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Push-Pull Op Amp
Differential to single ended conversion can be done in the
output stage, by using a push-pull driver. The output loads in
the differential stage (Mp1 and Mp2) are diode connected.
Current through Mp2 is mirrored in
the output p transistor Mp4.
Vdd
Mp3
vi-
Mp1
Mp2
Mn1
Mn2
Mp4
vi+
Out
Vs
Mn3
Mn4
Vbias
Gnd
Mn5
http://www.satishkashyap.com/
Pipeline Optimization
Dinesh Sharma
Microelectronics Group, EE Department
IIT Bombay, Mumbai
2006
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
State
Data
Processing
Instructions
Data
Instruction
Processing
Instructions
Bus
Bottleneck!
Memory
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Harvard Architecture
http://www.satishkashyap.com/
State
Data
Processing
Instructions
Instruction
Processing
Data
Data
Memory
Instructions
Instruction
Memory
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
State
Data
Processing
Instructions
Instruction
Processing
MUX
Constants
Data
Memory
Read Only
Memory
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
State
Data
Processing
Instructions
Instruction
Processing
Cache
MUX
Constants
Data
Memory
Read Only
Memory
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
Address
From PC
Req. Instr.
Recv. Instr.
Recv State
From DP
Operand
Addr to DP
Decode,
Send to DP
Request
Operands
Receive
Oper. Addr
Receive
Instruction
Receive
Operands
Execute
Instruction
Store
Results
Return
State
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
A pipelined processor
http://www.satishkashyap.com/
Instruction Fetch
ROM
RAM
ROM address
ROM Address
ROM data
Instruction
RAM Address
RAM data
.
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
A pipelined processor
http://www.satishkashyap.com/
RAM
Constant
ROM Address
ROM data
RAM Address
RAM data
Data
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
A pipelined processor
http://www.satishkashyap.com/
Execution Phase
ROM
RAM
RAM Address
RAM data
Calculate result
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
A pipelined processor
http://www.satishkashyap.com/
Write Back
ROM
RAM
RAM Address
RAM data
Result
Calculate result
Store result (RAM)
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Resource Reservation
http://www.satishkashyap.com/
0
Instr Fetch
1
Const. fetch
Var. Fetch
3
Write Back
Compute
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Overlapping Operations
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
0
0
0
0
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
10
Pipelining
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
0
0
3
1
0
4
1
1
6
2
1
7
2
2
10
2
2
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Overlapping Operations
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
0
0
3
1
0
4
1
1
6
2
1
7
2
2
10
2
2
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Improved Scheduling
http://www.satishkashyap.com/
0
0
1
0
0
0
0
0
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Improved Scheduling
http://www.satishkashyap.com/
0
0
1
0
0
2
1
3
1
1
0
0
4
2
0
1
5
2
2
1
6
3
1
2
7
3
3
2
8
4
2
3
9
4
4
10
5
3
4
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Improved Scheduling
http://www.satishkashyap.com/
0
0
1
0
0
2
1
3
1
1
0
0
4
2
0
1
5
2
2
1
6
3
1
2
7
3
3
2
8
4
2
3
9
4
4
3
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
10
5
3
4
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Sampling Period
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
0
0
2
0
0
0
0
0
1
1
0
2
0
1
0
3
1
0
1
4
2
1
5
3
2
6
2
3
2
7
3
2
3
8
4
3
9
5
4
10
4
5
4
Pipeline Optimization
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
1
0
2
0
1
0
3
1
0
1
4
2
1
5
3
2
6
2
3
2
7
3
2
3
8
4
3
9
5
4
10
4
5
4
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Design Sets
http://www.satishkashyap.com/
D sets
{0}, {1} and {0,1}
{0}, {2}, {0,2}
{0}, {3}, {0,3}
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Row Vectors
http://www.satishkashyap.com/
0
0
1
0
0
3
0
In this example, the row vector for ROM is {0,1}, for RAM is
{1,3} and for ALU is {2}.
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
R
D
X
0
X
1
X
X
3
1,3,4,6
0,2,5,6
6
X
1,3,4,6
D
X
X
X X
1,3,6,7
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
1,3,6,7
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
1,3,4,6
X
X
1,3,6,8
1,3,6,7
http://www.satishkashyap.com/
Peridicity p = 2
Now if R(i) < D(i), add D(i) R(i) delays to all members of
R at position i and beyond.
1,3,4,6
1,2,5,6
1,3,4,6
1,4,7,8
Now align R
0
R
D
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
1,4,5,7
X
X
1,4,7,8
Alignment Example
http://www.satishkashyap.com/
0
R
D
R
1
X
X
X
1
X
X
X
X
3
X
4
X
X
X
2
3
X
4
X
5
X
X
5
X
X
X
6
X
X
X
X
6
X
X
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Alignment Example
http://www.satishkashyap.com/
D
R
R
D
D
R
1
X
X
X
4
X
X
X
7
X
X
X
8
X
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Example System
http://www.satishkashyap.com/
0
0
1
0
0
0
0
Since the ROM and the RAM are used for 2 cycles each in
every operation, MASP = 2.
However, as we had seen before, ASP = 3 in this case.
Therefore, the schedule needs improvement.
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Example Application
http://www.satishkashyap.com/
Aligning the ROM
ROM
RAM
ALU
0
0
1
0
0
3
0
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
ALU Schedule
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
0
0
1
0
0
2
1
3
1
1
4
2
0
1
5
2
2
6
3
1
2
7
3
3
8
4
2
3
9
4
4
10
5
3
4
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
0
0
1
0
0
2
1
0
3
1
1
0
4
2
0
1
5
2
2
1
6
3
1
2
7
3
3
2
8
4
2
3
9
4
4
3
10
5
3
4
One can trade off power for speed when designing the
ALU.
By using optimization techniques, we are able to reach a
higher throughput, even with a slower ALU!
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
0
0
3
0
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
2
0
3
0
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Time Ordering
http://www.satishkashyap.com/
ROM
RAM
ALU
0
0
1
1
0
2
0
1
0
3
1
0
1
4
2
1
5
3
2
6
2
3
2
7
3
2
3
8
4
3
9
5
4
10
4
5
4
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
Conclusions
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
Pipeline Optimization
http://www.satishkashyap.com/
AN Introduction to VHDL
Overview
Dinesh Sharma
Microelectronics Group, EE Department
IIT Bombay, Mumbai
August 2008
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Part I
VHDL Design Units
1
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
An introduction to VHDL
VHDL is a hardware description language which uses the
syntax of ADA. Like any hardware description language, it is
used for many purposes.
For describing hardware.
As a modeling language.
For simulation of hardware.
For early performance estimation of system architecture.
For synthesis of hardware.
For fault simulation, test and verification of designs.
etc.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
ENTITY DECLARATION
The declaration of an ENTITY describes the signals which
connect this hardware to the outside. These are called port
signals. It also provides optional values of manifest constants.
These are called generics.
VHDL 93
VHDL 87
entity name is
generic(list);
port(list);
end entity name;
entity name is
generic(list);
port(list);
end name;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
ENTITY EXAMPLE
VHDL 87
VHDL 93
entity flipflop is
generic (Tprop:delay length);
port (clk, d: in bit; q: out bit);
end entity flipflop;
entity flipflop
generic (Tprop: delay length);
port (clk, d: in bit; q: out bit);
end flipflop;
The entity declares port signals, their directions and data types.
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
ARCHITECTURE Syntax
VHDL 93
VHDL 87
The architecture inherits the port signals from its entity. It must
declare its internal signals. Concurrent statements constituting
the architecture can be placed in any order.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
ARCHITECTURE Example
VHDL 93
VHDL 87
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
Component Example
VHDL 93
VHDL 87
component name is
generic(list);
port(list);
end component name;
EXAMPLE:
component flipflop is
generic (Tprop:delay length);
port (clk, d: in bit; q: out bit);
end component flipflop;
component name
generic(list);
port(list);
end component;
EXAMPLE:
component flipflop
generic (Tprop: delay length);
port (clk, d: in bit; q: out bit);
end component;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
VHDL
entity
Architecture
Component
Configuration
Packages and Libraries
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
VHDL
http://www.satishkashyap.com/
Data Types
Scalar
Discrete
Access
Floating Pt.
Integer
real
enumeration
Severity Level
File
unconstrained
array
Physical
time
Composite
constrained
array
bit_vector
string
bit
character
boolean
file_open_kind
file_open_status
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Enumeration Type
VHDL enumeration types allow us to define a set of values that
a variable of this type can acquire. For example, we can define
a data type by the following declaration:
type instr is (add, sub, adc, sbb, rotl, rotr);
Now a variable or a signal defined to be of type instr can only
be assigned values enumerated above that is: add, sub, adc,
sbb, rotl and rotr.
In actual implementation, these values may may be mapped to
a 3 bit value. However, an attempt to assign, say, 010 to a
variable of type instr will result in an error. Only the enumerated
values can behttp://www.satishkashyap.com/
assigned to a variable of this type.
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Physical Types
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Arrays
Arrays can be constrained or unconstrained.
In constrained arrays, the type definition itself places
bounds on index values. For example:
type byte is array (7 downto 0) of bit;
type rotmatrix is array (1 to 3, 1 to 3) of real;
In unconstrained arrays, no bounds are placed on index
values. Bounds are established at the time of declaration.
type bus is array (natural range <>) of bit;
The declaration could be:
signal addr bus: bus(15 downto 0);
http://www.satishkashyap.com/
signal data
bus: bus(7 downto 0);
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Records
While an array is a collection of the same type of objects,
a record can hold components of different types and sizes.
This is like a struct in C.
The syntax of a record declaration contains
a semicolon separated list of fields, each field having the format
name, . . ., name : subtype
For example:
type resource is record
(P reg, Q reg : bit vector(7 downto 0); Enable: bit)
end record resource;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
http://www.satishkashyap.com/
Part II
Structural Description in VHDL
3
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Structural Style
Structural style describes a design in terms of components and
their interconnections.
Each component declares its ports and the type and direction
of signals that it expects through them
How can we describe interconnections between components?
s7
p1
p5
In
p2
U1p3
p6
p4
s1
s2
p1
p6
p2
U2
p3
p4
s3
s4
p5
Out
s5
s6
s3
p1
p5
p2
U3
p3
p4
p6
http://www.satishkashyap.com/
s4
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Describing Interconnect
s7
p1
p5
In
p2
U1p3
p6
p4
s1
s2
s3
s4
p1
p6
p2
U2
p3
p4
p5
Out
s5
s6
s3
p1
p5
p2
U3
p3
p4
p6
s4
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Structural Architecture
A purely structural architecture for an entity will consist of
1
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Component Declarations
VHDL 93
VHDL 87
component name is
generic(list);
port(list);
end component name;
EXAMPLE:
component flipflop is
generic (Tprop:delay length);
port (clk, d: in bit; q: out bit);
end component flipflop;
component name
generic(list);
port(list);
end component;
EXAMPLE:
component flipflop
generic (Tprop: delay length);
port (clk, d: in bit; q: out bit);
end component;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Component Instantiation
VHDL-93: Direct Instantiation
VHDL-93 allows direct instantiation of
ENTITY ARCHITECTURE pairs without having to go through
a component type declaration first.
Instance-name: entity entity-name (architecture-name)
generic map(list)
port map(list);
This form is convenient, but does not have the flexibility of
associating alternative ENTITY ARCHITECTURE pairs with
a component.
http://www.satishkashyap.com/
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Component Instantiation
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Component Instantiation
VHDL-87
The keyword component is not used in VHDL-87. This is
because direct instantiations are not allowed and therefore the
binding is always to a component.
Instance-name: component-type-name
generic map(list)
port map(list);
The association is with a previously declared component type.
The type will be bound to an ENTITY ARCHITECTURE pair
http://www.satishkashyap.com/
using an inline configuration statement or construct.
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Inline Configuration
The association between component types and
ENTITYARCHITECTURE pairs can be made inline with a
use clause.
for all: component-name
use entity entity-name(architecture-name);
Instead of saying for all, we can specify a list of selected
instances of this component type to which this binding will
apply.
instance-name-list: component-name
use entity entity-name(architecture-name);
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Hierarchical Configuration
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Hierarchical Configuration
VHDL contains fairly complex configuration statements. A
simplified construct is introduced here:
configuration config-name of entity-name is
for architecture-name
for component-instance-namelist: component-type-name
use entity entity-name(architecture-name);
end for
end for
end configuration config-name;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
A
A
B
A+B
A+B
A+B
B
A+B
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Definition of NAND
Entity nand2 is
port (in1, in2: in bit; p: out bit);
end entity nand2;
We do not use any generic for this
simple example.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
A
A
N1
B
s1
N2
A+B
s2
A+B
s1
USE WORK.ALL
Entity xor is
port(a,b: in bit; axb: out bit);
End Entity xor;
s3
s1
N3
A+B
N4
axb
A+B
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
A
A
N1
B
s1
N2
A+B
s2
A+B
s1
s3
s1
N3
A+B
N4
axb
A+B
begin
N1: component NAND2in
portmap(a, b, s1);
N2: component NAND2in
portmap(a, s1, s2);
N3: component NAND2in
portmap(b, s1, s3);
N4: component NAND2in
portmap(s2, s3, axb);
end Architecture simple;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
Repetition Grammar
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
GENERATE Statement
The generate statement contains a for loop which takes effect
during the circuit elaboration step. This can be used to repeat
instantiation constructs. We illustrate this statement with an
example:
groupname: for index in 0 to width-1 generate
begin
some-name: component outbuf
portmap (...);
end generate groupname;
The defined index in the for construct has local scope and can
be used to pick
specific signals from an array in portmap
http://www.satishkashyap.com/
statements.
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
C_out
Entity FullAdder is
Full
Adder sum Port(a,b, C in: in bit; sum, C out: out bit);
End Entity FullAdder;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
C_out
Entity FullAdder is
Full
Adder sum Port(a,b, C in: in bit; sum, C out: out bit);
End Entity FullAdder;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
C_out
Entity FullAdder is
Full
Adder sum Port(a,b, C in: in bit; sum, C out: out bit);
End Entity FullAdder;
VHDL
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
Structural Description
http://www.satishkashyap.com/
sum
s2
s
HA2
i1
i2 cy cy2
C_in
s s1
HA1
i1
cy cy1
i2
cy
i1
C_out
combn
i2
Dinesh Sharma
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
i1
i2
VHDL
Structural Description
Component Declarations
Component Instantiation
Configuration
Repetition Grammar
http://www.satishkashyap.com/
C_in
s1
HA1
i1
cybar c1b
i2
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
Part III
Behavioural Description Using VHDL
4
Behavioural Description
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Behavioural Style
Behavioural style describes a design in terms of its behaviour,
and not in terms of a netlist of components.
We describe behaviour through if-then-else type of constructs,
loops, sequential and concurrent assignment statements.
Statements like if-then-else are inherently sequential. These
must therefore occur only inside sequential bodies like
processes.
A concurrent assignment statement may be considered as a
shorthand for a very simple process.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Specifying a waveform
A waveform is described by a comma separated list of values
and optionally, delays. For example, we may assign a waveform
by a statement like
indata <= 0, 1 AFTER 20 NS, 0 AFTER 50 NS;
The values at different times are treated as transport delays
and are all inserted in the time ordered queue without wiping
out earlier values.
(This is the only context where delays are transport by default).
Single value assignments use inertial delay by default.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Concurrent Assignment
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Concurrent Assignment
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Assignment to an aggregate
Assignments can be made to a collection of signals
simultaneously. For example let vec be defined as bit vector(2
downto 0)
vec <= (000) - - 000 : string
vec <= (0,0,1) - - 001 : positional
vec <= (1=>1, others => 0) - - 010 : named, partial
vec <= (1, others => 0) - - 100 : positional, partial
vec <= (2|0 => 1 , others => 0) - - 101 : partial
vec <= (others => 1) - - 111
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
VHDL Operators
Logical operators: AND, OR, NAND, NOR, OR, XNOR and
NOT
For example x <= a xor b;
Relational operators: =, /, <, <=, >, >=
= and = operate on any type. Others operate on arithmetic
types: (integers, reals etc.). All of these return a boolean
value.
Shift operators: SLL (logical left), SLA (arithmetic left) SRL
(logical right), SRA (Arithmetic right), ROL rotate left and
ROR (rotate right).
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Processes
Sequential constructs need to be placed inside a process. A
process uses the syntax:
[ process-label: ] process [(sensitivity-list)] [is]
[declarations]
begin
[sequential statements]
end process [process-label];
Sequential statements include if constructs, case statements,
looping constructs, assertions, wait statements etc.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Wait statements
A process without a sensitivity list requires explicit suspend
statements. These are provided by wait statements. These can
be of the form:
wait for waiting-time;
wait on signal-list;
wait until waiting-condition;
wait for 0 some-time-unit;
wait;
wait for 0 ns causes the process to suspend till the next delta.
The last form (bare wait statement) suspends the process for
ever.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Dynamic sensitivity
Processes without a sensitivity list and multiple wait statements
have a dynamic sensitivity. This is because these processes
are sensitive to different events at different times.
One cannot mix static and and dynamic sensitivity
Thus, a process with a sensitivity list cannot use wait
statements.
This is because once the process is suspended, it is possible to
have an event on a signal in the sensitivity list simultaneously
with the condition for resumption after wait being fulfilled.
This would leave the process undecided on where to resume
from.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
IF statements
if statements are similar to their counterparts in programming
languages. The syntax is:
[ if-label: ] if Boolean-expression then
sequential statements
[ elsif Boolean-expression then
sequential statements ]
[ elsif ... ]
[ else sequential statements ]
end if [ if-label ];
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
CASE statements
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
CASE Choices
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Loop Statements
There are several different forms of the loop statement. The
simplest is the endless loop:
[ loop-label: ] loop
[ loop-label: ] loop
sequential statements
end loop [ loop-label ];
This constitutes an endless loop.
It is assumed that it will have an exit statement or a wait
statement inside to suspend operation.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Exiting a Loop
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
NEXT Statement
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
WHILE Loops
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
For Loops
VHDL also provides a for loop.
[ loop-label: ]
for identifier in discrete-range loop
sequential statements
end loop [ loop-label ];
The discrete range can be of the form
expression to | downto expression
The identifier is initialized to the left limit of the range and takes
on successive values in the discrete range till it exceeds the
right limit.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Severity values
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Concurrent Statements
VHDL Operators
Processes
Sequential Statements
http://www.satishkashyap.com/
Assertions defaults
[ label: ] assert Boolean expression
[ report expression ] [ severity expression ];
If the optional report clause is missing in the assert statement,
the default report message is Assertion Violation.
If the severity clause is omitted, the default value is error.
Most simulators allow the user to set a severity threshold,
beyond which the simulation is aborted on an assertion
violation. It is common to continue on note and warning and to
abort on error and failure.
In VHDL-93, the report clause can be used by itself as a
statement to http://www.satishkashyap.com/
output useful messages.
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
Subprograms in VHDL
VHDL has two types of subprograms: Functions and
Procedures.
FUNCTIONS are used to return a single value from a given list
of input parameters. These occur in expression on
the right hand side of VHDL statements. Functions
execute in zero simulation time.
PROCEDURES can return multiple values and need not
execute in zero simulation time. The parameters
have their type as well as direction defined in the
parameter list. These are invoked like a VHDL
statement.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
FUNCTIONS
Functions can be PURE or IMPURE.
A PURE function returns the same value every time it is called
with the same value of input parameters. Most functions are
PURE.
An IMPURE function can return different values for calls with
the same parameter values.
For example, the function NOW, which returns the current
simulation time.
RANDOM is also an IMPURE function.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
Functions
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
Function Example
TYPE Byte IS ARRAY(7 DOWNTO 0) OF BIT;
FUNCTION ByteVal(InByte: Byte) RETURN Integer IS
Variable RetVal: Integer := 0;
BEGIN
FOR I IN 7 DOWNTO 0 LOOP
RetVal = 2 * RetVal;
IF (InByte = 1) THEN RetVal := RetVAl + 1;
END IF;
END LOOP;
RETURN RetVal;
END FUNCTION ByteVal;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
Procedures
Declaration:
PROCEDURE name (parameter list) IS
. . . Local declarations . . .
BEGIN
Sequential Statements;
...;
END [PROCEDURE] name;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Attributes
VHDL provides built in functions which return usefult attributes
of the objects that they operate on.
Attribute functions may provide attributes of
Arrays
Types
Signals
Entities
Attributes are invoked as nameattrib name.
The single quote is read as tick
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Array Attributes
Array attributes interrogate the property of arrays. Consider the
declaration:
TYPE regfile IS ARRAY(0 To 3, 7 Downto 0) OF BIT;
Then we can use the following attributes:
LEFT :
RANGE:
regfileLEFT(2) = 7
regfileRANGE(1)= 0 TO 3
RIGHT:
REVERSE RANGE:
regfileRIGHT(1) = 3
regfileREVERSE RANGE(1) = 3
HIGH:
DOWNTO 0
LENGTH: regfileLENGTH(1) = 4
regfileHIGH(2) = 7
ASCENDING:
LOW:
regfileASCENDING(1) = TRUE
regfileLOW(1) = 0http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Type Attributes
Type attributes apply only to scalar types. Consider the
declarations:
TYPE nineval IS(U, X, 0, 1, Z, L, H, W, -)
SUBTYPE fourval IS nineval RANGE X to Z
Then, fourvalBASE = nineval
Attributes LEFT, RIGHT, HIGH and LOW are defined for TYPES
also. When applied to a TYPE, these return the corresponding
values as defined for the type. For example,
ninevalLEFT = U, fourvalLEFT = X
POSITIVELOW = 1
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Signal Attributes
Name
DELAYED
STABLE
EVENT
QUIET
TRANSACTION
DRIVING
DRIVING VALUE
Example
sDELAYED
sSTABLE(5ns)
sEVENT
sQUIET(3ns)
sTRANSACTION
sDRIVING
sDRIVING VALUE
Return type
Signal
Signal
Value
Signal
Signal
Value
Value
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Value type
same as s
Boolean
Boolean
Boolean
BIT
Boolean
same as s
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
Case of RS Latch
Entity RS Latch is
Port(R,S: IN BIT; Q, Qbar: OUT BIT);
R
End Entity RS Latch;
Architecture trouble of RS Latch is
Begin
Q <= R NOR Qbar;
Q
S
Qbar <= S NOR Q;
End Architecture trouble;
This will run into trouble as Q and Qbar are declared to be
outputs and cannot be used on the RHS expression of an
assignment.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Behavioural Description
Subprograms
Attributes
Array attributes
Type Attributes
Signal attributes
http://www.satishkashyap.com/
RS Latch
Q
R
VHDL
http://www.satishkashyap.com/
Part IV
The IEEE Package Std Logic 1164
7
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
9 Valued Logic
The stdlogic package uses 9 valued logic.
The basic unresolved signal type is declared as:
TYPE std ulogic IS (U,X,0,1,Z,W,L,H,-);
Here U is uninitialized,
X is forcing unknown, W is weak unknown,
L and H are weak 0 and 1,
Z is high impedance and - is dont care.
This type combines signal values and drive strengths,
permitting modeling of open drain and wired or circuits. Other
types are derived from this basic signal type.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Derived types
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
Other Types
The IEEE package 1164 also defines the following subtypes of
std ulogic.
1
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
U
U
U
U
U
U
U
U
U
U
X
U
X
X
X
X
X
X
X
X
0
U
X
0
X
0
0
0
0
X
1
U
X
X
1
1
1
1
1
X
Z
U
X
0
1
Z
W
L
H
X
W
U
X
0
1
W
W
W
W
X
L
U
X
0
1
L
W
L
W
X
H
U
X
0
1
H
W
W
H
X
U
X
X
X
X
X
X
X
X
The resolution
function receives a vector of driving values of
http://www.satishkashyap.com/
type std ulogic. The return is type std ulogic!
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
VHDL
http://www.satishkashyap.com/
U
U
X
X
0
1
NOT
1 Z
0 X
W
X
L
1
H
0
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
VHDL
http://www.satishkashyap.com/
Conversion Functions
The following type conversion functions are included in
package 1164:
These include To bit (from std ulogic) and To std ulogic
(from bit)
To bit vector (from std ulogic vector and std ulogic vector)
To std ulogic vector (from bit vector) and
To std logic vector (from bit vector)
To std logic vector (from std ulogic vector) and
To std ulogic vector (from std logic vector)
There are similar functions for inter-conversions between
X01, X01Z
etc. and std logic and std ulogic.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
http://www.satishkashyap.com/
VHDL
A magnitude comparator
http://www.satishkashyap.com/
Part V
An Example Design
9
A magnitude comparator
First Level Description
Constructing the Byte Comparator
Structural Description of Bit Comparator
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
A Magnitude Comparator
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
A magnitude comparator
We want to design a circuit to compare the magnitude of
two binary numbers.
We shall illustrate the design by a comparator for byte wide
numbers.
However, the design should be stackable, so that wider
numbers can be compared.
The input to the system are the two numbers and stacking
inputs, gt in, eq in and lt in.
The outputs are the result of comparison: gt out, eq out
and lt out.
The stacking inputs and outputs use one hot coding:
exactly one
of the conditions gt, eq or lt is TRUE at a given
http://www.satishkashyap.com/
time.
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
Library IEEE;
USE IEEE.std logic 1164.ALL;
TYPE Byte IS Array (7 DownTo 0) OF std ulogic;
Entity Byte Compar is
Port(a, b: IN BYTE;
gt in, eq in, lt in: IN std ulogic;
gt out, eq out, lt out: OUT std ulogic);
End Entity Byte Compar;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
A magnitude comparator
http://www.satishkashyap.com/
B0 A1
B1 A2
B2 A3
B3 A4
B4 A5
B5 A6
B6 A7
B7
>
=
<
>
=
<
BitPart
BitPart
BitPart
BitPart
BitPart
BitPart
BitPart
BitPart
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
Last: IF I = 7 GENERATE
COMPONENT BitPart
PORTMAP
(Connect(1, I-1), Connect(2,I-1), Connect(3,I-1));
a(I), b(I),
gt out, eq out, lt out)
END GENERATE;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
0
0
1
1
ab
lt in
0
1
lt out
00 01
This gives:
11
10
gt out = a b + gt in (a + b)
lt out = a b + lt in (a + b)
eq out = eq in (a b + a b)
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
lt_in
b
lt_out
a
a+b
a
b
eq_out
a+b
gt_out
gt_in
eq_in
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
VHDL
A magnitude comparator
http://www.satishkashyap.com/
A magnitude comparator
http://www.satishkashyap.com/
Inline configuration
The configuration of a component can be declared inline in an
architecture.
Architecture compose of Byte Compar IS
COMPONENT BitPart IS
Port(a, b: IN std ulogic;
gt in, eq in, lt in: IN std ulogic;
gt out, eq out, lt out: OUT std ulogic);
END COMPONENT BitPart;
FOR ALL: BitPart
USE ENTITY Bit Compar(behave);
TYPE Connect IS ARRAY (1 TO 3, 0 TO 6) OF std ulogic);
Signal Cascade: Connect;
http://www.satishkashyap.com/
A magnitude comparator
http://www.satishkashyap.com/
Standalone configuration
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
Hierarchical configuration
The architecture being configured may contains
components which are bound to architectures containing
other components.
This requires hierarchical configuration.
Instead of binding component instances to
entity-architecture pairs directly, we bind these to other
configurations.
These other configurations associate the component with
an entity-architecture pair and cofigure the lower level
components.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
Hierarchical configuration
The syntax used for hierarchical configuration is:
CONFIGURATION configname OF entityname IS
FOR architecture name
FOR instance name | OTHERS | ALL : component name
USE CONFIGURATION subconfig name;
...
END FOR;
END FOR;
END [CONFIGURATION] [configname];
Subconfig name will associate the component with an
entity-architecture pair and will configure lower level
http://www.satishkashyap.com/
components in the hierarchy.
Dinesh Sharma
VHDL
A magnitude comparator
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
http://www.satishkashyap.com/
Part VI
File I-O in VHDL
10 Files in VHDL
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
11 The Textio Package
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
Files in VHDL
To VHDL, a file is a collection of information of a type that is
known to it.
File I-O presents a special problem, because conventions
for naming files and directories are different for different
Operating Systems.
We would like to insulate hardware descriptions from this
variation.
We do it by making a distinction between file names used
by VHDL and the operating system dependent filename
which is associated with it.
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
FILE Types
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
Examples
TYPE datafile IS FILE OF CHARACTER;
This specifies that any file which has the type datafile will
contain characters and each read will return a character while
each write will accept a character to be written to the file.
Once a file type has been declared, we may declare one or
more files of this type. For example,
FILE vfile1: datafile;
FILE vfile2: datafile IS indata.dat
FILE vfile3: datafile OPEN WRITE MODE is output.dat;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
Library IEEE;
USE IEEE.std logic 1164.ALL;
ENTITY ROM Block IS
GENERIC(size: NATURAL, content file: STRING)
PORT(Chip sel: IN std logic;
rdbar: IN std logic;
Addr: IN std logic vector;
Data: IN std logic vector);
END ENTITY ROM Block;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
ROM Initialization
ARCHITECTURE From File OF ROM Block IS
SUBTYPE Word IS
std logic vector(DataLength-1 DOWNTO 0);
TYPE Mem Array IS
ARRAY(NATURAL RANGE 0 TO 2**size -1) of Word;
VARIABLE Mem Contents: Mem Array;
VARIABLE Index: Natural;
...
TYPE RomData File IS FILE of WORD;
FILE Rom Contents : RomData FILE
OPEN Read Mode IS content file;
...
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
File Declarations
Opening and Closing Files
Reading and writing
Example of File usage
http://www.satishkashyap.com/
ROM Initialization
BEGIN
Filling: Process IS
BEGIN
Index := 0;
WHILE NOT EndFile(ROM Contents) LOOP
READ(ROM Contents, Mem Contents(Index);
Index:= Index+1;
END LOOP;
WAIT;
END PROCESS Filling;
...
- - process to handle rdbar
END ARCHITECTURE
From File;
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
http://www.satishkashyap.com/
http://www.satishkashyap.com/
Dinesh Sharma
VHDL
Files in VHDL
The Textio Package
http://www.satishkashyap.com/
VHDL