Sem Notes
Sem Notes
Spring 2020
EECS 16B Notes @ 2020-02-27 20:35:52-08:00
Contents
Contents ii
2 Transistor Circuits 5
2.1 m o s f e t behavior at a low level . . . . . . . . . . . . . . . . . . . 5
2.2 An n m o s inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 A c m o s inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 A c m o s inverter chain with capacitance . . . . . . . . . . . . . . 10
3 Transient Analysis 15
3.1 RC transient in an inverter chain . . . . . . . . . . . . . . . . . . 15
3.2 Uniqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
ii
EECS 16B Spring 2020 EECS 16B Notes
List of Figures
iii
L i st o f F i g u r e s
iv
EECS 16B Spring 2020 EECS 16B Notes
Lecture 1
Understand how current and voltage are annotated on a circuit. Our terms
are “voltage across branch element X” and “current through branch element
X.” The phrases “voltage through. . . ” or “current across. . . ” do not make sense.
Understand, as shown in Fig. 1.1, that the reference directions for voltage
1
1. 16A review and prerequisites
and current are such that power absorbed by a circuit element is given by the
formula vi.
Voltage source
As shown in Fig. 1.3, a voltage source will provide any current (or none at all)
to maintain its target voltage.
Current source
As shown in Fig. 1.4, a current source will provide any voltage (or none at all)
to maintain its target current.
2
1.3. Linear algebra
Circuit-solving techniques
Be familiar with the following methods for solving circuits:
3
EECS 16B Spring 2020 EECS 16B Notes
Lecture 2
Transistor Circuits
• parameterized by vGS vG − vS .
5
2 . T r a n s i sto r C i rc u i t s
6
2.1. m o s f e t behavior at a low level
one right. The left region is called region 1; the right region is called
region 2.
• Focus on region 1, which is called the Linear Region. Notice that in region
1 near the origin, ID and vDS are proportional for every value of vGS . The
slope G ID /vDS increases for higher values of vGS . This means that
the D-S resistance R G −1 transitions from ∞ to a finite (perhaps small)
value as v GS increases past v t,n . A resistor that can alternate between
finite and infinite resistance is called a switch: in the Linear Region the
transistor is a voltage-controlled switch.
• Focus on region 2, which is called Saturation, Here the ID increases only
very weakly as vDS increases.For a given VDS , ID increases with increasing
vGS : the transistor behaves approximately as a voltage-controlled current
source!
These characteristics are summarized in Figure 2.4. Regions 0 and 1 can be used
to implement a switch. Region 2 is used for analog electronics—dependent
sources, amplifiers, etc.
7
2 . T r a n s i sto r C i rc u i t s
8
2.3. A c m o s inverter
vin vout
0 VDD
VDD 0
Analysis
• (Case v in 0) The transistor, as a switch, is off. As a result, the terminal
vout is connected directly to VDD by a resistor. Because no current flows
into the voltage terminal, by Ohm’s law there can be no voltage drop
across the resistor. Therefore vout VDD .
• (Case vin VDD ) The transistor, as a switch, is on. The terminal vout has a
short to ground, so v out 0.
Figure 2.8 shows the truth table of this circuit and verifies that this circuit is
indeed an inverter.
Power consumption
When vin 0, the circuit consumes no power, as we have established that there
is no current through the resistor between VDD and vout . When v in VDD , there
is a path from VDD through the resistor, then the transistor, to ground. The
circuit consumes power V I VDD 2
/R. While this might not necessarily be a lot,
in computing applications with countless transistors, it adds up, and moving
heat away from a dense circuit poses engineering challenges. Dense digital
circuits were made possible by the discovery of the CMOS inverter architecture,
which avoids a path from VDD to ground.
Analysis
• (Case vin VDD )
– The p m o s having as its source VDD and vout as its drain VGS,1 0,
which is higher than Vt,p . Therefore there is no path from VDD to
vout .
– The n m o s having vout as its drain and ground as its source has
VGS,2 VDD , which is higher than Vt,n . Therefore, due to the
terminal’s short to ground, vout 0.
9
2 . T r a n s i sto r C i rc u i t s
The equivalent circuit once the switch model has been applied is shown
in Figure 2.10.
• (Case vin 0)
– The p m o s, having VGS,1 −VDD < Vt,p , turns on.
– The n m o s, having VGS,2 0 < Vt,n , turns off.
Therefore Vout VDD .
Power consumption
All currents are zero in this model, so no power is consumed.
10
2.4. A c m o s inverter chain with capacitance
Figure 2.12: An inverter taken from a chain with a capacitor modeling the next
stage.
although this model won’t teach you how to build a computer, it is close enough
to real c m o s networks to illustrate when and where power is expended.
11
2 . T r a n s i sto r C i rc u i t s
12
2.4. A c m o s inverter chain with capacitance
from VDD to 0 (Figure 2.15). That means that the load capacitor must discharge
fully, burning 21 CVDD
2
of potential energy as heat.
charge at VDD energy per unit charge. Where does this go? Let’s follow the
energy as the output changes from 0 to 1 and back to 0.
1. (q C 0, v C 0)
2. Voltage source loads CVDD of charge at VDD energy per unit charge, at a
2
total expense of CVDD . Half of its energy output is burned by “parasitic”
resistance en route to the capacitor, and the other half is stored in the
capacitor.
3. (q C CVDD , v C VDD )
4. Transistors toggle, and the capacitor drains, generating 12 CVDD
2
of heat on
the pull-down circuit.
5. (q C 0, v C 0)
• If the inverter flips every cycle at a clock speed of f s , the circuit will burn
2
f s CVDD charging its capacitors.
• Leakage: a transistor that’s “off” isn’t 100% off, and a small amount of
current flows and burns some energy.
• Short-circuit current (smaller): when the input is flipping between 0 and
1, there’s a very short instant during which both transistors may be on,
and some current flows through the momentary VDD -ground short.
13
EECS 16B Spring 2020 EECS 16B Notes
Lecture 3
Transient Analysis
15
3 . T r a n s i e n t A na lys i s
• vo1 is the output of the first inverter (and the input to the second), and
The digital logic interpretation is that vo2 is the double negation of vin , that is,
vo2 vin .
We will study what happens when vin is driven by the input depicted in
Figure 3.5. It will begin having remained at 0 for a long time, change to vDD
at time t1 , then return to 0 at time t2 > t1 . Figure 3.6 shows the actions of the
switches of the first inverter’s transistors at times t1 and t2 . For the rest of this
section, we’ll just concentrate on what happens to v o1 .
16
3.1. RC transient in an inverter chain
Figure 3.6: Analog redrawing of Figure 3.4, showing switch actions of the first
inverter, as well as a distinguished node.
Before t1
As v in 0 well before t1 , we can assume that the circuit has settled, and the
output of the first inverter is vDD .
After t1 , before t2
At t1 , the pull-up switch opens, and the pull-down switch closes. KCL applied
to the distinguished (red) middle node of Figure 3.6 requires the outgoing
currents to sum to zero. Using Ohm’s Law once and the capacitor current-
voltage relationship twice, we have the following equation:
v o1 d d
+ CN v o1 + C P v o1 − v DD 0
(3.1)
RN dt dt
d 1
vo + vo 0 (3.2)
dt 1 R N (C N + C P ) 1
τ R N (C N + C P ) (3.3)
17
3 . T r a n s i e n t A na lys i s
d 1
v o1 − v o1 (3.4)
dt τ
d
vo λvo1 (3.5)
dt 1
constant that remains to be determined, is all that you will need to know about
this variety of differential equation:
(As an aside, you can verify that vo1 (t) Ae λt is a solution— differentiating
both sides with respect to t results in ddt vo1 (t) Aλe λt λ(Ae λt ).) Our next
goal is to determine A. We can do so by choosing A to meet the initial condition
vo1 (t1 ) VDD . Substituting v o1 (t) Ae λt ,
Figure 3.7 is a sketch of vin and vo1 after t1 and before t2 . Notice that v o1
doesn’t immediately jump to 0 like the digital model assumes. Rather, v o1
decays exponentially toward 0 at a rate predicted by τ. Discharging a capacitor
takes time, and digital devices’ clock speed is limited by how quickly binary
values settle in between logic gates.
After t2
We will try to write a differential equation describing the evolution of vo1 at
time t2 and beyond. Figure 3.6 shows that at time t2 , the pull-up switch closes,
and the pull-down switch opens. KCL applied to the same central node yields
18
3.2. Uniqueness
vo1 − VDD d
+ (C P + C N ) vo 0 (3.11)
RP dt 1
d 1 v DD
vo + vo (3.12)
dt 1 R P (C P + C N ) 1 R P (C P + C N )
The previous solution for vo1 , which is valid up until time t2 , may be evaluated
at t2 for a boundary condition valid past t2 :
t2 −t1
−
vo1 (t2 ) VDD e τ
(3.13)
where τP R P (C P + C N ).
3.2 Uniqueness
We solved a differential equation. Differential equations are universal and
ubiquitous in science and engineering.
A theorem states that a large class of differential equations with boundary
conditions have unique solutions. These differential equations are of the form
d
x f (x, t), x(0) x0 , (3.15)
dt
where
19
3 . T r a n s i e n t A na lys i s
∂ f
1. for all values of t, f (x, t) is differentiable with respect to x and ∂x (x, t) <
M for some nonnegative real number M; and
2. for all values of x, f (x, t) has a finite number of discontinuities in t in any
unit interval [t0 , t0 + 1].
If these conditions hold, then our differential equation has a unique solution.
Note that these conditions are in fact quite loose, and are more than
enough to certify that unique solutions exist to differential equations of the
form ddt x f (x) λx. It is important that we have proofs of existence and
uniqueness because methods such as Separation of Variables are not inherently
rigorous. Only once we have verifed that a proposed solution satisfies the
differential equation and boundary condition may we claim that it is a solution.
Because these problems have unique solutions, we may be certain that the
model we are using is physically deterministic—it tells precisely what must
happen, not just what may happen.
20
EECS 16B Spring 2020 EECS 16B Notes
Lecture 4
signals.
21
4 . D i f f e r e n t i a l e q uat i o n s w i t h i n p u t s
While it seems that this form is arbitrary, it will prove insightful, because e st is
an eigenfunction for input-output behavior of this circuit, i.e. we expect
v o (t) Vo e st . (4.3)
We can determine Vo by substituting our parameterization of v o into Equa-
tion 4.1, whose LHS. . .
d d
v o (t) Vo e st (4.4)
dt dt
sVo e st (4.5)
. . . is equated with the RHS:
1 1
sVo e st − Vo e st + Vin e st . (4.6)
RC RC
Now we can isolate Vo .
1 1
sV0 + Vo Vin (4.7)
RC RC !
1 1
Vo Vin (4.8)
RC s + RC
1
Substituting λ − RC
1
,
1
Vo s Vin (4.9)
1− λ
22
4.2. General scalar differential equation
v o | t0 v 1 (4.11)
where v homogeneous (t) corresponds to the initial condition, and v particular (t) to
the input term.
(4.16)
We can check the initial condition x(t0 ) x0 : the former term evaluates to
x0 and the latter to 0. Next, we can verify that ddt x(t) λx(t) + u(t) holds by
differentiating.
∫ t
d
x(t) λe λ(t−t0 ) + u(t) + λe λ(t−τ)
u(τ) dτ (4.19)
dt t0
The two terms in curly braces sum to λx(t), so Equation 4.17 is satisfied.
23
EECS 16B Spring 2020 EECS 16B Notes
Lecture 5
We can solve for vout by guessing that the particular solution—-the summand
that corresponds to vin —has the form A cos ωt + φ . The second summand of
vout is the homogeneous solution, which corresponds to the initial condition. It
1
has the form Be − RC (t−t0 ) .
1
vout (t) A cos ωt + φ + Be − RC (t−t0 )
(5.3)
Substitution into the differential equation and initial conditions result in the
following constants:
Vin
A q (5.4)
ω2 (RC)2 + 1
φ − tan−1 (ωRC) (5.5)
B v out | t0 − A cos ωt0 + φ
(5.6)
25
5 . V e c to r d i f f e r e n t i a l e q uat i o n s a n d s e co n d - o r d e r c i rc u i t s
d v1 − vin (t) v 1 − v2
C1 v1 + + 0 (5.7)
dt R1 R2
d v2 − v1
C2 v2 + 0 (5.8)
dt R2
In order to view this system of differential equations in state-space form, we
will isolate derivatives on the LHS and emphasize that the RHS consists of
linear combinations of v1 , v2 , and vin (t):
!
d 1 1 1 1 1
v1 −v1 + + v2 + vin (t) (5.9)
dt R1 R2 C1 R2 C1 R1 C1
d 1 1
v2 v1 − v2 (5.10)
dt R2 C2 R2 C2
d ®
x® A x® + bu(t), (5.12)
dt
26
5.3. General state-space linear ODEs
and verify that “ ddt x®” and “A x®” for this candidate solution are equal:
d λt
v®e λ v®e λt (5.14)
dt
A v®e λt λ v®e λt (5.15)
Detour: diagonalization of A
Let’s additionally assume that A has two linearly independent eigenvectors:
λ1
0
v®2 v®1
A v®1 v®2 (5.18)
0 λ2
AV VΛ (5.19)
A VΛV −1 (5.20)
27
5 . V e c to r d i f f e r e n t i a l e q uat i o n s a n d s e co n d - o r d e r c i rc u i t s
To verify the initial condition, we can observe that the diagonal matrix of
exponentials becomes an identity matrix at time 0:
1 0 x̃1 (0)
x®(0) v®1 ,
v®2 (5.25)
0 1 x̃2 (0)
Modal decomposition
In the previous section, we wrote x®(0) in eigenbasis-aligned coordinates x̃1 (0)
and x̃2 (0). In this section, we will follow x̃1 and x̃2 as functions of t. Recall that
the eigenbasis-aligned coordinates are defined as follows:
x̃1
x® v®1 ®
V x̃.
v®2 (5.26)
x̃2
In reverse,
28
5.3. General state-space linear ODEs
®
We can use the Chain Rule to obtain a differential equation for x̃:
d ® d
x̃ V −1 x (5.28)
dt dt
®
V −1 A x® + bu (5.29)
®
V −1 AV x̃® + V −1 bu (5.30)
λ1
0 ® ® ®
x̃ + b̃u, b̃ V −1 b (5.31)
0 λ2
29
EECS 16B Spring 2020 EECS 16B Notes
Lecture 6
In the last lecture, a second-order low-pass filter circuit using two resistors and
two capacitors led us to the following differential equation:
d ®
x® A x® + bu, (6.1)
dt
v (t)
where x® 1 and x®(0) or x®(t0 ) is known. We represented x® as a linear
v2 (t)
combination of A’s eigenvectors v®1 (for eigenvalue λ 1 ) and v®2 (for eigenvalue
λ2 ):
x® v®1 x̃ 1 + v®2 x̃2 (6.2)
x̃1
v®1 V x̃®
v®2 (6.3)
x̃2
We will assume that λ1 and λ 2 are distinct, which implies that A has an
invertible matrix of linearly independent eigenvectors V.We established that
λ
0
AV VΛ, V v®1 v®2 , Λ 1 .
(6.4)
0 λ2
® and
These findings are summarized in Figure 6.1, which shows how x®, A x®, x̃,
Λx̃® are related by matrix multiplication (along arrows).
31
6 . D i ag o na l i z at i o n to s o lv e v e c to r d i f f e r e n t i a l e q uat i o n s
λ
0
3. Construct Λ 1 and b̃ V −1 b. Solve the differential equation
0 λ2
d ®
x̃ Λx̃® + b̃u with initial condition x̃(t0 ) V −1 x(t0 ). (More on this
dt
later.)
®
4. Recover a solution for x® using x® V x̃.
λ+5
−2
det λ 2 + 7λ + 6 0 (6.7)
−2 λ+2
32
6.2. Numerical example from RCRC circuit
33
6 . D i ag o na l i z at i o n to s o lv e v e c to r d i f f e r e n t i a l e q uat i o n s
34
6.4. Example: RL circuit
d
L i v. (6.26)
dt
d
Eliminating v and isolating i, we have
dt
d R vin
i− i+ . (6.27)
dt L L
The state variable for an inductor is i, and this differential equation may be
solved the same way we solved RC circuits.
35