aic
aic
aic
Circuits
Lecture Notes 2025
Carsten Wulff
Contents 3
1 Background 1
2 Introduction 3
2.1 Who . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 How I see our roles . . . . . . . . . . . . . . . . . 3
2.3 I want you to learn the skills necessary to make your
own ICs . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 There will always be analog circuits, because the
real world is analog . . . . . . . . . . . . . . . . . 5
2.4.1 Will you tape-out an IC? . . . . . . . . . . 9
2.4.2 What the team needs to know to design ICs 9
2.4.3 Zen of IC design (stolen from Zen of Python) 10
2.4.4 IC design mantra . . . . . . . . . . . . . . 10
2.4.5 Analog Design Process . . . . . . . . . . . 11
2.5 My Goal . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6 Syllabus . . . . . . . . . . . . . . . . . . . . . . . . 12
2.7 JNW (2025) . . . . . . . . . . . . . . . . . . . . . . 13
2.7.1 Grading . . . . . . . . . . . . . . . . . . . . 15
2.7.2 Group dynamics . . . . . . . . . . . . . . . 15
2.8 Software . . . . . . . . . . . . . . . . . . . . . . . 16
3 A refresher 17
3.1 There are standard units of measurement . . . . . 17
3.2 Electrons . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Probability . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Uncertainty principle . . . . . . . . . . . . . . . . 20
3.5 States as a function of time and space . . . . . . . 20
3.6 Allowed energy levels in atoms . . . . . . . . . . 21
3.7 Allowed energy levels in solids . . . . . . . . . . . 21
3.8 Silicon Unit Cell . . . . . . . . . . . . . . . . . . . 22
3.9 Band structure . . . . . . . . . . . . . . . . . . . . 23
3.10 Valence band and Conduction band . . . . . . . . 24
3.11 Fermi level . . . . . . . . . . . . . . . . . . . . . . 24
3.12 Metals . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.13 Insulators . . . . . . . . . . . . . . . . . . . . . . . 26
3.14 Semiconductors . . . . . . . . . . . . . . . . . . . 26
3.15 Band diagrams . . . . . . . . . . . . . . . . . . . . 27
3.16 Density of electrons/holes . . . . . . . . . . . . . 27
3.17 Fields . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.18 Permittivity and Permeability . . . . . . . . . . . 28
3.19 Quantum electrodynamics . . . . . . . . . . . . . 29
3.20 Voltage . . . . . . . . . . . . . . . . . . . . . . . . 29
3.21 Current . . . . . . . . . . . . . . . . . . . . . . . . 29
3.22 Drift current . . . . . . . . . . . . . . . . . . . . . 30
3.23 Diffusion current . . . . . . . . . . . . . . . . . . . 31
3.24 Why are there two currents? . . . . . . . . . . . . 31
3.25 Currents in a semiconductor . . . . . . . . . . . . 31
3.26 Resistors . . . . . . . . . . . . . . . . . . . . . . . 32
3.27 Capacitors . . . . . . . . . . . . . . . . . . . . . . 32
3.28 Inductors . . . . . . . . . . . . . . . . . . . . . . . 32
4 Diodes 33
4.1 Why . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2 Silicon . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.3 Intrinsic carrier concentration . . . . . . . . . . . 35
4.4 It’s all quantum . . . . . . . . . . . . . . . . . . . 37
4.4.1 Density of states . . . . . . . . . . . . . . . 38
4.4.2 How to think about electrons (and holes) . 40
4.5 Doping . . . . . . . . . . . . . . . . . . . . . . . . 41
4.6 PN junctions . . . . . . . . . . . . . . . . . . . . . 42
4.6.1 Built-in voltage . . . . . . . . . . . . . . . 43
4.6.2 Current . . . . . . . . . . . . . . . . . . . . 44
4.6.3 Forward voltage temperature dependence 45
4.6.4 Current proportional to temperature . . . 47
4.7 Equations aren’t real . . . . . . . . . . . . . . . . . 48
References . . . . . . . . . . . . . . . . . . . . . . 49
5 MOSFETs 51
5.0.1 Metal Oxide Semiconductor . . . . . . . . 51
5.0.2 Field Effect . . . . . . . . . . . . . . . . . . 53
5.1 Analog transistors in the books . . . . . . . . . . . 58
5.2 Transistors in weak inversion . . . . . . . . . . . . 61
5.3 The Field Effect . . . . . . . . . . . . . . . . . . . . 64
5.4 Transistors in strong inversion . . . . . . . . . . . 66
5.5 How should I size my transistor? . . . . . . . . . . 67
6 SPICE 69
6.1 SPICE . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.2 Simulation Program with Integrated Circuit Em-
phasis . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.2.1 Today . . . . . . . . . . . . . . . . . . . . . 69
6.2.2 But . . . . . . . . . . . . . . . . . . . . . . 70
6.2.3 Sources . . . . . . . . . . . . . . . . . . . . 71
6.2.4 Passives . . . . . . . . . . . . . . . . . . . . 72
6.2.5 Transistor Models . . . . . . . . . . . . . . 72
6.2.6 Transistors . . . . . . . . . . . . . . . . . . 73
6.2.7 Foundries . . . . . . . . . . . . . . . . . . . 74
6.3 Find right transistor sizes . . . . . . . . . . . . . . 74
6.3.1 Use unit size transistors for analog design 75
6.3.2 What about gm/Id ? . . . . . . . . . . . . 76
6.3.3 Characterize the transistors . . . . . . . . . 76
6.4 More information . . . . . . . . . . . . . . . . . . 76
6.5 Analog Design . . . . . . . . . . . . . . . . . . . . 76
6.6 Demo . . . . . . . . . . . . . . . . . . . . . . . . . 77
8 Sky130nm tutorial 87
8.1 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . 87
8.1.1 Setup WSL (Applicable for Windows users) 87
8.1.2 Setup public key towards github . . . . . . 87
8.1.3 Get AICEX and setup your shell . . . . . . 88
8.1.4 On systems with python3 > 3.12 . . . . . . 88
8.1.5 Install Tools . . . . . . . . . . . . . . . . . 88
8.1.6 Install cicconf . . . . . . . . . . . . . . . . 89
8.1.7 Install cicsim . . . . . . . . . . . . . . . . . 89
8.1.8 Setup your ngspice settings . . . . . . . . . 89
8.2 Check that magic and xschem works . . . . . . . 90
8.3 Design tutorial . . . . . . . . . . . . . . . . . . . . 90
8.3.1 Create the IP . . . . . . . . . . . . . . . . . 90
8.3.2 The file structure . . . . . . . . . . . . . . . 90
8.3.3 Github setup . . . . . . . . . . . . . . . . . 92
8.3.4 Start working . . . . . . . . . . . . . . . . . 93
8.3.5 Draw Schematic . . . . . . . . . . . . . . . 93
8.3.6 Typical corner SPICE simulation . . . . . 95
8.3.7 All corners SPICE simulations . . . . . . . 98
8.3.8 Draw Layout . . . . . . . . . . . . . . . . 100
8.3.9 Layout verification . . . . . . . . . . . . . 107
8.3.10 Extract layout parasitics . . . . . . . . . . 109
8.3.11 Simulate with layout parasitics . . . . . . 109
8.3.12 Make documentation . . . . . . . . . . . . 110
8.3.13 Edit info.yaml . . . . . . . . . . . . . . . . 110
8.3.14 Setup github pages . . . . . . . . . . . . . 111
8.3.15 Frequency asked questions . . . . . . . . . 111
16 Oscillators 273
16.1 Atomic clocks . . . . . . . . . . . . . . . . . . . . 273
16.1.1 Microchip 5071B Cesium Primary Time and
Frequency Standard . . . . . . . . . . . . . 273
16.1.2 Rubidium standard . . . . . . . . . . . . . 274
16.2 Crystal oscillators . . . . . . . . . . . . . . . . . . 276
16.2.1 Impedance . . . . . . . . . . . . . . . . . . 279
16.2.2 Circuit . . . . . . . . . . . . . . . . . . . . 280
16.2.3 Temperature behavior . . . . . . . . . . . . 282
16.3 Controlled Oscillators . . . . . . . . . . . . . . . . 283
16.3.1 Ring oscillator . . . . . . . . . . . . . . . . 283
16.3.2 Capacitive load . . . . . . . . . . . . . . . 285
16.3.3 Realistic . . . . . . . . . . . . . . . . . . . . 285
16.3.4 Digitally controlled oscillator . . . . . . . 288
16.3.5 Differential . . . . . . . . . . . . . . . . . . 288
16.3.6 LC oscillator . . . . . . . . . . . . . . . . . 289
16.4 Relaxation oscillators . . . . . . . . . . . . . . . . 291
16.5 Want to learn more? . . . . . . . . . . . . . . . . . 292
16.5.1 Crystal oscillators . . . . . . . . . . . . . . 292
16.5.2 CMOS oscillators . . . . . . . . . . . . . . 292
I think the lectures have gotten better, but I don’t have any specific
proof. There were 19 students that took the exam in 2024. An
indication of lecture quality could be attendance. I don’t have all
the dates, but an average attendance of 76 % I think is pretty OK.
Date Attendance
2024-02-02 19
2024-02-09 17
2024-02-16 16
2024-03-01 14
2024-03-07 14
2024-03-15 12
2024-03-22 13
2024-04-12 16
2024-04-19 10
For the group work I forced students into groups, and I forced that
they for the first 5-10 minutes do a check-in. That I need to do next
year too.
For the check in, they had go around in the group and answer one
of the following questions:
The check-in led to excellent team work for those students that
showed up.
For the fourth semester I’m making a few tweaks. Hopefully I’ll
get the same schedule (Thursday’s/Friday’s).
One change will be the grading of the project, I’ll be using github
actions to do the GDS,DRC,LVS,SIM and docs.
If you find an error in what I’ve made, then fork aic2024, fix ,
commit, push and create a pull request. That way, we use the
global brain power most efficiently, and avoid multiple humans
spending time on discovering the same error.
Introduction 2
2.1 Who . . . . . . . . . . . 3
2.1 Who
2.2 How I see our roles . . 3
2.3 I want you to learn
My name is the skills necessary to
make your own ICs . . 4
Carsten Wulff [email protected]
2.4 There will always be
I finished my Masters in 2002, and did a Ph.D on analog-to-digital analog circuits, be-
converters finished in 2008. cause the real world is
analog . . . . . . . . . . 5
Since that time, I’ve had a three axis in my work/hobby life. 2.4.1 Will you tape-out an
IC? . . . . . . . . . . . . 9
I work at Nordic Semiconductor where I’ve been since 2008. The 2.4.2 What the team needs to
first 7 years I did analog design (ADCs, DC/DCs, GPIO). The next know to design ICs . . 9
7 years I was the Wireless Group Manager. The Wireless group 2.4.3 Zen of IC design (stolen
make most of the analog and RF designs for Nordic’s short-range from Zen of Python) . 10
products. Now I’m the IC Scientist, and focus on technical issues 2.4.4 IC design mantra . . . 10
with our integrated circuits that occur before we go into volume 2.4.5 Analog Design Process 11
production. 2.5 My Goal . . . . . . . . . 11
2.6 Syllabus . . . . . . . . . 12
I work at NTNU where I did a part time postdoc from 2014 - 2017. 2.7 JNW (2025) . . . . . . . 13
From 2020 I’ve been working on and teaching Advanced Integrated 2.7.1 Grading . . . . . . . . . 15
Circuits 2.7.2 Group dynamics . . . . 15
2.8 Software . . . . . . . . 16
I have a hobby trying to figure out how to make a new analog
circuit design paradigm. The one we have today with schemat-
ic/simulation/layout/verification/simulation is too slow
Summer intern First book University
Mom died chapter
NTNU of
Toronto
Started NTNU First paper, 2. dan ITF
Bought first Started Taekwon-do Compiled
Aruba
book on 1. dan ITF Met ex wife Nordic ADC,
Senior R & D Wireless ESSCIRC16
electronics Taekwon-do
Finished group
A year in Master Started Ph.D engineer
manager
Army, HTV Ph.D Post.Doc
Australia Got Post.Doc
Son End
Twins Start Rando Associate
Born First PC born Married born
Divorced
Professor IC Scientist
6a
1976 1986 1991 1996 2001 2006 2011 2016 2021 2026
Compiled
RX_ADC, ADC,JSSC
nRF52 SAADC,
ADC, nRF52 DC/DC Bluetooth
nRF51 DC/DC, nRF91 SIG CSWG
nRF52
Someone must take over, and to do that, they need to know most
of what I know, and hopefully a bit more.
That’s were some of you come in. Some of you will find integrated
circuits interesting to make, and in addition, you have the stamina,
2.4 There will always be analog circuits, because the real world is analog 5
In this course, we’ll focus on analog ICs, because the real world is
analog, and all ICs must have some analog components, otherwise
they won’t work.
https://circuitcellar.com/insights/tech-the-future/kinget-the
-world-is-analog/
It’s rare to find a single human that do both flows well. Usually
people choose, and I think it’s based on what they like and their
personality.
If you like the world to be ordered, with definite answers, then it’s
likely that you’ll find the digital flow interesting.
When you learn something new, it’s good to listen to someone that
has done whatever it is before.
s/programming/analog design/ig
2.5 My Goal 11
2.5 My Goal
Don’t expect that I’ll magically take information and put it inside
your head, and you’ll suddenly understand everything about
making ICs.
I want to:
I’m not a mind reader, I can’t see inside your head. That means,
you must ask questions, only by your questions can I start to
understand what pieces of information is missing from your head,
or maybe somehow to correct your understanding.
12 2 Introduction
At the same time, and similar to a mountain guide, you should not
assume I’m always right. I’m human, and I will make mistakes.
And maybe you can correct my understanding of something. All I
care about is to really understand how the world works, so if you
think my understanding is wrong, then I’ll happily discuss.
2.6 Syllabus
These lecture notes are a supplement to the book. I try to give some
background, and how to think about electronics. It’s not my goal
to repeat information that you can find in the book.
Buy a hard-copy of the book if you don’t have that. Don’t expect to
understand the book by reading the PDF.
2.7 JNW (2025) 13
“You can use logic to justify almost anything. That’s its power.
And its flaw.” - Kathryn Janeway, Star Trek Voyager: Prime Fac-
tors
At the end of the project you will have a function that converts
temperature to a digital value.
𝐷 = 𝑓0 (𝑇)
14 2 Introduction
I’ve broken down the challenge into three steps, first convert
Temperature into a current
𝐼 = 𝑓1 (𝑇)
𝑡 = 𝑓2 (𝐼)
The third milestone is the layout, while the fourth milestone is the
report.
You will be using a repository on github for all your design data.
In that repository I’ve made it possible to run github actions, or
github workflows. For each of the milestones there are associated
workflows (SIM/DOCS/GDS/DRC/LVS).
MI MY
RESET
I Emmet Report PDF
Pursue b
put 1414
Anna i
µ
REPO
Layout
M3
Milestone 0: The zero milestone is not really part of the project, but
it does introduce you too how you will work with the files in the
project. It’s important that you do this right away. To complete the
milestone, upload a link to blackboard with your github repository
for the tutorial Skywater 130 nm Tutorial
2.7.1 Grading
Condition for
more than 0 Possible
Milestone
What does it mean points Points
M1 Circuit that can convert a SIM passing 10
I=f(T) temperature into a current
M2 Circuit that can convert from DOC passing 20
D=f(T) temperature into a digital
value
M3 Layout of your circuit DRC/LVS/GDS 20
Lay- passing
out
M4 Individual report Uploaded to 48
Re- blackboard
port
Cooleness
Extra points that I may 10
choose to award
Total 108
That’s why I think it’s important not to just work in groups, but
also focus on how we work in groups.
The group will meet once per week in the exercise hours.
2.7.2.1 Check-in
The point of this exercise is to get to know each other a bit, and
attempt to create psychological safety in the group.
2.8 Software
I’ve also made some more complex examples, that can be found at
the link below. There are digital logic cells, standard transistors,
and few other blocks.
aicex
A refresher 3
3.1 There are standard units of measurement 3.1 There are standard
units of measurement 17
3.2 Electrons . . . . . . . . . 18
All known physical quantities are derived from 7 base units (SI
3.3 Probability . . . . . . . 19
units)
3.4 Uncertainty principle . 20
▶ second (s) : time 3.5 States as a function of
▶ meter (m) : space time and space . . . . . 20
▶ kg (kilogram) : weight 3.6 Allowed energy levels
in atoms . . . . . . . . . 21
▶ ampere (A) : current
3.7 Allowed energy levels
▶ kelvin (K) : temperature
in solids . . . . . . . . . 21
▶ candela (cd) : luminous intensity
3.8 Silicon Unit Cell . . . . 22
All other units (for example volts), are derived from the base 3.9 Band structure . . . . . 23
units. 3.10 Valence band and
Conduction band . . . 24
I don’t go around remembering all of them, they are easily available
3.11 Fermi level . . . . . . . 24
online. When you forget the equation for charge (Q), voltage (V)
3.12 Metals . . . . . . . . . . 25
and capacitance (C), look at the units below, and you can see it’s
3.13 Insulators . . . . . . . . 26
𝑄 = 𝐶𝑉 ‗
3.14 Semiconductors . . . . 26
3.15 Band diagrams . . . . . 27
3.16 Density of electrons/-
holes . . . . . . . . . . . 27
3.17 Fields . . . . . . . . . . . 28
3.18 Permittivity and Per-
meability . . . . . . . . 28
3.19 Quantum electrody-
namics . . . . . . . . . . 29
3.20 Voltage . . . . . . . . . . 29
3.21 Current . . . . . . . . . 29
3.22 Drift current . . . . . . 30
3.23 Diffusion current . . . 31
3.24 Why are there two
currents? . . . . . . . . . 31
3.25 Currents in a semicon-
ductor . . . . . . . . . . 31
3.26 Resistors . . . . . . . . . 32
3.27 Capacitors . . . . . . . . 32
3.28 Inductors . . . . . . . . 32
‗ Although you do have to keep your symbols straight. We use “C” for Capacitance,
3.2 Electrons
SCALAR BOSONS
QUARKS
γ
−⅓ −⅓ −⅓ 0
½ d ½ s ½ b 1
GAUGE BOSONS
μ τ
−1 −1 −1 0
½ e ½ ½ 1 Z
electron muon tau Z boson
VECTOR BOSONS
LEPTONS
All electrons are the same, although the quantum state can be
different.
3.3 Probability
𝑃 = |𝜓(𝑟, 𝑡)|2
𝜓(𝑟, 𝑡) = 𝐴𝑒 𝑖(𝑘𝑟−𝜔𝑡)
ℏ
𝜎𝑥 𝜎𝑝 ≥
2
𝑑
𝑖ℏ 𝜓(𝑟, 𝑡) = 𝐻𝜓(𝑟, 𝑡)
𝑑𝑡
Take hydrogen, the electron bound to the proton can only exists
in quantized energy levels. The lowest energy state can have two
electrons, one with spin up, and one with spin down.
From Schrodinger you can compute the energy levels, which most
of us did at some-point, although now, I can’t remember how it
was done. That’s not important. The important is to internalize
that the energy levels in bound electrons are discrete.
If I have two silicon atoms spaced far apart, then the electrons can
have the same spin and same momentum around their respective
nuclei. As I bring the atoms closer, however, the probability am-
plitudes start to interact (or the dimensions of the Hamiltonian
matrix grow), and there can be state transitions between the two
electrons.
The allowed energy levels will split. If I only had two states
interacting, the Hamiltonian could be
𝐴 0
𝐻=
0 −𝐴
𝐸1 = 𝐸0 + 𝐴
22 3 A refresher
and
𝐸2 = 𝐸0 − 𝐴
𝐸𝐺 = 𝐸𝐶 − 𝐸𝑉
1
𝑓 (𝐸) =
𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇 + 1
If the energy of the state is more than a few kT away from the
Fermi-level, then
The Fermi-Dirac function also explains why there are more free
carriers, and reaction rates increase, at high temperature. The
part of the equation that is 𝑒 −𝐸/𝑘𝑇 will approach one at high
temperatures.
3.12 Metals
In metals, the band splitting of the energy levels causes the valence
band and conduction band to overlap.
26 3 A refresher
Electrons can easily transition between bound state and free state.
As such, electrons in metals are shared over large distances, and
there are many electrons readily available to move under an applied
field, or difference in electron density. That’s why metals conduct
well.
3.13 Insulators
lambda_optical = 450e-9
e_optical = h * c/lambda_optical
lambda_ultra = 380e-9
e_ultra = h * c/lambda_ultra
3.14 Semiconductors
𝐸𝐺 = 1.12 𝑒𝑉
The horizontal axis is the distance in the material, the vertical axis
is the energy.
∫ ∞
𝑛𝑒 = 𝑁(𝐸) 𝑓 (𝐸)𝑑𝐸
𝐸𝐶
∫ ∞
𝐸𝐹 /𝑘𝑇
𝑛𝑒 = 𝑒 𝑁(𝐸)𝑒 −𝐸/𝑘𝑇 𝑑𝐸
𝐸𝐶
3.17 Fields
There are equations that relate electric field, magnetic field, charge
density and current density to each-other.
∮ ∭
1
E · 𝑑S = 𝜌 · 𝑑𝑉
𝜕Ω 𝜖0 𝑉
∮
B · 𝑑S = 0
𝜕Ω
𝑑
∮ ∬
E · 𝑑ℓ = − B · 𝑑S
𝜕Σ 𝑑𝑡 Σ
𝑑
∮ ∬ ∬
B · 𝑑ℓ = 𝜇0 J · 𝑑S + 𝜖0 E · 𝑑S
𝜕Σ Σ 𝑑𝑡 Σ
These are the Maxwell Equations, and are non-linear time depen-
dent differential equations.
1
𝜖0 =
𝜇0 𝑐 2
2𝛼 ℎ
𝜇0 =
𝑞2 𝑐
¯
L = 𝜓[𝑖ℏ𝑐𝛾 𝜇 ¯ 𝜇 𝜓]𝐴𝜇 − 1 𝐹𝜇𝜈 𝐹 𝜇𝜈
𝜕𝜇 − 𝑚𝑐 2 ]𝜓 − 𝑞[𝜓𝛾
16𝜋
3.20 Voltage
The electric field has units voltage per meter, so the electric field is
the derivative of the voltage as a function of space.
𝑑𝑉
𝐸=
𝑑𝑥
3.21 Current
Current has unit 𝐴 and charge 𝐶 has unit 𝐴𝑠 , so the current is the
number of charges passing through a volume per second.
The current density 𝐽 has units 𝐴/𝑚 2 and is often used, since we
can multiply by the surface area of a conductor, if the current
density is uniform.
𝐼 =𝐴×𝐽
30 3 A refresher
We know from Newtons laws that force equals mass times acceler-
ation
𝐹® = 𝑚®𝑎
𝐹® = 𝑞 𝐸®
®𝐽 = 𝑞 𝐸® × 𝑛 × 𝜇
where 𝑛 is the charge density, and 𝜇 is the mobility (how easily the
charges move) and has units 𝑚 2 /𝑉 𝑠
Assuming
𝐸 = 𝑉/𝑚
, we could write
𝐶 𝑉 𝑚2 𝐶
𝐽= = 𝑚 −2
𝑚 𝑚 𝑉𝑠
3 𝑠
𝐼 = 𝑞𝑛𝜇𝐴𝑉
𝐺 = 𝑞𝑛𝜇𝐴
, and since
𝐺 = 1/𝑅
𝐼 = 𝐺𝑉 ⇒ 𝑉 = 𝑅𝐼
Or Ohms law
𝑑𝜌
𝐽 = −𝑞𝐷𝑛
𝑑𝑥
ℏ2 𝜕 2 𝜕
− 𝜓(𝑥, 𝑡) + 𝑉(𝑥)𝜓(𝑥, 𝑡) = 𝑖ℏ 𝜓(𝑥, 𝑡)
2𝑚 𝜕 𝑥
2 𝜕𝑡
Both holes and electrons can only move if there are available
quantum states.
32 3 A refresher
3.26 Resistors
In metal the dominant carrier depends on the metal, but it’s usually
electrons. As such, one can often ignore the hole current.
If the Fermi level is close to the valence band the dominant carrier
will be holes. If the Fermi level is close to the conduction band, the
dominant carrier will be electrons.
3.27 Capacitors
𝑑𝑉
𝐼=𝐶
𝑑𝑡
3.28 Inductors
𝑑𝐼
𝑉=𝐿
𝑑𝑡
4.2 Silicon
‗ It doesn’t stop being magic just because you know how it works. Terry Pratchett,
𝑁𝑐 𝑁𝑣 𝑒 −𝐸 𝑔 /(2 𝑘𝑇)
p
𝑛𝑖 = (1)
3/2
2𝜋𝑘𝑇𝑚 𝑝∗
3/2
2𝜋𝑘𝑇𝑚𝑛∗
𝑁𝑐 = 2 𝑁𝑣 = 2
ℎ2 ℎ2
r
𝑇𝑁 𝑂 𝑀 𝑇 𝐸𝑔
𝑛 𝑖 = 1.45𝑒 10 exp21.5565981− 2𝑘𝑇
300.15 300.15
13
10
Advanced
Simple
12
10 BSIM 4.8
11
10
ni [1/cm3]
10
10
9
10
8
10
7
10
25 0 25 50 75 100 125
𝜓 = 𝐴𝑒 𝑖(𝑘 r−𝜔𝑡)
1 2
𝑝 +𝑉 = 𝐸
2𝑚
where 𝑝 = 𝑚𝑣 , 𝑚 is the mass, 𝑣 is the velocity and 𝑉 is the
potential.
ℏ2 𝜕 2 𝜕
− 𝜓(𝑥, 𝑡) + 𝑉(𝑥)𝜓(𝑥, 𝑡) = 𝑖ℏ 𝜓(𝑥, 𝑡)
2𝑚 𝜕 𝑥
2 𝜕𝑡
𝜕
𝐻𝜓(𝑥,
b 𝑡) = 𝑖ℏ 𝜓(𝑥, 𝑡) = 𝐸𝜓(𝑥,
b 𝑡)
𝜕𝑡
We could re-arrange
[𝐻
b − 𝐸]𝜓(𝑟,
b 𝑡) = 0
3
1 𝜇m
× 8 atoms per unit cell × 14 electrons per atom
0.543 nm
To compute “how many Energy states are there per unit volume in
the conduction band”, or the “density of states”, we start with the
three dimensional Schrodinger equation for a free electron
ℏ2 2
− ∇ 𝜓 = 𝐸𝜓
2𝑚
I’m not going to repeat the computation here, but rather paraphrase
the steps. You can find the full derivation in Solid State Electronic
Devices.
2
𝑁(𝑑𝑘) = 𝑑𝑘
(2𝜋)𝑝
ℏ2 𝑘 2
𝐸(𝑘) =
2𝑚 ∗
ℏ2
𝑚∗ =
𝑑2 𝐸
𝑑𝑘 2
In 3D, once we use the above equations, one can compute that the
density of states per unit energy is
2 𝑚 ∗ 3/2 1/2
𝑁(𝐸)𝑑𝐸 = 𝐸 𝑑𝐸
𝜋2 ℏ2
1
𝑓 (𝐸) = (2)
𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇 +1
Fun fact, the Fermi level difference between two points is what you
measure with a voltmeter.
1
𝑓 (𝐸) = = 𝑒 (𝐸𝐹 −𝐸)/𝑘𝑇
𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇
a large part of the metal structure. I would also assume that the
location of the Fermi level within the band structure explains the
difference in conductivity of metals, as it would determined how
many electrons are free to move.
𝑁𝑒 𝑑𝐸 = 𝑁(𝐸) 𝑓 (𝐸)𝑑𝐸
3/2
2𝜋𝑚 ∗ 𝑘𝑇
𝑛𝑒 = 2 𝑒 (𝐸𝐹 −𝐸𝐶 )/𝑘𝑇
ℎ2
3/2
2𝜋𝑚 ∗ 𝑘𝑇
𝑛0 = 2 𝑒 −𝐸 𝑔 /(2 𝑘𝑇) (3)
ℎ2
As we can see, Equation (3) has the same coefficients and form as
the computation in Equation (1). The difference is that we also have
to account for holes. At thermal equilibrium and intrinsic silicon
𝑛 𝑖2 = 𝑛0 𝑝 0
What happens is that the applied voltage at the gate shifts the
energy bands close to the surface (or bends the bands in relation
to the Fermi level), and the density of carriers in the conduction
band in that location changes, according to the type of derivations
above.
Once the electrons are in the conduction band, then they follow the
same equations as diffusion of a gas, Fick’s law of diffusion. Any
charge density concentration difference will give rise to a diffusion
current given by
𝜕𝜌
𝐽diffusion = −𝑞𝐷𝑛 (4)
𝜕𝑥
4.5 Doping
The doped material does not have a net charge, however, as it’s the
same number of electrons and protons, so even though we dope
silicon, it does remain neutral.
𝑛 𝑖2
𝑛 𝑛 = 𝑁𝐷 , 𝑝 𝑛 =
𝑁𝐷
𝑛 𝑖2
𝑝 𝑝 = 𝑁𝐴 , 𝑛 𝑝 =
𝑁𝐴
4.6 PN junctions
The charge difference will create a field, and a built-in voltage will
develop across the depletion region.
∫ ∞
𝑛= 𝑁(𝐸) 𝑓 (𝐸)𝑑𝐸
𝐸𝐶
∫ ∞
𝐸𝐹𝑛 /𝑘𝑇
𝑛𝑛 = 𝑒 𝑁𝑛 (𝐸)𝑒 −𝐸/𝑘𝑇 𝑑𝐸
𝐸𝐶
∫ ∞
𝐸𝐹𝑝 /𝑘𝑇
𝑛𝑝 = 𝑒 𝑁𝑝 (𝐸)𝑒 −𝐸/𝑘𝑇 𝑑𝐸
𝐸𝐶
If we assume that the density of states, 𝑁𝑛 (𝐸) and 𝑁𝑝 (𝐸) are the
same, and the temperature is the same, then
𝑛𝑛 𝑒 𝐸𝐹𝑛 /𝑘𝑇
= 𝐸 /𝑘𝑇 = 𝑒 (𝐸𝐹𝑛 −𝐸𝐹𝑝 )/𝑘𝑇
𝑛𝑝 𝑒 𝐹𝑝
𝐸𝐹𝑛 − 𝐸𝐹𝑝 = 𝑞Φ
𝑁𝐴 𝑁𝐷
= 𝑒 𝑞Φ0 /𝑘𝑇
𝑛𝑖2
or rearranged to
!
𝑘𝑇 𝑁𝐴 𝑁𝐷
Φ0 = 𝑙𝑛
𝑞 𝑛 𝑖2
44 4 Diodes
4.6.2 Current
𝑝𝑝
= 𝑒 −𝑞Φ0 /𝑘𝑇
𝑝𝑛
𝑝(−𝑥 𝑝 0 )
= 𝑒 𝑞(𝑉−Φ0 )/𝑘𝑇
𝑝(𝑥 𝑛 0 )
𝑝(𝑥 𝑛 0 )
= 𝑒 𝑞𝑉/𝑘𝑇
𝑝𝑛
Δ𝑝 𝑛 = 𝑝(𝑥 𝑛 0 ) − 𝑝 𝑛 = 𝑝 𝑛 𝑒 𝑞𝑉/𝑘𝑇 − 1
𝜕𝜌
𝐽(𝑥 𝑛 ) = −𝑞𝐷𝑝
𝜕𝑥
𝜕𝜌(𝑥 𝑛 ) = Δ𝑝 𝑛 𝑒 −𝑥 𝑛 /𝐿𝑝
Anyhow, we can now compute the current density, and need only
compute it for 𝑥 𝑛 = 0, so you can show it’s
𝐷𝑝
𝐽(0) = 𝑞 𝑝 𝑛 𝑒 𝑞𝑉/𝑘𝑇 − 1
𝐿𝑝
which start’s to look like the normal diode equation. The 𝑝 𝑛 is the
minority concentration of holes on the n-side, which we’ve before
𝑛 𝑖2
estimated as 𝑝 𝑛 = 𝑁𝐷
We’ve only computed for holes, but there will be electron transport
from the p-side to the n-side also.
1 𝐷𝑛 1 𝐷𝑝 𝑞𝑉/𝑘𝑇
𝐼= 𝑞𝐴𝑛 𝑖2 𝑒
+ −1
𝑁𝐴 𝐿 𝑛 𝑁𝐷 𝐿 𝑝
𝑉𝐷
𝐼𝐷 = 𝐼𝑆 (𝑒 𝑉𝑇 − 1), where 𝑉𝑇 = 𝑘𝑇/𝑞
𝐼𝐷
𝑉𝐷 = 𝑉𝑇 ln
𝐼𝑆
First rewrite
𝑉𝐷 = 𝑉𝑇 ln 𝐼𝐷 − 𝑉𝑇 ln 𝐼𝑆
𝐷𝑛 𝐷𝑝
ln 𝐼𝑆 = 2 ln 𝑛 𝑖 + ln 𝐴𝑞 +
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
46 4 Diodes
p −𝐸 𝑔
𝑛𝑖 = 𝐵 𝑐 𝐵𝑣 𝑇 3/2 𝑒 2𝑘𝑇
where
3/2
2𝜋𝑘𝑚 𝑝∗
3/2
2𝜋𝑘𝑚𝑛∗
𝐵𝑐 = 2 𝐵𝑣 = 2
ℎ2 ℎ2
p 𝑉𝐺
2 ln 𝑛 𝑖 = 2 ln 𝐵 𝑐 𝐵𝑣 + 3 ln 𝑇 −
𝑉𝑇
𝑘𝑇
𝑉𝐷 = (ℓ − 3 ln 𝑇) + 𝑉𝐺
𝑞
𝐷𝑛 𝐷𝑝
p
ℓ = ln 𝐼𝐷 − ln 𝐴𝑞 + − 2 ln 𝐵 𝑐 𝐵𝑣
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
Although it’s not trivial to see that the diode voltage has a negative
temperature coefficient, if you do compute it as in vd.py, then
you’ll see it decreases.
The slope of the diode voltage can be seen to depend on the area,
the current, doping, diffusion constant, diffusion length and the
effective masses.
‡ From the Einstein relation 𝐷 = 𝜇𝑘𝑇 it does appear that the diffusion coefficient
increases with temperature, however, the mobility decreases with temperature.
I’m unsure of whether the mobility decreases with the same rate though.
4.6 PN junctions 47
0.95
Diode voltage [V]
0.90
0.85
25 0 25 50 75 100 125
Non-linear component (mV)
2
25 0 25 50 75 100 125
Temperature [C]
𝑞𝑉𝐷 1 𝑞𝑉𝐷 2
𝐼𝑆 𝑒 𝑘𝑇 = 𝑁 𝐼𝑆 𝑒 𝑘𝑇
𝑘𝑇
𝑉𝐷 1 − 𝑉𝐷 2 = ln 𝑁
𝑞
The voltage across the resistor and diode would be constant over
temperature, with the small exception of the non-linear component
of 𝑉𝐷 .
TN
But there is no reason nature should make all unit cells the same,
and infact, we know they are not the same, we put in dopants. As
we scale down to a few nano-meter transistors the simplification
that “all unit cells of silicon are the same, and extend to infinity” is
no longer true, and must be taken into account in how we describe
reality.
Other parts, like the exact value of the bandgap 𝐸 𝑔 , the diffusion
constant 𝐷𝑝 or diffusion length 𝐿 𝑝 are macroscopic phenomena,
we can’t expect them to be 100 % true. The values would be based
on measurement, but not always exact, and maybe, if you rotate
your diode 90 degrees on the integrated circuit, the values could
be different.
Nature does not care about your equations. Nature will easily have
the superposition of trillions of electrons, and they don’t have to
agree with your equations.
References
[1] T. C. Carusone, D. Johns, and K. Martin, Analog integrated
circuit design. Wiley, 2011 [Online]. Available: https://book
s.google.no/books?id=1OIJZzLvVhcC
[2] Berkeley, “Berkeley short-channel IGFET model.” [Online].
Available: http://bsim.berkeley.edu/models/bsim4/
MOSFETs 5
5.0.1 Metal Oxide Semicon-
I’m stunned if you’ve never heared the word “transistor”. I think ductor . . . . . . . . . . 51
most people have heard the word. What I find funny is that almost 5.0.2 Field Effect . . . . . . . 53
nobody understand in full detail how transistors work. 5.1 Analog transistors in
the books . . . . . . . . 58
5.2 Transistors in weak
Through my 30 year venture into the world of electronics I’ve inversion . . . . . . . . 61
met “analog designers”, or people that should understand exactly 5.3 The Field Effect . . . . 64
how transistors work. I used to hire analog designers, and I’ve 5.4 Transistors in strong
interviewed hundred plus “analog designers” in my 8 years as inversion . . . . . . . . 66
manager and I’ve met hundreds of students of analog design. I 5.5 How should I size my
would go as far as to say none of them know everything about transistor? . . . . . . . 67
transistors, including myself.
Most of the people I’ve met have a good brain, so that is not the
reason they don’t understand. Transistors are incredibly compli-
cated! I say this, because if at some point in this document, you
don’t understand, then don’t worry, you are not alone.
Something like the cartoon below where only the Metal (gate) of
the MOS name is shown.
The oxide and the silicon bulk is not visible, but you can imagine
them to be underneath the gate, with a thin oxide (a few nano
meters thick) and the silicon the transparent part of the picture.
The length (L), and width (W) of the MOS is annotated in blue.
52 5 MOSFETs
VD VS
MN1 MP1
VG VG
VS VD
Figure 2: Transistor symbols
The MOS part of the name can be seen in MN1, where 𝑉𝐺 is the gate
connected to a vertical line (metal), a space (oxide), and another
vertical line (the silicon substrate or silicon bulk).
In a PMOS the holes come from the source, and flow to the drain.
Since holes are positive charge carriers, the current flows from
source to drain.
Imagine that the bulk (the empty space underneath the gate), and
the source is connected to 0 V. Assume that the gate is 0 V.
Imagine that your eyes could see the free electrons as a blue
fluorescent color. What you would see is a bright blue drain, and
bright blue source, but no color underneath the gate.
As you increase the gate voltage, the color underneath the gate
would change. First, you would think there might be some blue
color, but it would be barely noticeable.
54 5 MOSFETs
As you continue to increase the gate voltage the blue color would
become a little brighter, but not much.
This thin blue sheet extend from source to drain, and create a
conductive channel where the electrons can move from source to
drain (or drain to source), exactly like a resistor. The conductance of
the sheet is the same as the brightness, higher gate source voltage,
more bright blue, higher conductance, less resistance.
Assume you raise the drain voltage. The electrons would move from
source to drain proportional to the voltage. How many electrons
could move would depend on the gate voltage.
If the gate voltage was low, then there is low density of electrons
in the sheet, and low current.
55
If the gate voltage is high, then the electron density in the sheet
is high, and there can be a high current, although, the electrons
do have a maximum speed, so at some point the current does not
change as fast with the gate voltage.
At a certain drain voltage you would see the blue color disappear
close to the drain and there would be a gap in the sheet.
That could make you think the current would stop, but it turns out,
that the electrons close to drain get swept across the gap because
the electric field is so high from the edge of the sheet to the drain.
And now you may think you understand how the transistor works.
By changing the gate voltage, we can change the electron current
from source to drain. We can turn on, and off, currents, creating a
0 and 1 state.
If the input 𝑉𝑖𝑛 is a high voltage, then the output 𝑉𝑜𝑢𝑡 is a low
voltage, because the NMOS is on. If the input 𝑉𝑖𝑛 is a low voltage,
then the output 𝑉𝑜𝑢𝑡 is a high voltage, because the PMOS is on.
56 5 MOSFETs
MP1
Vin Vout
MN1
Figure 7: Inverter
I can now build more complex “logic gates”. The one below is a
Not-AND gate (NAND). If both inputs (A and B) are high, then
the output is low (both NMOS are on). Otherwise, the output is
high.
Figure 8: NAND
You may be too young to have seen the Matrix, but now is the time
to decide between the red pill and the blue pill.
The red will start your journey to discover the reality behind the
transistor, the blue pill will return you to your normal life, and you
can continue to think that you now understand how transistors
work.
58 5 MOSFETs
Because:
And did you realize I never in this chapter explained how the field
effect worked?
Someday, I may write all the details, if I ever understand it all. For
now, I hope that the sections below will help you a bit.
∫ ∞
1
𝑛= 𝑁(𝐸) 𝑑𝐸
𝐸𝐶 𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇 +1
1 𝑊
𝐼𝐷 = 𝜇𝑛 𝐶 𝑜𝑥 (𝑉𝑔𝑠 − 𝑉𝑡 ℎ )2
2 𝐿
The year after we teach the current equations for MOSFETs, and
the books don’t have the link back to solid-state physics, after all,
we already told the students that, they should remember!
But we can make sure we connect the links from Schrodinger to the
MOSFET equations, the short version of that was above, but the
following sections tries to explain with words how the transistor
actually works.
I’m not going to give all the equations and all the maths. For that,
there are excelent books and resources. I would recommend Mark
Lundstrom for the best in detail description of MOSFETs.
5.2 Transistors in weak inversion 61
For the moment we’ll ignore the field effect of the gate, and how
that modulates the hole concentration underneath the gate.
If you’re familiar with bipolars, then you may think I’ve drawn the
wrong transistor, because you see an NPN bipolar transistor. The
picture is correct, however, this is how a normal MOSFET looks.
It’s actually also a NPN bipolar transistor, but we don’t usually use
that part (you’ll see more when we get to ESD)
n p n
Source Gate
Figure 10: Charge carrier density in a MOSFET
Drain
Let’s consider electron current for now, and only look at the
In
conduction band.
In n
n p
e e
Mma
and visa versa
Assume source and drain are at the same potential, then the sum
n n
of all currents (1,2,3,4) for both electrons and holes in Figure
p
11
must equal zero.
e e
Assume that we increase the drain voltage, as shown in Figure 12.
Increasing the drain voltage is the same as reducing the conduction
band in the drain.
Since there now is a higher barrier from drain to bulk, it’s now
much less probable that electrons are injected from drain to bulk.
Now the sum of all currents would not equal zero, as the 1 and 3
currents are larger than 2 and 4.
n
Mma p n
e e
Notice that if we increase the drain voltage further, then the electron
injection from drain to bulk would quickly approach zero.
If we only need to consider the electrons and holes at source for the
subthreshold current (assuming the drain voltage is high enough),
then we should expect the equation look very similar to a diode,
and indeed it does.
where
𝑛 = (𝐶 𝑜𝑥 + 𝐶 𝑗 0 )/𝐶 𝑜𝑥
2
𝑘𝑇
𝐼𝐷 0 = (𝑛 − 1)𝜇𝑛 𝐶 𝑜𝑥
𝑞
64 5 MOSFETs
This is not exactly the same as the diode equation, but we can see
that it looks similar. Most of the quantum mechanics is baked into
the 𝑉𝑇𝐻
𝐼𝐷
𝑔𝑚 =
𝑛𝑉𝑇
A big difference from the diode equation is the fact that the gate-
source voltage seems to determine the current, and not the voltage
across the pn junction.
Consider the band diagram in Figure 13, in the figure we’re looking
at a cross section of the transistor. From left we’re in the gate, then
we have the oxide, and then the bulk of the transistor.
We don’t see the drain and source, as the source would be towards
Gate
you, and the drain would be into the picture.
Source Drain
The cartoon is not a real transistor. I don’t think there is necessarily
a combination of semiconductor and metal where we end up with
the same Fermi level (𝐸𝐹 ) without some bending of the conduction
band and valence band, but for illustration, let’s assume that’s the
case.
at É
Moving the gate down has the effect of bending the bands in the
semiconductor. We’ll lose some voltage across the oxide, but not
necessarily that much.
The bending of the valence band will decrease the hole concen-
tration close to the silicon surface, and the semiconductor will be
depleted of mobile charge carriers.
The valence band bending will also reduce the barrier height in
Figure 12, which increases the number of carriers that can be
injected at source/bulk interface, so the subthreshold current will
start to increase.
qV IF
I
Figure 13: Band diagram with high gate-source voltage applied
𝑑
𝑖ℏ Ψ(𝑟, 𝑡) = 𝐻Ψ(𝑟,
b 𝑡)
𝑑𝑡
But what does the Schrodinger equation tell us? Well, the equation
above does not tell me much, it can’t be “solved”, or rather, it does
not have a single solution. It’s more a framework for how the wave
function, and the Hamiltonian, describes the quantum states of
a system, and the probability ampltiudes of transition between
states.
5.5 How should I size my transistor? 67
The method that makes most sense to me, is to use the inversion-
coefficient method, described in Nanoscale MOSFET Modeling:
Part 1 and Nanoscale MOSFET Modeling: Part 2.
There are also some blog posts worth looking at Inversion Coeffi-
cient Based Circuit Design and My Circuit Design Methodology.
I should caveat my proposal for method. For the past 7 years I’ve
not had the luxury to do full time, hardcore, analog design. As my
career progressed, most of my time is now spent telling others what
I think is a good idea to do, and not doing hardcore analog design
myself. I think, however, I have a pretty decent understanding of
analog circuits, and how to design them, so I think I’m correct in
the proposal. If I were to start hardcore analog design now, I would
go all in on inversion-coefficient based transistor size selection.
SPICE 6
6.1 SPICE . . . . . . . . . . 69
6.1 SPICE
6.2 Simulation Program
with Integrated Circuit
Emphasis . . . . . . . . 69
6.2 Simulation Program with Integrated Circuit 6.2.1 Today . . . . . . . . . . 69
Emphasis 6.2.2 But . . . . . . . . . . . . 70
6.2.3 Sources . . . . . . . . . 71
6.2.4 Passives . . . . . . . . . 72
To manufacture an integrated circuit we have to be able to predict 6.2.5 Transistor Models . . . 72
how it’s going to work. The only way to predict is to rely on our 6.2.6 Transistors . . . . . . . 73
knowledge of physics, and build models of the real world in our 6.2.7 Foundries . . . . . . . . 74
computers. 6.3 Find right transistor
sizes . . . . . . . . . . . 74
One simulation strategy for a model of the real world, which 6.3.1 Use unit size transistors
absolutely every single integrated circuit in the world has used to for analog design . . . 75
come into existence, is SPICE. 6.3.2 What about gm/Id ? . 76
6.3.3 Characterize the transis-
Published in 1973 by Nagel and Pederson tors . . . . . . . . . . . . 76
6.4 More information . . . 76
SPICE (Simulation Program with Integrated Circuit Emphasis) 6.5 Analog Design . . . . . 76
6.6 Demo . . . . . . . . . . 77
6.2.1 Today
There are multiple SPICE programs that has been written, but
they all work in a similar fashion. There are expensive ones, closed
source, and open source.
70 6 SPICE
Some are better at dealing with complex circuits, some are faster,
and some are more accurate. If you don’t have money, then start
with ngspice.
6.2.2 But
for example
ngspice testbench.cir
The expensive tools have built graphical user interface around the
SPICE simulator to make it easier to run multiple scenarios.
6.2.3 Sources
I1 0 VDN dc In
I2 VDP 0 dc Ip
72 6 SPICE
V2 VSS 0 dc 0
V1 VDD 0 dc 1.5
6.2.4 Passives
Resistors
R1 N1 N2 10k
R2 N2 N3 1Meg
R3 N3 N4 1G
R4 N4 N5 1T
Capacitors
C1 N1 N2 1a
C2 N1 N2 1f
C4 N1 N2 1p
C3 N1 N2 1n
C5 N1 N2 1u
Drain
Gate M1
Source
284 parameters in BSIM 4.5
6.2 Simulation Program with Integrated Circuit Emphasis 73
6.2.6 Transistors
6.2.7 Foundries
Each foundry has their own SPICE models bacause the transistor
parameters depend on the exact physics of the technology!
https://skywater-pdk.readthedocs.io/en/main/
Assume active (
𝑉𝑑𝑠 > 𝑉𝑒 𝑓 𝑓
in strong inversion, or
𝑉𝑑𝑠 > 3𝑉𝑇
in weak inversion). For diode connected transistors, that is always
true.
Weak inversion:
𝑊 𝑉𝑒 𝑓 𝑓 /𝑛𝑉𝑇
𝐼𝐷 = 𝐼𝐷 0 𝑒
𝐿
,
𝑉𝑒 𝑓 𝑓 ∝ ln 𝐼𝐷
Strong inversion:
1 𝑊
𝐼𝐷 = 𝜇𝑛 𝐶 𝑜𝑥 𝑉𝑒2𝑓 𝑓
2 𝐿
, p
𝑉𝑒 𝑓 𝑓 ∝ 𝐼𝐷
Amplifiers
⇒ 𝐿 ≈ 1.2 × 𝐿𝑚𝑖𝑛
Current mirrors
⇒ 𝐿 ≈ 4 × 𝐿𝑚𝑖𝑛
Weak
𝑔𝑚 1
=
𝐼𝑑 𝑛𝑉𝑇
Strong
𝑔𝑚 2
=
𝐼𝑑 𝑉𝑒 𝑓 𝑓
http://analogicus.com/cnr_atr_sky130nm/mos/CNRATR_N
CH_2C1F2.html
Ngspice Manual
Installing tools
On failure, go back
6.6 Demo
https://github.com/analogicus/jnw_spice_sky130A/tree/mai
n
Mixed Signal Simulation in
NGSPICE 7
7.1 Mixed Signal Simulation in ngspice 7.1 Mixed Signal Simula-
tion in ngspice . . . . . 79
7.2 Digital simulation . . . 79
7.2 Digital simulation 7.3 Transient analog simu-
lation . . . . . . . . . . . 80
Open Source
▶ iverilog/vpp
▶ Verilator
▶ SystemDotNet
module dig(
input wire clk,
input wire reset,
output logic [4:0] b
);
logic rst = 0;
rst <= 0;
end
endmodule
The nodal matrix could look like the matrix below, 𝑖 are the currents,
𝑣 the voltages, and 𝐺 the conductances between nodes.
▶ Euler
▶ Runge-Kutta
▶ Crank-Nicolson
▶ Gear
Digital Analog
Simulator Simulator
7.4 Demo
Tutorial at http://analogicus.com/jnw_sv_sky130a/
Repository at https://github.com/wulffern/jnw_sv_sky130a
What we want from the digital is to control the binary value of the
current DAC.
7.6 The digital code 83
The digital code is shown below. The clk controls the stepping,
while the reset sets the output b=0. When reset is off, then the b
increments.
module dig(
input wire clk,
input wire reset,
output logic [4:0] b
);
logic rst = 0;
cd sim/JNWSW_CM
ngspice vlnggen ../../rtl/dig.v
adut [clk
+ reset
+ ]
+ [b.4
+ b.3
+ b.2
+ b.1
+ b.0
+ ] null dut
.model dut d_cosim
+ simulation="../dig.so" delay=10p
Turns out that ngspice needs the digital inputs and outputs to
be connected to something to calculate them (I think), so connect
some resistors
* Inputs
Rsvi0 clk 0 1G
Rsvi1 reset 0 1G
* Outputs
Rsvi2 b.4 0 1G
Rsvi3 b.3 0 1G
Rsvi4 b.2 0 1G
Rsvi5 b.1 0 1G
Rsvi6 b.0 0 1G
7.9 Import in testbench 85
For the busses I find it easier to read the value as a real, so translate
the buses from digital b[4:0] to a real value dec_b
...
.include ../xdut.spi
.include ../svinst.spi
* Translate names
VB0 b.0 b<0> dc 0
VB1 b.1 b<1> dc 0
VB2 b.2 b<2> dc 0
VB3 b.3 b<3> dc 0
VB4 b.4 b<4> dc 0
...
7.11 Running
cd sim/JNWSW_CM/
make typical
Sky130nm tutorial 8
8.1 Tools . . . . . . . . . 87
8.1 Tools
8.1.1 Setup WSL (Appli-
cable for Windows
I would strongly recommend that you install all tools locally on users) . . . . . . . . . 87
your system. 8.1.2 Setup public key
towards github . . . 87
For the analog toolchain we need some tools, and a process design 8.1.3 Get AICEX and setup
kit (PDK). your shell . . . . . . 88
8.1.4 On systems with
▶ Skywater 130nm PDK. I use open_pdks to install the PDK python3 > 3.12 . . . 88
▶ Magic VLSI for layout 8.1.5 Install Tools . . . . . 88
▶ ngspice for simulation 8.1.6 Install cicconf . . . . 89
8.1.7 Install cicsim . . . . 89
▶ netgen for LVS
8.1.8 Setup your ngspice
▶ xschem settings . . . . . . . . 89
▶ python > 3.10
8.2 Check that magic
and xschem works . 90
The tools are not that big, but the PDK is huge, so you need to have
8.3 Design tutorial . . . 90
about 50 GB disk space available.
8.3.1 Create the IP . . . . . 90
8.3.2 The file structure . . 90
8.3.3 Github setup . . . . 92
8.1.1 Setup WSL (Applicable for Windows users) 8.3.4 Start working . . . . 93
8.3.5 Draw Schematic . . 93
Install a Linux distribution such as Ubuntu 24.04 LTS by running 8.3.6 Typical corner SPICE
the following command in PowerShell on Windows and follow the simulation . . . . . . 95
instructions. 8.3.7 All corners SPICE
simulations . . . . . 98
wsl --install -d Ubuntu-24.04 8.3.8 Draw Layout . . . . 100
8.3.9 Layout verification 107
When you have installed the Linux distribution and signed into it, 8.3.10 Extract layout para-
install make sitics . . . . . . . . . 109
8.3.11 Simulate with layout
sudo apt install make parasitics . . . . . . 109
8.3.12 Make documentation 110
8.3.13 Edit info.yaml . . . . 110
8.3.14 Setup github pages . 111
8.1.2 Setup public key towards github
8.3.15 Frequency asked
questions . . . . . . . 111
Do
ssh-keygen -t rsa
Then
cat ~/.ssh/id_rsa.pub
88 8 Sky130nm tutorial
And add the public key to your github account. Settings - SSH and
GPG keys
You don’t have to put aicex in $HOME/pro, but if you don’t know
where to put it, chose that directory.
cd
mkdir pro
cd pro
git clone --recursive https://github.com/wulffern/aicex.git
export PDK_ROOT=/opt/pdk/share/pdk
export LD_LIBRARY_PATH=/opt/eda/lib
export PATH=/opt/eda/bin:$HOME/.local/bin:$PATH
export PATH=/opt/eda/bin:/opt/eda/python3/bin:$HOME/.local/bin:$PAT
source ~/.bashrc
Hopefully the commands below work, if not, then try again, or try
to understand what fails. There is no point in continuing if one
command fails.
8.1 Tools 89
cd aicex/tests/
make requirements
make tt
make eda_compile
sudo make eda_install
python3 -m pip install matplotlib numpy click svgwrite pyyaml pandas tabulate wheel setuptools
source install_open_pdk.sh
cd ../..
cIcConf is used for configuration. How the IPs are connected, and
what version of IPs to get.
cd aicex/ip/cicconf
git checkout main
git pull
python3 -m pip install -e .
cd ../
Update IPs
cicconf update
cd ..
cd aicex/ip/cicsim
python3 -m pip install -e .
cd ../..
cd ~/pro/aicex/ip/sun_sar9b_sky130nm/work
magic ../design/SUN_SAR9B_SKY130NM/SUNSAR_SAR9B_CV.mag &
xschem -b ../design/SUN_SAR9B_SKY130NM/SUNSAR_SAR9B_CV.sch &
cd aicex/ip
cicconf newip ex
It matters how you name files, and store files. I would be surprised
if you had a good method already, as such, I won’t allow you
to make your own folder structure and names for things. I also
control the filenames and folder structure because there are many
scripts to make your life easier (yes, really) that rely on an exact
structure. Don’t mess with it.
We will also check that you have not cheated, and modified the
workflows just to get them passing.
.github
workflows
docs.yaml # Generate a github page
drc.yaml # Run Design Rule Checks
gds.yaml # Generate a GDS file from layout
lvs.yaml # Run Layout Versus Schematic and Layout Parasitic Extraction
sim.yaml # Run a simulation
Each IP has a few files that define the setup, you’ll need to modify
at least the README.md and the info.yaml.
▶ Schematic (.sch)
▶ Layout (.mag)
▶ Documenation (.md)
The files must have the same name, and must be stored in
design/<LIB>/ as shown below.
Note there are also two symbolic links to other libraries. These two
libraries contain standard cells and standard analog transistors
(ATR) that you should be using.
design
JNW_EX_SKY130A
JNW_EX.sch
JNW_ATR_SKY130A -> ../../jnw_atr_sky130a/design/JNW_ATR_SKY130A
JNW_TR_SKY130A -> ../../jnw_tr_sky130a/design/JNW_TR_SKY130A
For example, if the cell name was JNW_EX, then you would have
All these files are text files, so you can edit them in a text editor,
but mostly you shouldn’t (except for the Markdown)
8.3.2.4 Simulations
cd sim
make cell CELL=JNW_EX
This will make a simulation folder for you. Repeat for all your
cells.
sim
Makefile
cicsim.yaml -> ../tech/cicsim/cicsim.yaml
In the work/ folder there are startup files for Xschem (xschemrc)
and Magic (.magicrc). They tell the tools where to find the process
design kit, symbols, etc. At some point you probably need to learn
those also, but I’d wait until you feel a bit more comfortable.
work
.magicrc
Makefile
mos.24bit.dstyle -> ../tech/magic/mos.24bit.dstyle
mos.24bit.std.cmap -> ../tech/magic/mos.24bit.std.cmap
xschemrc
cd jnw_ex_sky130nm
git remote add origin \
[email protected]:<your user name>/jnw_ex_sky130nm.git
8.3 Design tutorial 93
cd work
make
Select the transistor and press ‘c’ to copy it, while dragging, press
‘shift-f’ to flip the transistor so our current mirror looks nice. ‘shift-r’
rotates the transistor, but we don’t want that now.
Select the output transistor, and change the name to ‘xo[3:0]’. Using
bus notation on the name will create 4 transistors
Select ports, and use ‘m’ to move the ports close to the transistors.
In work/
I’ve made cicsim that I use to run simulations (ngspice) and extract
results
File Description
Makefile Simulation commands
cicsim.yaml Setup for cicsim
summary.yaml Generate a README with simulation results
tran.meas Measurement to be done after simulation
tran.py Optional python script to run for each simulation
tran.spi Transient testbench
tran.yaml What measurements to summarize
cd JNW_EX
make typical
96 8 Sky130nm tutorial
IBP 0 IBPS_5U dc 5u
V0 IBNS_20U 0 dc 1
Run simulation
make typical
make typical
will skip the simulation, and rerun only the measurement. This is
why you should split the testbench and the measurement. Simula-
tions can run for days, but measurement takes seconds.
ibn:
src:
- ibns_20u
name: Output current
min: -20%
typ: 20
max: 20%
scale: 1e6
digits: 3
unit: uA
vgs:
src:
- vgs_m1
name: Gate-Source voltage
typ: 0.6
min: 0.3
max: 0.7
scale: 1
digits: 3
unit: V
Open result/tran_Sch_typical.html
You can either use ngspice, or you can use cicsim, or you can use
something I don’t know about
Load the results, and try to look at the plots. There might not be
that much interesting happening
98 8 Sky130nm tutorial
Add the following lines (they automatically plot the current and
gate voltage)
import cicsim as cs
fname = name +".png"
print(f"Saving {fname}")
cs.rawplot(name + ".raw","time","v(ibps_5u),i(v0)",ptype="",fname=f
You’ll see that cicsim writes all the png’s. Check with ls -l
output_tran/*.png.
Run
make summary
Run
On linux
On Mac
Then
lynx README.html
100 8 Sky130nm tutorial
cd work
magic ../design/JNW_EX_SKY130A/JNW_EX.mag
Now brace yourself, Magic VLSI was created in the 1980’s. For
it’s time it was extremely modern, however, today it seems dated.
However, it is free, so we use it.
Try google for most questions, and there are youtube videos that
give an intro.
▶ Magic Tutorial 1
▶ Magic Tutorial 2
▶ Magic Tutorial 3
▶ Magic command reference
▶ Magic Documentation
Default magic start with the BOX tool. Mouse left-click to select
bottom corner, left-click to select top corner.
Hotkey Function
v View all
shift-z zoom out
z zoom in
x look inside box (expand)
shift-x don’t look inside box (unexpand)
u undo
d delete
s select
Shift-Up Move cell up
Shift-Down Move cell down
Shift-Left Move cell left
Shift-Right Moce cell right
Place it. Hover over the transistor and select it with ‘s’. Now comes
a bit of tedious thing. Select again, and copy. It’s possible to align
the transistors on-top of eachother, but it’s a bit finicky.
see no *
see viali
see locali
see m1
see via1
see m2
Change to the ‘wire tool’ with spacebar. Press the top transistor ‘S’
and draw all the way down.
Select a 0.5 um box below the transistors and paint the rectangle
(middle click on locali)
Connect the sources to ground. Use the ‘wire tool’. Use ‘shift-right
click’ to change layer down
104 8 Sky130nm tutorial
8.3 Design tutorial 105
Press “space” to enter wire mode. Left click to start a wire, and
right click to end the wire.
Start the route, press ‘shift-left click’ to go up one layer, route over
to drain, and ‘shift-right click’ to go down.
8.3.8.5 Drain of M2
Select a box on a metal, and use “Edit->Text” to add labels for the
ports. Select the port button.
make lpe
cat lpe/JNW_EX_lpe.spi
VIEW=Sch
to
VIEW=Lay
Run
make typical
8.3.11.2 Corners
make all
110 8 Sky130nm tutorial
- name: Lay_typ
src: results/tran_Lay_typical
method: typical
- name: Lay_etc
src: results/tran_Lay_etc
method: minmax
- name: Lay_3std
src: results/tran_Lay_mc
method: 3std
make summary
pandoc -s -t slidy README.md -o README.html
Open the README.html and have a look a the results. The layout
should be close to the schematic simulation.
Finally, let’s setup the info.yaml so that all the github workflows
run correctly.
I’ve added the doc section such that the workflows will generate
the docs.
library: JNW_EX_SKY130A
cell: JNW_EX
author: Carsten Wulff
github: wulffern
tagline: The answer is 42
email: [email protected]
url: analogicus.github.io
8.3 Design tutorial 111
doc:
libraries:
JNW_EX_SKY130A:
- JNW_EX
sim:
JNW_EX: make typical
9.0.1.1 Supply
The temperature sensor has two supplies, one analog (3.3 V) and
one digital (1.2 V), which must come from somewhere.
We’re using Skywater, and to use the free tapeouts we must use
the Caravel test chip harness.
114 9 IC and ESD
9.0.1.2 Ground
9.0.1.3 Clocks
Most digital need a clock, and the Caravel provide a 40 MHz clock
which should suffice for most things. We could probably just use
that clock for our temperature sensor.
9.0.1.4 Digital
9.0.1.5 Bias
The Caravel does not provide bias currents (that I found), so that
is something you will need to make.
9.0.1.6 Conclusion
course plan
and now you might understand why I’ve selected the topics.
Most ICs will have a special analog block that can keep the digital
logic, bias generators, clock generators, input/output and voltage
regulators in a safe state until the power supply is high enough
(for example 1.62 V).
ESD events are tricky. They are short (ns), high current (Amps)
and poorly modeled in the SPICE model.
But ESD design is a must, you have to think about ESD, otherwise
your IC will never work.
The industry has agreed on some common test criteria for elec-
trostatic discharge. Test that model what happens when a person
touches your IC, during soldering, and PCB mounting. If your
IC passes the test then it’s probably going to survive in volume
production
Once mounted on the PCB, the ICs can be more protected against
ESD events, however, it depends on the PCB, and how that reacts
to a current.
Take a look at your USB-A connector, you will notice that the outer
pins, the power and ground, are made such that they connect first,
The 𝐷+ and 𝐷− pins are a bit shorter, so they connect some 𝜇s
later. The reason is ESD. The power and ground usually have a
low impedance connection in decoupling capacitors and power
circuits, so those can handle a large ESD zap. The signals can go
directly to an IC, and thus be more sensitive.
1.5 kOhm
100 pF
I’m pretty sure that if you leave an SSD hardrive to the heat death of
1056
100will
the universe in maybe 1010 years, then the charges pF equalize,
and the Fermi level will be the same across the whole IC, so it’s
just a matter of time.
∮ ∭
1
E · 𝑑S = 𝜌 · 𝑑𝑉
𝜕Ω 𝜖0 𝑉
This comes from the fact that if you leave a metal inside an electric
field for long enough the metal will not have any internal field. If
there was an internal field, the charges would move. Over time the
charges will be located at the ends of the metal.
Take a grounded wire, touch one of the pins on the IC. Since we
now have a metal connection between a pin and a low potential
the charges inside the IC will redistribute extremely quickly, on
the order of a few ns.
During this Charged Device Model event the internal fields in the
IC will be chaotic, but at any given point in time, the voltage across
sensitive devices must remain below where the device physically
breaks.
Take the MOSFET transistor. Between the gate and the source there
is an thin oxide, maybe a few nm. If the field strength between gate
and source is high enough, then the force felt by the electrons in
co-valent bonds will be 𝐹® = 𝑞 𝐸®. At some point the co-valent bonds
might break, and the oxide could be permanently damaged. Think
of a lighting bolt through the oxide, it’s a similar process.
Assuming some luck, then VDD1 and VDD2 are separate, but
the same voltage, or at least close enough, I can take two diodes,
connected in opposite directions, between VDD1 and VDD2. As
such, when VDD1 is grounded, VDD2 will follow but maybe be
0.6 V higher. As a result, the PMOS gate never sees more than
approximately 0.6 V across the gate oxide, and everyone is happy.
CDM is tricky, because there are so many details, and it’s easy to
miss one that makes your circuit break.
Imagine a ESD zap between VSS and VDD. How can we protect
the device?
The positive current enters the VSS, and leaves via the VDD, so
our supplies are flipped up-side down. It’s a fair assumption that
none of the circuits inside will work as intended.
But the IC must not die, so we have to lead the current to ground
somehow
122 9 IC and ESD
100 k
1.5 k
100 pF
9.3 Permutations
DD
e
ON 1 vs euro
1 to vno vss
us a Pin
of 2 pin
pin a Uss 2
2 to
1 02 vase PIN
PIN a Vbs
2 A 1
Uss
O
When the current enters VSS and must leave via VDD, then it’s
simple, we can use a diode.
I un
PIN
2
on
O Uss
The same is true for current in on VSS and out on PIN. Here we
can also use a diode.
VDP
g
2 PIN
on or
O Uss
For those from Norway that have played a kids game Bjørnen sover,
that’s a apt mental image. We want a circuit that most of the time
124 9 IC and ESD
sleeps, and does not affect our normal IC operation. But if a huge
current comes in on VDD, and the VDD voltage shoots up fast, the
circuit must wake up and bring the voltage down.
V70
y or
on
1 NO PIN
É
or
2
Uss p
O
2,6A
9.3 Permutations 125
If you try the circuit above in with the normal BSIM spice model,
it will not work. The transistor model does not include that part of
the physics.
Electrons can move freely in the conduction band (until they hit
something, or scatter), and electrons moving in the valence band
act like positive particles, nicknamed holes.
Assume a transistor like the one below. The gate, source and bulk
is connected to ground. The drain is connected to a high voltage.
126 9 IC and ESD
I
ht 30
r
ht
Pto
P
9.3.1.3 Avalanche
The first thing that can happen is that the field in the depletion
zone between drain and bulk (1) is large, due to the high voltage
on drain, and the thin depletion region.
In the substrate (P-) there are mostly holes, but there are also
electrons. If an electron diffuses close to the drain region it will be
swept across to drain by the high field.
The high field might accelerate the electron to such an energy that
it can, when it scatters of the atoms in the depletion zone, knock
out an electron/hole pair.
The hole will go to the substrate (2), while the new electron will
continue towards drain. The new electron can also knock out a
new electron/hole pair (energy level is set by impact ionization of
the atom), so can the old one assuming it accelerates enough.
One electron turn into two, two to four, four to eight and so on.
The number of electrons can quickly become large, and we have an
avalanche condition. Same as a snow avalanche, where everything
was quiet and nice, now suddenly, there is a big trouble.
The extra holes underneath the transistor will increase the local
potential. If the substrate contact (5) is far away, then the local
potential close to the source/bulk PN-junction (3) might increase
enough to significantly increase the number of electrons injected
from source.
9.3 Permutations 127
Some of the electrons will find a hole, and settle down, while others
will diffuse around. If some of the electrons gets close to the drain
region, and the field in the depletion zone, they will be accelerated
by the drain/bulk field, and can further increase the avalanche
condition.
Turns out, that every single NMOS has a sleeping bear. A parasitic
bipolar. That’s exactly what this GGNMOS is, a bipolar transis-
tor, although a pretty bad one, that is designed to trigger when
avalanche condition sets in and is designed to survive.
A normal NMOS, however, can also trigger, and if you have not
thought about limiting the electron current, it can die, with IC
killing consequences. Specifically, the drain and source will be
shorted by likely the silicide on top of the drain, and instead of a
transistor with high output impedance, we’ll have a drain source
connection with a few kOhm output impedance.
Mt
lo too
O o
Toome tooma
Some of the holes can reach the depletion region towards our
NMOS, and be swept across the junction.
9.3 Permutations 129
9.3.2.4 Positive-feedback
Maybe it seems like a rare event for latch-up to happen, but trust
me, it’s real, and it can happen in the strangest places. Similar to
ESD, it’s a problem that can kill an IC, and make us pay another X
million dollars for a new tapeout, in addition to the layout work
needed to fix it.
Latch-up is why you will find the design rule check complaining if
you don’t have enough substrate connections to ground, or N-well
connections to power close to your transistors.
▶ Do everything yourself
▶ Use libraries from foundry
▶ Get help www.sofics.com
130 9 IC and ESD
10.1 Routing
We’ve invented this magical place called ground, the final resting
place of all electrons, and we have agreed that all voltages refer to
that point.
Most of the time, in order not to think about the ground impedance,
we choose to route a known quantity as a current instead of a
voltage. That means, however, we must convert from a voltage to a
current, but we can do that with a resistor (you’ll see later), and
as long as the resistor is the same on the other side of the IC, then
we’ll know what the voltage is.
But what if I must have 0.5 % 3-sigma voltage in the block? For
example in a battery charger, where the 4.3 V termination voltage
must be 1 % accurate? I have no choice but to go with voltage
directly from the reference, but the key point, is then the receiving
block cannot be on the other side of the IC. The reference must be
right next to my block.
I could use two references on my IC, one for the ADC and one
for the battery charger. Ask yourself, “Why do we care if there is
two references?” And the answer is “Silicon area is expensive, to
make things cheep, we must make things small”, in other words,
we should not duplicate features unless we absolutely have to.
𝑉𝐵𝐸
𝑉𝐵𝐸
𝐼 𝐷 = 𝐼𝑆 𝑒 𝑉𝑇
− 1 + 𝐼 𝐵 ≈ 𝐼𝑆 𝑒 𝑉𝑇
𝑘𝑇
𝑉𝑇 =
𝑞
𝑘𝑇 𝐼𝐶
𝑉𝐵𝐸 = ln
𝑞 𝐼𝑆
𝐷𝑛 𝐷𝑝
𝐼𝑆 = 𝑞𝐴𝑛 𝑖2 +
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
However, it turns out that the 𝑉𝐵𝐸 decreases with temperature due
to the temperature dependence of 𝐼𝑆 .
𝑘𝑇
𝑉𝐵𝐸 = (ℓ − 3 ln 𝑇) + 𝑉𝐺
𝑞
𝐷𝑛 𝐷𝑝 2𝜋𝑘
3 3
ℓ = ln 𝐼𝐶 −ln 𝑞𝐴−ln + −2 ln 2− ln 𝑚𝑛∗ − ln 𝑚 𝑝∗ −3 ln 2
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷 2 2 ℎ
And if we plot the diode voltage, we can see that the voltage
decreases as a function of temperature.
10.2 Bandgap voltage reference 135
0.95
Diode voltage [V]
0.90
0.85
25 0 25 50 75 100 125
Non-linear component (mV)
2
25 0 25 50 75 100 125
Temperature [C]
𝐼𝐷
𝑉𝐷 1 = 𝑉𝑇 ln
𝐼𝑆1
𝐼𝐷
𝑉𝐷 2 = 𝑉𝑇 ln
𝐼𝑆2
The OTA will force the voltage on top of the resistor to be equal to
𝑉𝐷 1 , thus the voltage across the resistor 𝑅 1 is
𝐼𝐷 𝐼𝐷 𝐼𝑆2
𝑉𝐷 1 − 𝑉𝐷 2 = 𝑉𝑇 ln − 𝑉𝑇 ln = 𝑉𝑇 ln = 𝑉𝑇 ln 𝑁
𝐼𝑆1 𝐼𝑆2 𝐼𝑆1
We often call this voltage Δ𝑉𝐷 or Δ𝑉𝐵𝐸 , and we can clearly see it’s
proportional to absolute temperature.
136 10 References and bias
ID
a verb in
R1
V02
I N 1 N
D1 D2 D
VREE
R2
10.2.3 How to R2a PTAT ?
combine a CTAT with
Vn
R1
V02
I N
One method is the figure below. The voltage across resistor 𝑅 2
would compensate for the decrease in 𝑉𝐷 3 , as such, 𝑅 2 would be
bigger than 𝑅 1 . D1 D2
10.2 Bandgap voltage reference 137
VREE
rb in
1 R ID RL
2 V02 V02
1 Na verb in
D Dz 03
R1 R R
V02 V02 V0
I N 1 N
D1 D2
Another method would be to stack the 𝑅 2 on top of 𝑅 1 as shown D Dz 0
below.
VREE
VREE
R2 R2
Vn
R1
V02
I N
D1 D2
138 10 References and bias
I 1 D
Rz Ry
I Ia Va IR
Q Q2
In
8
use
Ere
É V21 VBG VRtVBE
N
The opamp ensures the two bipolars have the same current. 𝑄 1 is
larger than 𝑄 2 . The Δ𝑉𝐵𝐸 is across the 𝑅 2 , so we know the current
𝐼 . We know that 𝑅1 must then have 2𝐼 .
𝑘𝑇 𝑇0 𝑘 𝐽2 2𝑅 2 𝑉𝐺0 − 𝑉𝑏𝑒 0
𝑉𝐵𝐺 = 𝑉𝐺0 + (𝑚 − 1) ln +𝑇 ln −
𝑞 𝑇 𝑞 𝐽1 𝑅 1 𝑇0
to do I
where 𝑉𝐺0 is the bandgap, 𝑉𝑏𝑒 0 is the base emitter measured at a
temperature 𝑇0 and the 𝐽 ’s are the current densities.
𝑅2 𝑉𝐺0 − 𝑉𝑏𝑒 0
=
𝑅1 2𝑇0 𝑘 ln( 𝐽2 )
𝑞 𝐽1
10.2 Bandgap voltage reference 139
𝑘𝑇 𝑇0
𝑉𝐵𝐺 = 𝑉𝐺0 + (𝑚 − 1) ln
𝑞 𝑇
In real ICs though, you should ask yourself long and hard whether
you really need these low-voltage references. Most ICs today still
have a high voltage, either 1.8 V or 3.0 V.
Δ𝑉𝐷
𝐼1 =
𝑅1
TN
In the figure below I’ve used Δ𝑉𝐵𝐸 , it’s the same as Δ𝑉𝐷 , so ignore
that error.
𝑉𝐷
𝐼2 =
𝑅2
I WE
R
R2
9N
Ra in
ti NE R
Iz
13g
𝑉𝐷 Δ𝑉𝐷
𝐼𝑃𝑀𝑂𝑆 = +
𝑅2 𝑅1
𝑉𝐷 Δ𝑉𝐷
𝑉𝑂𝑈𝑇 = 𝑅3 +
𝑅2 𝑅1
Where the output voltage can be chosen freely, and indeed be lower
than 1.2 V.
p p
ti MI p
12 152
Rz
10.3 Bias
On-chip we don’t have accurate resistors, but for bias currents, it’s
usually ok with + − 20 variation (the variation of R).
IRV
R
Ib ImmbxEMVet
lil Vett
ITEM
j vett Mf V
6Me Y
T
1 1
Velt 2V
Vo Veltz
KI
F Vo ZI
Vet
ist Ist
Z
Its
y
Sometimes we don’t need a full bandgap reference. In those cases,
we can use a GM cell, where the impedance could be a resistor, in
which case
Vo Vo
𝑉𝑜 = 𝑉𝐺𝑆1 − 𝑉𝐺𝑆2 = 𝑉𝑒 𝑓 𝑓 1 + Z gu ta
𝑉𝑡𝑛 − 𝑉𝑒 𝑓 𝑓 2 − 𝑉𝑡𝑛 = 𝑉𝑒 𝑓 𝑓 1 − 𝑉𝑒 𝑓 𝑓 2
10.3 Bias 145
1 𝑊1 2
𝐼𝐷 1 = 𝜇𝑛 𝐶 𝑜𝑥 𝑉
2 𝐿1 𝑒 𝑓 𝑓 1
1 𝑊1
𝐼𝐷 2 = 𝜇𝑛 𝐶 𝑜𝑥 4 𝑉𝑒2𝑓 𝑓 2
2 𝐿1
𝐼𝐷 1 = 𝐼𝐷 2
1 𝑊1 2 1 𝑊1
𝜇𝑛 𝐶 𝑜𝑥 𝑉𝑒 𝑓 𝑓 1 = 𝜇𝑛 𝐶 𝑜𝑥 4 𝑉𝑒2𝑓 𝑓 2
2 𝐿1 2 𝐿1
𝑉𝑒 𝑓 𝑓 1 = 2𝑉𝑒 𝑓 𝑓 2
1 1
𝑉𝑜 = 𝑉𝑒 𝑓 𝑓 1 − 𝑉𝑒 𝑓 𝑓 1 = 𝑉𝑒 𝑓 𝑓 1
2 2
2𝐼 𝑑
𝑔𝑚 =
𝑉𝑒 𝑓 𝑓
we find that
𝑉𝑒 𝑓 𝑓 1
𝐼=
2𝑍
1
𝑍⇒
𝑔𝑚
Vo
Vo
z Co g arr
air
C E
V I R Qc Vo C
10.4 Want to learn more?
I Qf
A simple three-terminal IC bandgap reference
An ADC will have a sample rate, and will alias (or fold) any signal
Why
above half the sample rate, as such, we also must include a anti-
alias filter in AFE that reduces any signal outside the bandwidth
of the ADC as close to zero as we need.
Frequency selectivity
discrete time?
Discrete value
Bits
(Quantization)
Domain transfer
low number of bits, assume 8-bits for the signal is more than
enough.
7 mV
ADC resolution ⇒ ln /ln 2 ≈ 18 bits
28 nV
𝑃
𝐹𝑂 𝑀 =
2𝐸𝑁 𝑂𝐵 𝑓 𝑠
205 mAh
Hours = = 0.6 h
1.32 W/3.8 V
I know a little bit about radio’s, especially inside the Whoop, since
it has
Nordic Inside
Amplification
Frequency selectivity
discrete time?
Discrete value
Bits
(Quantization)
Domain transfer 11.2 Filters 149
I can’t tell you how the Nordic radio works, but I can tell you
how others usually make their radio’s. The typical radio below has
multiple blocks in the AFE.
AFErejects ADC
bandwidth of the wanted signal. Then there is a complex anti-alias
Sensor
filter, also called RFE filter, which
a poly-phase parts of the
unwanted signals. Lastly there is a complex ADC to convert to
digital.
The AFE makes the system more efficient. In the 5 GHz ADC
output, from the example above, there’s lot’s of information that
we don’t use.
There are instances, though, where the full 2.5 GHz bandwidth has
useful information. Imagine in a cellular base station that should
process multiple cell-phones at the same time. In that case, it could
make sense with an ADC at the antenna.
11.2 Filters
Once we have the first and second order stages, we can start looking
into circuits.
In the book they use signal flow graphs to show how the first
order stage can be generated. By selecting the coefficients 𝑘 0 , 𝑘 1
and 𝜔0 we can get any first order filter, and thus match the 𝐻(𝑠)
we want.
I would encourage you to try and derive from the signal flow graph
the 𝐻(𝑠) and prove to your self the equation is correct.
Vi Ys Vo
order
Signal flow graphs are useful when dealing with linear systems.
Second The instructions to compute the transfer functions are
𝑉𝑜 (𝑠) 𝑘 1 𝑠 + 𝑘 0
𝐻(𝑠) = =
𝑉𝑖 (𝑠) 𝑠 + 𝑤𝑜
Vi ko V0
𝑢 = (𝑘 0 + 𝑘 1 𝑠)𝑉𝑖 − 𝜔0𝑉𝑜
Ks
𝑉𝑜 = 𝑢/𝑠
𝑢 = 𝑉𝑜 𝑠 = (𝑘 0 + 𝑘1 𝑠)𝑉𝑖 − 𝜔0𝑉𝑜
Second order
(𝑠 + 𝜔0 )𝑉𝑜 = (𝑘 0 + 𝑘 1 𝑠)𝑉𝑖
𝑉𝑜 𝑘1 𝑠 + 𝑘0
=
𝑉𝑖 𝑠 + 𝜔0
V25
Bi-quadratic is a general purpose second order filter.
Wo
Wo Q
Vi kowo wo
V0
has
𝑘2 𝑠 2 + 𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 2 + 𝜔𝑄0 𝑠 + 𝜔2𝑜
Follow exactly the same principles as for first order signal flow
graph. If you fail, and you can’t find the problem with your algebra,
then maybe you need to use Maple or Mathcad.
152 11 Analog frontend and filters
While I’m sure you can invent new types of filters, and there
probably are advanced filters, I would say there is roughly three
types. Passive filters, that do not have gain. Active-RC filters, with
OTAs, and usually trivial to make linear. And Gm-C filters, where
we use the transconductance of a transistor and a capacitor to
set the coefficients. Gm-C are usually more power efficient than
Active-RC, but they are also more difficult to make linear.
11.3 Gm-C
In the figure below you can see a typical Gm-C filter and the
equations for the transfer function. One important thing to note
is that this is Gm with capital G, not the 𝑔𝑚 that we use for small
signal analysis.
Gnc
In a Gm-C filter the input and output nodes can have significant
swing, and thus cannot always be considered small signal.
to
Io
Vi Gm Vo Vo
c
Wti
𝐼𝑜 𝜔𝑡𝑖
𝑉𝑜 = = 𝑉𝑖
𝑠𝐶 𝑠
𝜔𝑡𝑖 =Io𝐺𝐶𝑚
V
Vi am
I
Vi Gm IE WE
11.3 Gm-C 153
gmVi
V
Vit ut
Gm
I
am
I c
to Gulf
grivi guv
Vo Vo
I
IE
e
𝑠𝐶𝑉𝑜 = 𝐺 𝑚 𝑉 𝑖
𝑉𝑜 𝐺𝑚
WEVi
𝐻(𝑠) = = 2
𝑉𝑖 𝑠𝐶
wei
of Crease
Differential circuits are fantastic for multiple reasons, power supply
rejection ratio, noise immunity, symmetric non-linearity, but the
qualities I like the most is that the outputs can be flipped to
Use 3D cap
figure
implement negative, or positive gain.
i
V
ut
I
am
I c
guv
𝑉𝑜 𝐺𝑚
𝐻(𝑠) = =−
𝑉𝑖 𝑠𝐶
figure
154 11 Analog frontend and filters
ex
Ganz
is
Vi s iz
Gm
i t Vols
do
do
i
is
iz
Gy
Given the transfer function from the signal flow graph, we see that
G
we can select 𝐶 𝑥 , 𝐶 𝑎 and 𝐺 𝑚 to get the desired 𝑘 ’s and 𝜔0Gs
or
Ca
GL CB
𝑘1 𝑠 + 𝑘0
Vi G 𝐻(𝑠) =
𝑠 + 𝑤𝑜
63
Vo
𝑠 𝐶 𝑎𝐶+𝐶
𝑥
𝑥
+ 𝐺𝑚1
𝐶 𝑎 +𝐶 𝑥
𝐻(𝑠) = 𝐺𝑚2
𝑠+ 𝐶 𝑎 +𝐶 𝑥
20
Guy Gms
Vin
20
𝑘2 𝑠 2 + 𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 2 + 𝜔𝑄0 𝑠 + 𝜔2𝑜
11.3 Gm-C 155
𝑠 2 𝐶𝑋𝐶+𝐶
𝑋
𝐵
+ 𝑠 𝐶𝑋𝐺+𝐶
𝑚5
𝐵
+ 𝐺𝑚2 𝐺𝑚4
𝐶 𝐴 (𝐶 𝑋 +𝐶 𝐵 )
𝐻(𝑠) =
𝑠 2 + 𝑠 𝐶𝑋𝐺+𝐶
𝑚2
𝐵
+ 𝐺𝑚1 𝐺𝑚2
𝐶 𝐴 (𝐶 𝑋 +𝐶 𝐵 )
Although you can start with the Gm-C cells in the book, I would
actually choose to look at a few papers first.
The main reason is that any book is many years old. Ideas turn
into papers, papers turn into books, and by the time you read the
book, then there might be more optimal circuits for the technology
you work in.
And from Figure 10 a) we can see it’s a similar Gm-C cell as chapter
12.5.4 in CJM.
Vdd
Vcmf b
M3a M3b
io Vdd Vdd i+
o
M2a M2b
Vbn Mbn1
Vss
72
11.4.1 General purpose first order filter
Below is a general purpose first order filter and the transfer function.
I’ve used the condutance 𝐺 = 𝑅1 instead of the resistance. The
reason is that it sometimes makes the equations easier to work
out.
Once in a while, however, you will have a problem where you must
calculate the transfer function. Sometimes it’s because you’ll need
to understand where the poles/zeros are in a circuit, or you’re
trying to come up with a clever idea, or I decide to give this exact
problem on the exam.
11.4 Active-RC 157
Ga
Ven Ci Cr
Vout
G
𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 + 𝑤𝑜
− 𝐶𝐶12 𝑠 − 𝐺1
𝐶2
𝐻(𝑠) = 𝐺2
𝑠+ 𝐶2
VI
11.4.1.1 Step 1: Simplify Vo
The conductance from 𝑉𝑖𝑛 to virtual ground can be written as
𝐺 𝑖𝑛 = 𝐺1 + 𝑠𝐶1
𝐺 𝑓 𝑏 = 𝐺2 + 𝑠𝐶2
An ideal OTA will force its inputs to be the same. As a result, the
potential at OTA− input must be 0.
𝐼 𝑖𝑛 = 𝐺 𝑖𝑛 𝑉𝑖𝑛
Here it’s important to remember that there is no way for the input
current to enter the OTA. The OTA is high impedance. The input
current must escape through the output conductance 𝐺 𝑓 𝑏 .
What actually happens is that the OTA will change the output
voltage 𝑉𝑜𝑢𝑡 until the feedback current , 𝐼 𝑓 𝑏 , exactly matches 𝐼 𝑖𝑛 .
158 11 Analog frontend and filters
But, for now, to make our lifes simpler, we assume the OTA is ideal.
That makes the equations pretty, and we know what we should
get if the OTA actually was ideal.
𝐼 𝑜𝑢𝑡 = 𝐺 𝑓 𝑏 𝑉𝑜𝑢𝑡
𝐼 𝑖𝑛 + 𝐼 𝑜𝑢𝑡 = 0
11.4 Active-RC 159
𝑉𝑜𝑢𝑡 𝐺 𝑖𝑛
=−
𝑉𝑖𝑛 𝐺 𝑜𝑢𝑡
𝐺1 + 𝑠𝐶1
=−
𝐺2 + 𝑠𝐶2
−𝑠 𝐶𝐶21 − 𝐺1
𝐶2
= 𝐺2
𝑠+ 𝐶2
Gy
G Gs
or
Ca
L
CB
Vi G
63
Vo
𝑘2 𝑠 2 + 𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 2 + 𝜔𝑄0 𝑠 + 𝜔2𝑜
h i
𝐶1 2
𝐶𝐵 𝑠 + 𝐺2
𝐶𝐵 𝑠 + ( 𝐶𝐺𝐴1 𝐺𝐶𝐵3 )
𝐻(𝑠) = h i
𝐺5 𝐺3 𝐺4
𝑠2 + 𝐶𝐵 𝑠 + 𝐶𝐴 𝐶𝐵
160 11 Analog frontend and filters
VI
Vo
𝐴0
𝐻(𝑠) ≈ 𝑠
(1 + 𝑠𝐴 𝑜 𝑅𝐶)(1 + 𝑤 𝑡𝑎 )
where
𝐴0
is the gain of the amplifier, and
𝜔𝑡 𝑎
One place where both active-RC and Gm-C filters find a home are
continuous time sigma-delta modulators. More on SD later, for now,
just know that SD us a combination of high-gain, filtering, simple
ADCs and simple DACs to make high resolution analog-to-digital
converters.
Below we see the actual circuit. It may look complex, and it is.
We can see there are two paths “i” and “q”, for “in-phase” and
“quadrature-phase”. The fantasitc thing about complex ADCs is
that we can have a-symmetric frequency response around 0 Hz.
With a complex ADC like this, the first thing to understand is the
rough structure.
There are two paths, each path contains 2 ADCs connected in series
(Multi-stage Noise-Shaping or MASH). Understanding everything
at once does not make sence.
Start with “Vpi” and “Vmi”, make it into a single path (set Rfb1
and Rfb2 to infinite), ignore what happens after R3 and DAC2i.
Now we have a continuous time sigma delta with two stages. First
stage is a integrator (R1 and C1), and second stage is a filter (Cff1,
R2 and C2). The amplified and filtered signal is sampled by the
ADC1i and fed back to the input DAC1i.
It’s possible to show that if the gain from 𝑉(𝑉 𝑝𝑖, 𝑉 𝑝𝑚) to ADC1i
input is large, then 𝑌 1 𝑖 = 𝑉(𝑉 𝑝𝑖, 𝑉 𝑝𝑚) at low frequencies.
Over the years I’ve developed a love for the current mirror OTA. A
single stage, with load compensation, and an adaptable range of
DC gains.
162 11 Analog frontend and filters
1 1
Von Vop
Vin Vip
VCREF
The reference for the common mode can be from a bandgap, or in
the case below, VDD/2. VCOUT
11.7 My favorite OTA 163
Von Vop
VCREF
VCOUT
Once we have both the sensed common mode, and the common
mode reference, we can use another OTA to control the common
mode.
The nice thing about the circuit below is that the common mode
feedback loop has the same dominant pole as the differential
loop.
Von Vop
VCOUT VCREF
CNR_OTA_SKY130NM
164 11 Analog frontend and filters
Active resistor capacitor filters are made with OTAs (high output
impedance) or OPAMP (low output impedance). Active amplifiers
will consume current, and in Active-RC the amplifiers are always
on, so there is no opportunity to reduce the current consumption
by duty-cycling (turning on and off).
𝐺 1
𝜔 𝑝|𝑧 ∝ =
𝐶 𝑅𝐶
166 12 Switched-Capacitor Circuits
q √
𝜎𝑅𝐶 = 𝜎𝑅2 + 𝜎𝐶2 = 0.022 + 0.022 = 0.028 = 28 %
12.2 Gm-C
20
Guy Gms
Vin
20
h i
𝑠 2 𝐶𝑋𝐶+𝐶
𝑋
𝐵
+ 𝑠 𝐶𝑋𝐺+𝐶
𝑚5
𝐵
+ 𝐺𝑚2 𝐺𝑚4
𝐶 𝐴 (𝐶 𝑋 +𝐶 𝐵 )
𝐻(𝑠) = h i
𝑠 2 + 𝑠 𝐶𝑋𝐺+𝐶
𝑚2
𝐵
+ 𝐺𝑚1 𝐺𝑚2
𝐶 𝐴 (𝐶 𝑋 +𝐶 𝐵 )
𝐺𝑚
𝜔 𝑝|𝑧 ∝
𝐶
The first time you encounter Switched Capacitor (SC) circuits, they
do require some brain training. So let’s start simple.
Consider the circuit below. Assume that the two transistors are
ideal (no-charge injection, no resistance).
168 12 Switched-Capacitor Circuits
Vi
zi 0
C
Q
Vgud
𝑄 𝜙2$ = 𝐶1𝑉𝐺𝑁 𝐷 = 0
9 a
And from SI units units we can see current is
𝑄
𝐼𝐼 = = 𝑄 𝑓𝜙
𝑑𝑡
Vi Vo
Charge cannot disappear, charge is conserved. As such, the charge
Zi
going out from the input must be equal to the difference of charge
C
at the end of phase 1 and phase 2.
𝑉𝐼 − 𝑉𝐺𝑁 𝐷
𝑍𝐼 =
𝑄 𝜙1$ − 𝑄 𝜙2$ 𝑓𝜙
‗I use the $ to mark the end of the period. It comes from Regular Expressions.
12.3 Switched capacitor 169
Vi
zi
Inserting for the charges, we can see that the impedance is
0
𝑉𝐼 1
𝑍𝐼 = =
(𝑉𝐼 𝐶 − 0) 𝑓𝜙 𝐶1 𝑓𝜙
C
A common confusion with SC circuits is to confuse the impedance
of a capacitor 𝑍 = 1/𝑠𝐶 with the impedance of a SC circuit
Q
𝑍 = 1/ 𝑓 𝐶 . The impedance of a capacitor is complex (varies with
Vgud
frequency and time), while the SC circuit impedance is real (a
resistance).
The circuit below is drawn slightly differently, but the same equa-
tion applies.
V0
Vi
zi C
Vi Vo
𝑄 𝜙1$ = 𝐶1 (𝑉𝐼 − 𝑉𝑂 )
Zi C
𝑄 𝜙2$ = 0
𝑉𝐼 − 𝑉𝑂 1
𝑍𝐼 = =
(𝐶1 (𝑉𝐼 − 𝑉𝑂 )) 𝑓𝜙 𝐶1 𝑓𝜙
9 a
Vi Vo
Zi C
𝑉𝐼 − 𝑉𝑂
𝑍𝐼 =
𝑄 𝜙1$ − 𝑄 𝜙2$ 𝑓𝜙
𝑄 𝜙1$ = 𝐶1𝑉𝐼 )
𝑄 𝜙2$ = 𝐶1𝑉𝑂
𝑉𝐼 − 𝑉𝑂 1
𝑍𝐼 = =
(𝐶1𝑉𝐼 − 𝐶1𝑉𝑂 )) 𝑓𝜙 𝐶1 𝑓𝜙
The first time I saw the circuit above it was not obvious to me that
the impedance still was 𝑍 = 1/𝐶 𝑓 . It’s one of the cases where
mathematics is a useful tool. I could follow a set of rules (charge
conservation), and as long as I did the mathematics right, then
from the equations, I could see how it worked.
The switches disconnect the OTA and capacitors for half the time,
but for the other half, at least for the latter parts of 𝜙2 the gain is
four.
The output is only correct for a finite, but periodic, time interval.
The circuit is discrete time. As long as all circuits afterwards also
have a discrete-time input, then it’s fine. An ADC can sample the
output from the amplifier at the right time, and never notice that
the output is shorted to a DC voltage in 𝜙1
𝑄 1 = 4𝐶𝑉𝑖𝑛
Assume the designer of the circuit has done a proper job, then the
𝑄 1 charge will be found on the feedback capacitors.
𝑄1 = 4𝐶𝑉𝑖𝑛 = 𝑄 2 = 𝐶𝑉𝑜𝑢𝑡
The gain is
𝑉𝑜𝑢𝑡
𝐴= =4
𝑉𝑖𝑛
𝐶1
𝜔 𝑝|𝑧 ∝
𝐶2
Define
𝑥𝑐
as a continuous time, continuous value signal
Define (
1 if 𝑡 ≥ 0
ℓ (𝑡) =
0 if 𝑡 < 0
Define
𝑥 𝑐 (𝑛𝑇)
𝑥 𝑠𝑛 (𝑡) = [ℓ (𝑡 − 𝑛𝑇) − ℓ (𝑡 − 𝑛𝑇 − 𝜏)]
𝜏
Define
∞
X
𝑥 𝑠 (𝑡) = 𝑥 𝑠𝑛 (𝑡)
𝑛=−∞
Why do this?
If
∞
X
𝑥 𝑠 (𝑡) = 𝑥 𝑠𝑛 (𝑡)
𝑛=−∞
Then
1 1 − 𝑒 −𝑠𝜏
𝑋𝑠𝑛 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝜏 𝑠
And
∞
1 1 − 𝑒 −𝑠𝜏 X
𝑋𝑠 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝜏 𝑠 𝑛=−∞
174 12 Switched-Capacitor Circuits
Thus
∞
X
lim → 𝑋𝑠 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝜏→0 𝑛=−∞
Or
∞
𝑗 𝑘 2𝜋
1 X
𝑋𝑠 (𝑗𝜔) = 𝑋𝑐 𝑗𝜔 −
𝑇 𝑘=−∞ 𝑇
or equivalently
When you sample a signal, then there will be copies of the input
spectrum at every
𝑛 𝑓𝑠
0 → 𝑓𝑠 1 /2
or
− 𝑓𝑠 1 /2 → 𝑓𝑠 1 /2
for a complex FFT
If your signal processing skills are a bit thin, now might be a good
time to read up on FFT, Laplace transform and But what is the
Fourier Transform?
The code below has four main sections. First is the time vector.
I use Numpy, which has a bunch of useful features for creating
ranges, and arrays.
dt.py
Try to play with the code, and see if you can understand what it
does.
Below are the plots. On the left side is the “continuous value,
continuous time” emulation, on the right side “discrete time,
continuous value”.
The top plots are the time domain, while the bottom plots is
frequency domain.
The FFT is complex, so that’s why there are six sinusoids bottom
left. The “0 Hz” would be at x-axis index 4096 (213 /2).
The spectral copies can be seen bottom right. How many spectral
copies, and the distance between them will depend on the sample
rate (length of t_s_unit). Try to play around with the code and
see what happens.
176 12 Switched-Capacitor Circuits
2.0 2.0
1.5 1.5
1.0 1.0
0.5 0.5
Time Domain
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
0 2000 4000 6000 8000 0 2000 4000 6000 8000
60
60
40
40
20
Frequency Domain
20
0
0
20
20
40
40
60
60
80
0 2000 4000 6000 8000 0 2000 4000 6000 8000
Continuous time, continuous value Discrete time, continuous value
I want you to internalize that the spectral copies are real. They
are not some “mathematical construct” that we don’t have to deal
with.
Before Saulius
P T
Es th
N it it
th f ask o
After sampling
8 I
Es th
i Iii th Is
f
Before Sampling
Anti Alias
P T
Es th
N it it
th f ask o
12.4 Discrete-Time Signals 177
After sampling
With an anti-alias filter (yellow) we ensure that the unwanted
Iii
components are low enough before sampling. As a result, our
wanted signal (green) is undisturbed.
8 I i f
Es th th Is
Before Sampling
Anti Alias
ot I o LP o SH o
Es th it th f
After sampling
8 1 I f
Es th th f
Before Sampling
AEs p th I I
th Is
M a app ask o
A
After sampling
o 1 I p p 1 I f
Es th th f
12.4.4 Z-transform
∞
X
𝑋𝑠 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝑛=−∞
∞
X
𝑋𝑠 (𝑧) = 𝑥 𝑐 [𝑛]𝑧 −𝑛
𝑛=−∞
The nice thing with the Z-transform is that the exponent of the
z tell’s you how much delayed the sample 𝑥 𝑐 [𝑛] is. A block that
delays a signal by 1 sample could be described as 𝑥 𝑐 [𝑛]𝑧 −1 , and an
accumulator
𝑌(𝑧) 1
=
𝑋(𝑧) 1 − 𝑧 −1
If the “x” is 𝑎 < 0, then any perturbation will eventually die out. If
the “x” is on the 𝑎 = 0 line, then we have a oscillator that will ring
forever. If the “x” is 𝑎 > 0 then the oscillation amplitude will grow
without bounds, although, only in Matlab. In any physical circuit
an oscillation cannot grow without bounds forever.
jw s atjw
a
X
poles
12.4.6 Z-domain 440
O
0 repeat every
Spectra Leros ifs𝜋
2
Discrete time
180 12 Switched-Capacitor Circuits a
X
As such, it does not make sense to talk about a plane with a 𝑎 and
a 𝑗𝜔 . Rather we use the complex number 𝑧 = 𝑎 + 𝑗𝑏 .
As long as the poles (“x”) are within the unit circle, oscillations
will die out. If the poles are on the unit-circle, then we have an
oscillator. Outside the unit circle the oscillation will grow without
poles 440
bounds, or in other words, be unstable.
O
ifs
Bi-linear transform
0 Leros
𝑧−1
𝑠=
𝑧+1
Discrete time
Warning: First-order approximation https://en.wikipedia.org/w
iki/Bilinear_transform
Z plane
b
jw Zsa
g
x
x
The “n” index and the “z” exponent can be chosen freely, which
sometimes can help the algebra.
𝑏
𝐻(𝑧) =
𝑧−𝑎
From the discrete time equation we can see that the impulse will
never die out. We’re adding the previous output to the current
input. That means the circuit has infinite memory. Accordingly,
filters of this type are known as. Infinite-impulse response (IIR)
(
𝑘 if 𝑛 < 1
ℎ[𝑛] =
𝑎 𝑛−1 𝑏 + 𝑎 𝑛 𝑘 if 𝑛 ≥ 1
From the impulse response it can be seen that if 𝑎 > 1, then the
filter is unstable. Same if 𝑏 > 1. As long as |𝑎 + 𝑗𝑏| < 1 the filter
should be stable.
First order
Hz Ia
stable
unstable
akestan
66 ha
It t a
xD
gylate
Aza Sta yEnt1
The first order filter can be implemented in python, and it’s really
not hard. See below. The 𝑥 𝑠 𝑛 vector is from the previous python
example.
FIR
There are smarter, and faster ways to do IIR filters (and FIR) in
112
python, see scipy.signal.iirfilter
H t Ea
E
z Hee
182 12 Switched-Capacitor Circuits
1.00 1.00
0.75 0.75
0.50 0.50
0.25 0.25
Time Domain
0.00 0.00
0.25 0.25
0.50 0.50
0.75 0.75
1.00 1.00
1000 1050 1100 1150 1200 1250 1300 1350 1400 1000 1050 1100 1150 1200 1250 1300 1350 1400
60
40
40
20 20
Frequency Domain
0 0
20
20
40
40
60
60 80
0 2000 4000 6000 8000 0 2000 4000 6000 8000
Sampled IIR Filter
#- IIR filter
b = 0.3
a = 0.25
z = a + 1j*b
z_abs = np.abs(z)
print("|z| = " + str(z_abs))
y = np.zeros(N)
y[0] = a
for i in range(1,N):
y[i] = b*x_sn[i-1] + y[i-1]
But be wary of rules like “IIR are always better than FIR” or visa
versa. Especially if statements are written in books. Remember that
the book was probably written a decade ago, and based on papers
two decades old, which were based on three decades old state of
Fitt impulse repose Infinite inputs
e response
12.5 Switched-Capacitor
183
H t Ea
E
z
the art. Our abilities to use computers for design has improved a Hee
bit the last three decades.
hlultakestan
2
1X
𝐻(𝑧) = 𝑧 −1
3 𝑖=0
XE
4
43
Iya
12.5 Switched-Capacitor
Cz Cz
t t
it q Ve un
t c G
Q
This is the SC circuit during the sampling phase. Imagine that
Q
we somehow have stored a voltage 𝑉1 = ℓ on capacitor 𝐶1 (the
switches for that sampling or storing are not shown). The charge
on 𝐶1 is
Qz Qz
𝑄1𝜙1 $ = 𝐶1𝑉1
𝑄 2 𝜙1 $ = 0
C E E
184 12 Switched-Capacitor Circuits
Cz Cz
t t
it q Ve un
c G
Q
It’s the OTA that ensures that the negative input is the same as the
Q positive input, but the OTA cannot be infinitely fast. At the same
time, the voltage across 𝐶1 cannot change instantaneously. Neither
Qz Qz
can the voltage across 𝐶2 . As such, the voltage at the negative input
must immediately go to −𝑉1 (ignoring any parasitic capacitance at
the negative input).
The OTA does not like it’s inputs to be different, so it will start to
charge 𝐶2 to increase the voltage at the negative input to the OTA.
When the negative input reaches 0 V the OTA is happy again. At
that point the charge on 𝐶1 is
𝑄 1 𝜙2 $ = 0
C E E
A key point is, that even the voltages now have changed, there is
zero volt across 𝐶1 , and thus there cannot be any charge across 𝐶1
the charge that was there cannot have disappeared. The negative
input of the OTA is a high impedance node, and cannot supply
A B A A B
charge. The charge must have gone somewhere, but where?
B
In process of changing the voltage at the negative input of the OTA
we’ve changed the voltage across 𝐶2 . The voltage change must
exactly match the charge that was across 𝐶1 , as such
c
c
𝑄 2𝜙2 $ = 𝑄1𝜙1 $ = 𝐶1𝑉1 = 𝐶2𝑉2
A B
thus C
12.5 Switched-Capacitor 185
on
if
𝑉2
𝑉1
=
𝐶1
𝐶2
a
ur
Vocutis Vi n
Cg
There is now a switch to sample the input voltage across 𝐶1 during
H
phase 1 and reset 𝐶2 . During phase 2 we configure the circuit to
VoOTA
leverage the
Evi HE
g a 𝐶1 to 𝐶2 .
Z to do the charge transfer from
Cz
Vien viii
VoEu
error
The discrete time output from the circuit will be as shown below.
It’s only at the end of the second phase that the output signal is
valid. As a result, it’s common to use the sampling phase of the
next circuit close to the end of phase 2.
For charge to be conserved the clocks for the switch phases must
never be high at the same time.
H
Z
Evi HE
186
ga
12 Switched-Capacitor Circuits
Cz
viii
VoEu
error
The discrete time, Z-domain and transfer function is shown below.
The transfer function tells us that the circuit is equivalent to a
gain, and a delay of one clock cycle. The cool thing about switch
capacitor circuits is that the precision of the gain is set by the
relative size between two capacitors. In most technologies that
relative sizing can be better than 0.1 %.
Gain circuits like the one above find use in most Pipelined ADCs,
and are common, with some modifications, in Sigma-Delta
ADCs.
𝐶1
𝑉𝑜 [𝑛 + 1] = 𝑉𝑖 [𝑛]
𝐶2
𝐶1
𝑉𝑜 𝑧 = 𝑉𝑖
𝐶2
𝑉𝑜 𝐶 1 −1
= 𝐻(𝑧) = 𝑧
𝑉𝑖 𝐶2
Vos
C Cz
Cz
Vith
Nt
a
VoEu
G
N
no
The output now will grow without bounds, so integrators are most arrow
often used in filter circuits, or sigma-delta ADCs where there is
feedback to control the voltage swing at the output of the OTA.
C Cz
Vos
Vo
En VoEn I Vicu r
Cz Et
Vo ElVo zaVi
É
Nt
E EEE E
VoEu HCA
N
no
arrow
Make sure you read and understand the equations below, it’s good
to realize that discrete time equations, Z-domain and transfer
functions in the Z-domain are actually easy.
icu r 𝑉𝑜 [𝑛] = 𝑉𝑜 [𝑛 − 1] +
𝐶1
𝐶2
𝑉𝑖 [𝑛 − 1]
𝐶 1 −1
𝑉𝑜 − 𝑧 −1𝑉𝑜 = 𝑧 𝑉𝑖
𝐶2
E
188 12 Switched-Capacitor Circuits
𝐶 1 𝑧 −1 𝐶1 1
𝐻(𝑧) = =
𝐶2 1 − 𝑧 − 1 𝐶2 𝑧 − 1
12.5.3 Noise
2 𝑘𝑇
𝑉𝑛2 >
𝐶
Mean ∫ +𝑇/2
1
𝑥(𝑡) = lim 𝑥(𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
Define
Mean Square
∫ +𝑇/2
1
𝑥 2 (𝑡) = lim 𝑥 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
where
𝜎
is the standard deviation. If mean is removed, or is zero, then
𝜎2 = 𝑥 2 (𝑡)
𝑥 1 (𝑡)
and
𝑥 2 (𝑡)
12.5 Switched-Capacitor 189
𝑥 𝑡𝑜𝑡
2
(𝑡) = 𝑥 12 (𝑡) + 𝑥 22 (𝑡) + 2𝑥 1 (𝑡)𝑥 2 (𝑡)
∫ +𝑇/2
1
𝜎𝑡𝑜𝑡
2
= 𝜎12 + 𝜎22 + lim 2 𝑥 1 (𝑡)𝑥 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
𝜎𝑡𝑜𝑡
2
= 𝜎12 + 𝜎22
12.5.4.1 OTA
Not all SC circuits use OTAs, there are also comparator based SC
circuits.
12.5.4.2 Switches
C E E
A B A B A B
c
c
A B
C
𝑡 > − log(error)𝜏
Assume the capacitors are large due to noise, then the switches
must be low resistance for a reasonable time constant. Larger
switches have smaller resistance, however, they also have more
charge in the inversion layer, which leads to charge injection when
the switches are turned of. Accordingly, larger switches are not
always the solution.
c e
c e
A c e B c
A B
Be
wulffern/sun_sar9b_sky130nm
Ap
E e
C E
g
An Bu
i
i
Be
Ap
E e
C E
g
An Bu
on
if
a
ur
12.5.5 Example
cutis
Vo Vi n
Cg
H
In the circuit below there
HE is anaexample of a switched capacitor cir-
VoZ
Evi g
cuit used to increase the Δ𝑉𝐷 across the resistor. We can accurately
set the gain, and thus the equation for the differential output will
be
Cz
Vien viii
VoEu
194 12 Switched-Capacitor Circuits
𝑘𝑇
𝑉𝑂 (𝑧) = 10 ln(𝑁)𝑧 −1
𝑞
n
I 2
TCalooff
ℏ
𝜎𝑥 𝜎𝑝 ≥
2
. There is a similar relation of energy and time, given by
ℎ
Δ𝐸Δ𝑡 >
2𝜋
196 13 Oversampling and Sigma-Delta ADCs
You should take these limits with a grain of salt. The plot assumes
50 Ohm and 1 V full-scale. As a result, the “Heisenberg” line that
appears to be unbreakable certainly is breakable. Just change the
voltage to 100 V, and the number of bits can be much higher. Always
check the assumptions.
𝑃
𝐹𝑂 𝑀𝑊 =
2𝐵 𝑓 𝑠
In the plot below you can see the ISSCC and VLSI ADCs.
2.E+03
FOMW,hf [fJ/conv-step]
2.E+02
2.E+01
ISSCC 2021
fsnyq [Hz]
People from NTNU have made some of the worlds best ADCs
In (b) we can see the enable flip-flop for the next stage. The CK
bar is the sample clock, as such, A is high during sampling. The
output of the comparator (P and N) is low.
198 13 Oversampling and Sigma-Delta ADCs
In (d) we can see that the bottom plate of the capacitors also used to
set the comparator clock low again (CO), resetting the comparator,
and pulling P and N low, which in (b) enables the next SAR logic
state.
How fast the 𝐷𝑋𝑋 settle depend on the size of the capacitors, as
such, the comparator clock will be slow for the MSB, and very fast
for the LSB. This was my main circuit contribution in the paper.
I think it’s quite clever, because both the VDD and the capacitor
corner will change the settling time. It’s important that the capacitor
values fully settle before the next comparator decision, and as a
result of the circuit in (c,d) the delay is automatically adjusted.
CK D8 CK D7 CK D6 CK D5 CK D4 CK D3 CK D2 CK D1 CK D0
DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N
CI CO CI CO CI CO CI CO CI CO CI CO CI CO CI CO CI CO
LOGIC[8] LOGIC[7] LOGIC[6] LOGIC[5] LOGIC[4] LOGIC[3] LOGIC[2] LOGIC[1] LOGIC[0] CK
CK EI EO EI EO EI EO EI EO EI EO EI EO EI EO EI EO EI EO
DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 1 DN 0 DP 1 DN 0 DP 1 DN 0 DP 1 DN 0 X1
X2
CK
CK CM P
VP +
P
VN −
Bootstrapped 28 · CU N IT 27 · CU N IT 26 · CU N IT 25 · CU N IT 24 · CU N IT 23 · CU N IT 22 · CU N IT 21 · CU N IT 20 · CU N IT N
NMOS switches
(a)
MP 6 MP 7
DP 0 DN 0 DN 1 DP 1
N MP 2 EI MN 6 EI MN 9
A
EI MN 0 P MP 1 MN 5 MN 8
EO B
P MN 1 N MN 2 MN 3 P MN 4 N MN 7 CK MN 10
CI CO
For state-of-the-art ADC papers it’s not sufficient with the idea,
and simulation. There must be proof that it actually works. No-one
will really believe that the ADC works until there is measurements
of an actual taped out IC.
Below you can see the layout of the IC I made for the paper. Notice
that there are 9 ADCs. I had many ideas that I wanted to try out,
and I was not sure what would actually be state of the art. As a
result, I taped out multiple ADCS.
13.1 ADC state-of-the-art 199
The two ADCs that I ended up using in the paper is shown below.
The one on the left was made with 180 nm IO transistors, while
the one on the right was made with core-transistors. Notice that
the layout of the two is quite similar.
200 13 Oversampling and Sigma-Delta ADCs
Comparator
Logic
106µm
CDAC
80µm
Switch
39µm
40µm
(a) (b)
Magnitude [dBFS]
−20 −20
SNDR = 48.84 dB, SFDR = 63.11 dBc SNDR = 46.43 dB, SFDR = 61.72 dBc
Samples = 16384 Samples = 16384
−40 −40
VDD = 0.69 V, IDD = 23 µA VDD = 0.47 V, IDD = 2 µA
FoM = 3.51 fJ/conv.step FoM = 2.73 fJ/conv.step
−60 −60
−80 −80
0 1 2 3 4 5 6 7 8 9 10 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Frequency [MHz] Frequency [MHz]
(a) (b)
8.5 70
Peak ENOB @ fs/2 [bit]
Magnitude [dB]
8
60
SNDR [dB]
7.5 SFDR [dBc]
80 kS/s
2 MS/s 50
7 20 MS/s
80 MS/s
6.5 40
0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 0 1 2 3 4 5 6 7 8 9 10
VDD [V] Input frequency [MHz]
(c) (d)
Weaver [5] Harpe [9] Patil [10] Liu [11] This work
Technology (nm) 90 90 28 FDSOI 28 28 FDSOI
Fsample (MS/s) 21 2 No sampling 100 2 20
Core area (mm2 ) 0.18 0.047 0.0032 0.0047 0.00312
SNDR (dB) 34.61 57.79 40 64.43 46.43 48.84
SFDR (dBc) 40.81 72.33 30 75.42 61.72 63.11
ENOB (bits) 5.45 6.7 - 9.4 6.35 10.41 7.42 7.82
Supply (V) 0.7 0.7 0.65 0.9 0.47 0.69
Pwr (µW) 1110 1.64 -3.56 24 350 0.94 15.87
Compiled Yes No No No Yes
FoM (fJ/c.step) 838 2.8 - 6.6 3.7 2.6 2.7 3.5
The big thing was how I made the ADC. I started with a definition
of a transistor, as shown below
Vertical Grid
D
Horizontal Grid
G B
S
OD CO PO M1
And then wrote a compiler (in Perl, later C++ ciccreator) to compile
a object definition file, a SPICE netlist and a technology rule file
into the full ADC layout.
In (a) you can see one of the cells in the SAR logic, (b) is the spice
file, and (c) is the definition of the routing. The numbers to the
right in the routing creates the paths shown in (d).
202 13 Oversampling and Sigma-Delta ADCs
MN3 6 MP3
1 8
MN2 5 MP2
N
1
2
MN1 4 MP1
P 3
EO
MN0 MP0
EI 7 CK
V SS V DD
OD CO PO M1 M2 M3 M4
(d)
What I really like is the fact that the compilation could generate
GDSII or SKILL, or these days, Xschem schematics and Magic
layout.
verification Visual
visual SKILL into
Testbench LVS DRC inspection Cadence
inspection (seconds) Virtuoso
(minutes)
Parasitic netlist
The cool thing with a compiled ADC is that it’s easy to port
between technologies. Since the original ADC, I’ve ported the ADC
to multiple closed PDKs (22 nm FDSOI, 22 nm, 28 nm, 55 nm, 65
13.1 ADC state-of-the-art 203
SUN_SAR9B_SKY130NM
TF|0→BW -27.8 dB
Fig. 3. Die photo and ADC layout.
−1 −2
2)z +z
+ (a2 − a1 + 1)z −2 13.1.2 High Corrected
resolutionon-chip:FOM Corrected offline:
SNDR 68.2 dB Uncal. Cal.
SNR 68.3 dB SNDR 64.3 dB 67.7 dB
For high-resolution
SFDR ADCs,
84.6 dB it’s more common
SFDR 69.6todBuse the
83.9 dB Schreier
0 0
e SNDR
transfer
68.2function.
dB
figure of-25merit, which can also be found in Uncal.
Cal.
Power [dBFS]
Power [dBFS]
The Walden figure of merit assumes that thermal noise does not
constrain the power consumption of the ADC, which is usually
true for low-to-medium resolution ADCs. To keep the Walden
FOM you can double the power for a one-bit increase in ENOB.
If the ADC is limited by thermal noise, however, then you must
quadruple the capacitance (reduce 𝑘𝑇/𝐶 noise power) for each
1-bit ENOB increase. Accordingly, the power must also go up four
times.
𝑓𝑠 /2
𝐹𝑂 𝑀𝑆 = 𝑆𝑁 𝐷𝑅 + 10 log
𝑃
190
ISSCC 2021
VLSI 2021
180 ISSCC 1997-2020
VLSI 1997-2020
Envelope
170
FOMS,hf [dB]
160
150
140
130
120
1.E+02 1.E+04 1.E+06 1.E+08 1.E+10 1.E+12
fsnyq [Hz]
13.2 Quantization
a
XD y
een
gEn
XED o
It
É
I’m here to tell you that you’ve been lied to. Quantization noise is
not white, nor is it a Gaussian process. Those that have lied to you
may say “yes, sure, but for high number of bits it can be considered
white noise”. I would say that’s similar to saying “when you look at
the earth from the moon, the surface looks pretty smooth without
bumps, so let’s say the earth is smooth with no mountains”.
The figure below shows the input signal x and the quantized signal
y.
É
a
XD y
I 1 i t t t t t t t
En EBI
g
een
TIFFT
It
Else I
É
To see the quantization noise, first take a look at the sample and
held version of 𝑥 in green in the figure below. The difference
between the green ( 𝑥 at time n) and the red ( 𝑦 ) would be our
quantization noise 𝑒
d noise is contained between + 12 Least
a Significant
y
x
The quantization
1
Bit (LSB) and − 2 LSB.
206 13 Oversampling and Sigma-Delta ADCs
É
This noise does not look random to me, but I can’t see what it is,
and I’m pretty sure I would not be able to work it out either.
d a
y
x
I 1 i t t t t t t t
EBI
een
Else I
TIFFT
Luckily, there are people in this world that love mathematics,
and that can delve into the details and figure out what 𝑒[𝑛] is. A
guy called Blachman wrote a paper back in 1985 on quantization
noise.
∞
X
𝑒 𝑛 (𝑡) = 𝐴 𝑝 sin 𝑝𝜔𝑡
𝑝=1
( P∞
𝛿 𝑝1 𝐴 + 𝑚=1 𝑚𝜋 𝐽𝑝 (2𝑚𝜋𝐴)
2
, 𝑝 = odd
𝐴𝑝 =
0 , 𝑝 = even
(
1 ,𝑝 =1
𝛿 𝑝1
0 ,𝑝 ≠1
13.2 Quantization 207
and
𝐽𝑝 (𝑥)
is a Bessel function of the first kind, A is the amplitude of the input
signal.
2𝑛 − 1
𝐴= ≈ 2𝑛−1
2
∞
X
𝑒 𝑛 (𝑡) = 𝐴 𝑝 sin 𝑝𝜔𝑡
𝑝=1
∞
2
𝐴 𝑝 = 𝛿 𝑝 1 2𝑛−1 + 𝐽𝑝 (2𝑚𝜋2𝑛−1 ), 𝑝 = 𝑜𝑑𝑑
X
𝑚=1 𝑚𝜋
Obvious, right?
𝑒 𝑛 (𝑡) = 0
Δ2
𝑒 𝑛 (𝑡)2 =
12
𝐴2 /2 6 𝐴2
𝑆𝑄𝑁 𝑅 = 10 log 2 = 10 log
Δ /12 Δ2
2𝐴
Δ=
2𝐵
6 𝐴2
𝑆𝑄𝑁 𝑅 = 10 log = 20𝐵 log 2 + 10 log 6/4
4𝐴2 /2𝐵
You may have seen the last equation before, now you know where
it comes from.
The left most plot is a sinusoid signal and random Gaussian noise.
The signal is not a continuous time signal, since that’s not possible
on a digital computer, but it’s an approximation.
𝑒 𝑖𝑥 − 𝑒 −𝑖𝑥
𝑠𝑖𝑛(𝑥) =
2𝑖
The second plot from the left is after sampling, notice that the noise
level increases. The increase in the noise level should be due to
noise folding, and reduced number of points in the FFT, but I have
not confirmed (maybe you could confirm?).
The right plot is after quantization, where I’ve used the function
below.
def adc(x,bits):
levels = 2**bits
y = np.round(x*levels)/levels
return y
I really need you to internalize a few things from the right most
plot. Really think through what I’m about to say.
Can you see how the noise (what is not the two spikes) is not white?
White noise would be flat in the frequency domain, but the noise
is not flat.
0 0 0
1-bit
f =127
20 20 20
40 40 40
60 60 60
Frequency Domain
80 80 80
If you run the python script you can zoom in and check the highest
spikes. The fundamental is at 127, so odd harmonics would be
381, 635, 889, and from the function of the quantization noise we
would expect those to be the highest harmonics (at least when we
look at the Bessel function), however, we can see that it’s close, but
that bin 396 is the highest. Is the math’s wrong?
All the other spikes are the odd harmonics above the sample rate
that fold. The infinite sum of harmonics will fold, some in-phase,
some out of phase, depending on the sign of the Bessel function.
From the function for the amplitude of the quantization noise for
harmonic indices higher than 𝑝 = 1
∞
2
𝐽𝑝 (2𝑚𝜋2𝑛−1 ), p=odd
X
𝐴𝑝 =
𝑚=1 𝑚𝜋
we can see that the input to the Bessel function increases faster
for a higher number of bits 𝑛 . As such, from the Bessel function
figure above, I would expect that the sum of the Bessel function
is a lower value. Accordingly, the quantization noise reduces at
higher number of bits.
0 0 0
10-bit
f =127
20 20 20
40 40 40
60 60 60
Frequency Domain
80 80 80
So why should you care whether the quantization noise looks white,
or actually is white? A class of ADCs called oversampling and
sigma-delta modulators rely on the assumption that quantization
noise is white. In other words, the cross-correlation between noise
components at different time points is zero. As such the noise power
sums as a sum of variance, and we can increase the signal-to-noise
ratio.
13.3 Oversampling
𝑦 = 𝑥[𝑛] + 𝑥[𝑛 + 1]
212 13 Oversampling and Sigma-Delta ADCs
𝑏 2𝑜𝑠𝑟 = 𝑂𝑆𝑅 × 𝑏 2
𝑁
1 X
𝑏12 + 2𝑏1 𝑏2 + 𝑏22
𝑁 𝑛=0
𝑁 𝑁 𝑁
1 X 1 X 1 X
𝑏12 + 2𝑏 1 𝑏 2 + 𝑏2
𝑁 𝑛=0 𝑁 𝑛=0 𝑁 𝑛=0 2
𝑁 𝑁
1 X 1 X
(𝑏1 + 𝑏2 )2 = 𝑏12 + 𝑏 2 = 𝑏12 + 𝑏22
𝑁 𝑛=0 𝑁 𝑛=0 2
(𝑏1 + 𝑏2 )2 = 2𝑏 2
13.3 Oversampling 213
(𝑂𝑆𝑅 × 𝐴)2 /2 𝐴2 /2
= 𝑂𝑆𝑅 ×
𝑂𝑆𝑅 × 𝑏 2 𝑏2
We can see that the signal to noise ratio increases with increased
oversampling ratio, as long as the cross-correlation of the noise
is zero
Δ2
𝑒 𝑛 (𝑡)2 =
12𝑂𝑆𝑅
6 𝐴2 6 𝐴2
𝑆𝑄𝑁 𝑅 = 10 log 2 = 10 log + 10 log(𝑂𝑆𝑅)
Δ /𝑂𝑆𝑅 Δ2
10 log(2) ≈ 3 𝑑𝐵
10 log(4) ≈ 6 𝑑𝐵
def oversample(x,OSR):
N = len(x)
y = np.zeros(N)
for n in range(0,N):
for k in range(0,OSR):
m = n+k
if (m < N):
y[n] += x[m]
return y
Below we can see the plot for OSR=2, the right most plot is the
oversampled version.
The noise has all frequencies, and it’s the high frequency compo-
nents that start to cancel each other. An average filter (sometimes
called a sinc filter due to the shape in the frequency domain) will
have zeros at ± 𝑓 𝑠/2 where the noise power tends towards zero.
0 0 0 0
10-bit OSR=2
20 20 20 20
40 40 40 40
60 60 60 60
Frequency Domain
80 80 80 80
The low frequency components will add, and we can notice how
the noise power increases close to the zero frequency (middle of
the x-axis).
For an OSR of 4 we can notice how the noise floor has 4 zero’s.
0 0 0 0
10-bit OSR=4
20 20 20 20
40 40 40 40
60 60 60 60
Frequency Domain
80 80 80 80
The code for the plots is osr.py. I would encourage you to play a
bit with the code, and make sure you understand oversampling.
Look at the OSR=4 plot above. The OSR=4 does decrease the noise
compared to the discrete time discrete value plot, however, the
noise level of the discrete time continuous value is much lower.
That’s what noise shaping is all about. Adding circuits such that we
can “shape” the quantization noise. We can’t make the quantization
noise disappear, or indeed reduce the total noise power of the
quantization noise, but we can reduce the quantization noise power
for a certain frequency band.
Do you see now why a circuit like the one below is useful? If not,
you should really come talk to me so I can help you understand.
VI VX Hcs V0
Ux Vo VxHCS
VI Vo
VI Vo E
YE
VI V
13.4.2 Sigma-delta principle
Hes ADC DAC
Do
Let’s modify the feedback circuit into the one below. I’ve added
an ADC and a DAC to the feedback loop, and the 𝐷𝑜 is now the
output we’re interested in. The equation for the loop would be
But how can we now calculate the transfer function 𝐷 𝑉𝑖 ? Both 𝑎𝑑𝑐
𝑜
VI V
Hes ADC DAC
Do
One way to force linearity is to use a 1-bit DAC, which has only
two points, so should be linear. For example
𝑉𝑜 = 𝐴 × 𝐷𝑜
I’ve made a couple noise shaping ADCs, and in the first one I
made I screwed up the DAC. It turned out that the DAC current
had a signal dependent component which lead to a non-linear
behavior.
We’ve talked about this, the 𝑒 is not white, especially for low-bit
ADCs, so we usually have to add noise. Sometimes it’s sufficient
with thermal noise, but often it’s necessary to add a random, or
pseudo-random noise source at the input of the ADC.
axhxxx.MX
In B Paz
218 13 Oversampling and Sigma-Delta ADCs
l
as
𝑦 = 𝐻(𝑠)(𝑢 − 𝑦) + 𝑒
PSD
tf
or in2the sample domain
tf
𝑦[𝑛] = 𝑒[𝑛] + ℎ ∗ (𝑢[𝑛] − 𝑦[𝑛])
to yen
I o Ha
YET𝑌(𝑧)een
= 𝐸(𝑧) + 𝐻(𝑧)HA UET
[𝑈(𝑧) − 𝑌(𝑧)] YET
YG ECz HE UG 4
The whole point of this exercise was to somehow shape the zquan-
tization noise, and we’re almost at the point, but to show how it
ECHO
works we need to look at the transfer function for the signal 𝑈 and
for the noise 𝐸 .
y HU HY
t
13.4.3STF
Signal transfer function
𝑌 = 𝐻𝑈 − 𝐻𝑌
𝑌 𝐻 1
𝑆𝑇𝐹 = = =
𝑈 1+𝐻 1 + 𝐻1
Assume U is zero
1
𝑌 = 𝐸 + 𝐻𝑌 → 𝑁𝑇𝐹 =
1+𝐻
There are a large set of different 𝐻(𝑧) and I’m sure engineers
will invent new ones. We usually classify the filters based on the
number of zeros in the NTF, for example, first-order (one zero),
second order (two zeros) etc. There are books written about sigma-
delta modulators, and I would encourage you to read those to
get a deeper understanding. I would start with Delta-Sigma Data
Converters: Theory, Design, and Simulation.
or in the Z-domain
𝑧𝑌 = 𝑋 + 𝑌 → 𝑌(𝑧 − 1) = 𝑋
1
𝐻(𝑧) =
𝑧−1
220 13 Oversampling and Sigma-Delta ADCs
1/(𝑧 − 1) 1
𝑆𝑇𝐹 = = = 𝑧 −1
1 + 1/(𝑧 − 1) 𝑧
1 𝑧−1
𝑁 𝐹𝑇 = = = 1 − 𝑧 −1
1 + 1/(𝑧 − 1) 𝑧
In the book they replace the 𝑧 with the continuous time variable
𝑠=𝑗𝜔
𝑧 = 𝑒 𝑠𝑇 → 𝑒 𝑗𝜔𝑇 = 𝑒 𝑗 2𝜋 𝑓 / 𝑓𝑠
𝑁𝑇𝐹( 𝑓 ) = 1 − 𝑒 −𝑗 2𝜋 𝑓 / 𝑓𝑠
𝑒 𝑗𝜋 𝑓 / 𝑓𝑠 − 𝑒 −𝑗𝜋 𝑓 / 𝑓𝑠
= × 2 𝑗 × 𝑒 −𝑗𝜋 𝑓 / 𝑓𝑠
2𝑗
𝜋𝑓
= sin × 2 𝑗 × 𝑒 −𝑗𝜋 𝑓 / 𝑓𝑠
𝑓𝑠
When we take the absolute value to figure out how the NTF changes
with frequency the complex parts disappears (equal to 1)
𝜋𝑓
|𝑁 𝐹𝑇( 𝑓 )| = 2 sin
𝑓𝑠
𝑃𝑠 = 𝐴2 /2
𝑓0 2
Δ2 1 𝜋𝑓
∫
𝑃𝑛 = 2 sin 𝑑𝑡
− 𝑓0 12 𝑓𝑠 𝑓𝑠
..
.
𝐸𝑁 𝑂𝐵 = (𝑆𝑄𝑁 𝑅 − 1.76)/6.02
The table below shows the effective number of bits for oversam-
pling, and sigma-delta modulators. For a 1-bit quantizer, pure
oversampling does not make sense at all. For first-order and second-
order sigma delta modulators, and a OSR of 1024 we can get high
resolution ADCs.
13.6 Examples
Below we can see an excerpt. Again pretty stupid code, and I’m
sure it’s possible to make a faster version (for loops in python are
notoriously slow).
For each sample in the input vector 𝑢 I compute the input to the
quantizer 𝑥 , which is the sum of the previous input to the quantizer
and the difference between the current input and the previous
output 𝑦 𝑠𝑑 .
The quantizer generates the next 𝑦 𝑠𝑑 and I have the option to add
dither.
0 0 0 0
1-bit
20 20 20 20
40 40 40 40
60 60 60 60
Frequency Domain
80 80 80 80
In the figure below I’ve turned on dither, and we can see how the
noise looks “better”, which I know is not a qualitative statement,
but ask anyone that’s done 1-bit quantizers. It’s important to have
enough random noise.
0 0 0 0
1-bit
20 20 20 20
40 40 40 40
60 60 60 60
Frequency Domain
80 80 80 80
20
40
Magnitude [dB20]
60
80
100
120
10 3 10 2 10 1
Normalized frequency
which was a pure theoretical work. The idea was to use modulo
integrators (local control of integrator output swing) in front of
large latency multi-bit quantizers to achieve a high SNR.
The plot below shows a fifth order NFT where there are two
complex conjugate zeros, and a zero at zero frequency. With a
higher order filter one can use a lower OSR, and still achieve high
ENOB.
13.6 Examples 225
−20
−40
−60
Magnitude [dB]
−80
−100
−120
−140
−160
Output
Bandwidth
−180
−4 −3 −2 −1
10 10 10 10
Normalized Frequency, fs = 1
The loop filter was a switched cap loop filter, and we can see the
NTF below. The first OTA made use of chopping to reduce the
offset.
226 13 Oversampling and Sigma-Delta ADCs
High-Level Architecture
↵2 ↵3 ··· ↵N
1
x1 (t) 2
x2 (t) 3
x3 (t) N
xN (t)
u(t) + s+⇢1 + s+⇢2 + s+⇢3
··· + s+⇢N
1 fclk 2 fclk 3 fclk N fclk
< < < <
Design Considerations
s (t) s2 (t) s3 (t) sN (t)
1
by A0i = i/⇢i .
Below we can see a power spectral density plot of the ADC, and
The Leapfrog ADC di↵ers from the Chain-of-integrators by the addi-
we can feedback
tional observe how
pathsthe quantization
between noisestates.
neighboring is shaped. I think it’s
The feedback from xi
ato
third order NTF with a zero at zero frequency and a complex
xi 1 is achieved through ↵i , feeding a portion of xi back to the input of
integratorpole
conjugate (i at
1).8Each integrator is stabilized by a local digital control,
MHzish.
which is represented by a clocked comparator in figure 3.1. The output of
comparator i is the control-contribution si (t) which is scaled by a factor
i before entering the integrator input.
0
û(t)
3.2 20
Parametrization NTF
40 of the state vector is described by
The evolution
where 0 1
80 ⇢1 1 ↵2
B 2 ⇢2 2 ↵3 C
B C
100 A = B
B ⇢3
... C
C, (3.2)
3
B .. .. C
@ . . 1 ↵N
A
120 N
N ⇢N
140
T
B= 1 ··· 0 , (3.3)
and 160 0 1
5 1 6
10 B
1
10
.. C 107
=@ . A. (3.4)
Frequency [Hz]
N N
Figure 5.6:local
For this Estimated PSD oftheû(t)
digital control, plotted
control together
observation s̃(t)with corresponding
coincides with
theoretical NTF. Obtained from an ideal circuit simulation
the state vector x(t) meaning that the control observation matrix of a˜4th
T
= order
Leapfrog ADC with LNA driven, passive integrator and floating-gate
voltage
13.6.2.4summation
Complex Sigma-Delta 22
58
228 13 Oversampling and Sigma-Delta ADCs
Many ICs are battery operated, whether it’s your phone, watch,
heart rate monitor, mouse, keyboard, game controller or car.
For a long time, I had trouble with “traps in the oxide”“. I had a
hard time visualizing how electrons wandered down the channel
and got caught in the oxide. I was trying to imagine the electric
field, and that the electron needed to find a positive charge in the
oxide to cancel. Diving a bit deeper into quantum mechanics, my
mental image improved a bit, so I’ll try to give you a more accurate
mental model for how to think about traps.
14.1.2 IO voltage
Most ICs talk to other ICs, and they have a voltage for the general
purpose input/output. The voltage reduction in I/O voltage does
not need to scale as fast as the core voltage, because foundries have
thicker oxide transistors that can survive the voltage.
Voltage [V]
5.0
3.0
1.8
1.2
For any IC, we must know the application. We must know where
the voltage comes from, the IO voltage, the core voltage, and any
other requirements (like charging batteries).
5 OV
VBUS
10 1.8 V
IO BIASIANA
In 50m In loom
0.80
CORE
RISC V ADC RADIO
In 50M In Im In 300m
Some that can handle low load (nA - 𝜇A) effectively, and some that
can handle high loads.
Most product specifications will give you a view into what type of
regulators there are on an IC. The picture below is from nRF5340
(page 23)
IN W
it
0,8V
TI LOAD
For digital loads, where 𝐼 𝑙𝑜𝑎𝑑 is a digital current, with high current
every rising edge of the clock, it’s an option to place a large external
decoupling capacitor (a reservoir of charge) in parallel with the
load. Accordingly, the OTA would supply the average current.
for
a LDO, or low dropout regulator, since we only need a 𝑉𝐷𝑆𝑆𝐴𝑇
Dos
across the PMOS, which can be a few hundred mV.
IEE
Key parameters of regulators are
W
1,5
0,8V
I LOAD
II LOAD
The size of the pass-fet is set by the maximum Vgs, and the current
r
that needs to be delivered.
IEEE
240 14 Voltage regulation
Below is an excerpt from the testbench. The pass-fet size has been
determined by iteration.
The OTA in the LDO is modeled by the B source. Notice the use of
the tanh function in order to keep the G voltage within the rails.
* Pass-fet
XM1 OUT G VDD VDD sky130_fd_pr__pfet_01v8 L=0.252 W=11.52 nf=2 ...
* Reference
VREF VREF 0 dc 0.8
* OTA
BOTA G 0 V=(1 + tanh(-1000*(v(vref) -v(out) )))/2*{AVDD}
* Load cap
CL OUT 0 1u
* Current load
ILOAD OUT 0 pwl 0 0 1u 0 50u 0.5
v(il) output_loadreg/loadreg_SchGtKttTtVt.raw
10 1
10 2
10 3
10 4
10 5
As such, there are multiple control options for the pass-fet. Below
is a summary of a few methods.
1 1 1 DutyCycle
Control
or
When we turn off the switch, the inductor current will not stop
immediately, it cannot, that’s what
𝑑𝐼
𝑉=𝐿
𝑑𝑡
1 1 1 DutyCycle
Control
14.3 Switched Regulators 243
or
tells us. As a result, the current continues, but now the current is
pulled from ground through the diode.
ILOAD ILOAD
Since we’re pulling current from ground, it should be intuitive that
the current from Vin is less than the load current at Vout, assuming
Vin > Vout.
If the capacitors are the same size, then the output voltage would
be half the input voltage.
A A
Vin
3 20in 1 1 1
Vink
DutyCycle
A C C Vin A
Control C
Vin or
B b b b B D
As such, the output voltage would be two times the input voltage,
assuming the capacitors are equal.
A A
Vin
Vin 3 20in Vink
A C C Vin A C
Vin
B b b b B D
I’ve found that people struggle with inductive DC/DCs. They see
a circuit inductors, capacitors, and transistors and think filters,
Laplace and steady state. The path of Laplace and steady state will
lead you astray and you won’t understand how it works.
Buch
to force the output to be what is wanted, however, let’s ignore
closed loop for now.
Mott Ex
Vo
Ix C R
Vo
Control B
V
LEI I
Efrat t T t
t
246 14 Voltage regulation
∫
1
𝐼 𝑥 (𝑡) = 𝑉𝑥 (𝑡)𝑑𝑡
𝐿
∫
1
𝑉𝑜 (𝑡) = (𝐼 𝑥 (𝑡) − 𝐼 𝑜 (𝑡))𝑑𝑡
𝐶
The output voltage also affect the voltage across the inductor, which
affects the current, which affects the output voltage, etc, etc.
There are many versions of the control block, let’s look at two.
Let’s set 𝐴 = 0 and 𝐵 = 1 for fixed time duration (it does not need
to be the same as duration as we set 𝐴 = 1). The voltage across the
inductor would be 𝑉𝑥 = 0 − 𝑉𝑜 . The output voltage would not have
increased much, so the absolute value of 𝑉𝑥 during 𝐴 = 1 would
be higher than the absolute value of 𝑉𝑥 during the first 𝐵 = 1.
I’ve made a
In the figure below we can see how the current during A increases
fast, while during B it decreases little. The output voltage increases
similarly to a second order function.
14.3 Switched Regulators 247
0.25 Ix
0.20 Io
0.15
0.10
0.05
0.00
0.03
0.02
vo
0.01
0.00
1
A
0
0.00 0.05 0.10 0.15 0.20 0.25
Time [us]
If we run the simulation longer, see plot below, the DC/DC will
start to settle into a steady state condition.
On the top we can see the current 𝐼 𝑥 and 𝐼 𝑜 , the second plot you
can see the output voltage. Turns out that the output voltage will
be
𝑉𝑜 = 𝑉𝑖𝑛 × Duty-Cycle
0.2
0.0
1.00
0.75
vo
0.50
0.25
0.00
1
A
0
0 2 4 6 8 10
Time [us]
248 14 Voltage regulation
Once the system has fully settled, see figure below, we can see the
reason for why DC/DC converters are useful.
If the DC/DC was 100% efficient, then the current from the 4
V input supply would be 1/4’th of the 1 V output supply. 100%
efficient DC/DC converters violate the laws of nature, as such, we
can expect to get up to 9X% under optimal conditions.
0.06
0.04 Ix
Io
0.02
0.00
0.02
0.04
0.06
0.990
0.989
vo
0.988
0.987
1
A
0
13.60 13.65 13.70 13.75 13.80 13.85 13.90 13.95 14.00
Time [us]
I
Vo
CK FSM Da
Vz
Vol
REF
UP
vol = 0 a=1 vz = 0
b=0 count = up_cycles
vol = 1 count++
IDLE DWN
a=0 a=0
b=0
vz = 1 b=1
count=0 count=0
I made a jupyter model for the PFM mode. I would encourage you
to play with them.
Below you can see a period of the PFM buck. The state can be seen
in the bottom plot, the voltage in the middle and the current in the
inductor and load in the top plot.
0.08 Ix
0.06 Io
0.04
0.02
0.00
1.03
1.02
vo
1.01
1.00
0.99
2
STATE
Take an example.
Most people in this world have no idea how things work. Very
few people are able to understand the full stack. Everyone of us
must simplify what we know to some extent. As such, as a circuit
designer, it’s your responsibility to fully understand what is asked
of you.
15.1.2 Frequency
15.1.3 Noise
What type of noise you care about depends on the problem. Digital
will care about the cycle-to-cycle jitter affects on setup and hold
times. Radio’s will care about the frequency content of the noise
with an offset to the carrier wave.
15.1.4 Stability
15.1.5 Conclusion
1. 32 MHz crystal
2. 32 KiHz crystal
3. PCB antenna
4. DC/DC inductor
I’m not sure it’s possible yet to make an IC that does not have some
form of frequency reference, like a crystal. The ICs I’ve seen so far
that have “crystal less radio” usually have a resonator (crystal or
bulk-accustic-wave or MEMS resonator) on die.
For a system that sleeps most of the time, and only wakes up at
regular ticks to do something, then a low-frequency crystal might
be worth the effort.
Since we can see the PCB antenna, we know that the IC includes a
radio. From that fact we can deduce what must be inside the SoC.
If we read the Product Specification we can understand more.
Since we can see a large inductor, we can also make the assumption
that the IC contains a switched regulator. That switched regulator,
especially if it has a pulse-width-modulated control loop, will need
a clock.
32MHz
Xo
RADIO
PLL PLL Lo
MCU
XO
32768 Hz
RC
In a SoC we have to check, for all paths between a Y[N] and B[M]
that the path is fast enough for all transients to settle before the
clock strikes next time. How early the B data must arrive in relation
to the clock edge is the setup time of the DFFs.
We also must check for all paths that the B[M] are held for long
enough after the clock strikes such that our flip-flop does not
change state. The hold time is the distance from the clock edge
to where the data is allowed to change. Negative hold times are
common in DFFs, so the data can start to change before the clock
edge.
Lo
what’s the maximum frequency we can have at any point in time,
and what is the maximum cycle-to-cycle variation in the period.
Clk in
BED XD
AID
Clk out
15.3 PLL
PLL, or it’s cousins FLL and DLL are really cool. A PLL is based
on the familiar concept of feedback, shown in the figure below. As
long as we make 𝐻(𝑠) infinite we can force the output to be an
exact copy of the input.
260 15 Clocks and PLLs
VI VX
Hs
V0
Vo Vx H s
VI Vo Ux
Vo I
VI Vo YE
VI VX V0
For a frequency loop the figure looks a bit different. If we want a
H
higher output frequency we cans divide the frequency by a number
(N) and compare with our reference (for example the 32 MHz
reference from the crystal oscillator). N
Ux Vo Vx H s
VI Vo
fin
We then take the error, apply a transfer function 𝐻(𝑠) with high
gain, and control our oscillator frequency. Vo
Vo I
to
VI yes
YE
If the down-divided output frequency is too high, we force the os-
cillator to a lower frequency. If the down-divided output frequency
is too low we force the oscillator to a higher frequency.
fin to
yes
fin M Hcs
to
in
15.3.2 Fractional PLL
fin
the reference frequency. As such, the PLL will respond slower to a
frequency change.
to
yes
We can also use a fractional divider, where we swap between two,
or more, integeres in a sigma-delta fashion in the divider.
ED N
fin to
yes
Amos N
fin to
His N
food
ED N
fin to
yes
fmod
I’ve made an example PLL that you can download and play with.
I make no claims that it’s a good PLL. Actually, I know it’s a bad
PLL. The ring-oscillator frequency varies to fast with the voltage
control. But it does give you a starting point.
VDD_ROSC
CP_UP_N xa1 xa5
xa0
AVDD
AVDD
AVDD
AVDD
VLPF
CK_REF CK_REF CP_UP_N CP_UP_N VO VDD_ROSC
PWRUP_1V8
CK_FB CP_DOWN CP_DOWN LPF VI CK CK
PWRUP_1V8
VFB
CP_DOWN
xd0
VLPF
AVSS
AVSS
LPFZ
AVSS
KICK
VBN
VBN
AVSS
VLPFZ
SUN_PLL_PFD SUN_PLL_CP SUN_PLL_BUF
VLPFZ
SUN_PLL_ROSC
KICK
AVSS
xaa6
AVDD
SUN_PLL_LPF
CK_FB
IBPSR_1U 1
CK
PWRUP_1V8
CK_FB 32
AVSS
xbb1
xaa3
BIAS
IBPSR_1U
SUN_PLL_KICK
SUN_PLL_BIAS
PWRUP_1V8
Read any book on PLLs, talk to any PLL designer and they will all
tell you the same thing. PLLs require calculation. You must setup
a linear model of the feedback loop, and calculate the loop transfer
function to check the stability, and the loop gain. This is the way!
(to quote Mandalorian).
I have no idea who first thought of the idea, but it turns out, that
one can model a PLL as a linear system if one consider the phase
of the voltages inside the PLL, especially when the PLL is locked
(phase of the output and reference is mostly aligned). Where the
phase is defined as
∫ 𝑡
𝜙(𝑡) = 2𝜋 𝑓 (𝑡)𝑑𝑡
0
The phase of our input is 𝜙 𝑖𝑛 (𝑠), the phase of the output is 𝜙(𝑠),
the divided phase is 𝜙 𝑑𝑖𝑣 (𝑠) and the phase error is 𝜙 𝑑 (𝑠).
Girls OÉpd 0 s
Kuhns Kosel
Oldies
YN
𝜙𝑑 1
=
𝜙 𝑖𝑛 1 + 𝐿(𝑠)
Old It kpdkgtk.sk din
𝐾 𝐾 𝑜𝑠𝑐 𝑝𝑑 𝐾 𝑙𝑝 𝐻 𝑙𝑝 (𝑠)
𝐿(𝑠) =
𝑁𝑠
IE ILG
Here is the magic of PLLs. Notice what happens when 𝑠 = 𝑗𝜔 = 𝑗 0,
or at zero frequency. If we assume that 𝐻𝑙𝑝 (𝑠) is a low pass
filter, then 𝐻𝑙𝑝 (0) = constant. The loop gain, however, will have a
𝐿(0) ∝ 01 which approaces infinity at 0.
For the linear model, we need to figure out the factors, like 𝐾 𝑣𝑐𝑜 ,
which must be determined by simulation.
2 = 512 There
MHz PLL
exist PLLs with voltage control, current control, capacitance
control, and digital control.
𝑑𝑓
𝐾 𝑜𝑠𝑐 = 2𝜋
𝑑𝑉𝑐𝑛𝑡𝑙
VDD_ROSC
xaa5
AVDD
xaa4
AVDD
VO VDD_ROSC
VI CK CK
PWRUP_1V8
VFB
xbb0
VLPF
AVSS
VBN
AVSS
SUN_PLL_BUF
VLPFZ
SUN_PLL_ROSC
AVSS
xaa6
AVDD
SUN_PLL_LPF
CK_FB
1
15.4.2.1 SUN_PLL_SKY130NM/sim/ROSC/CK
PWRUP_1V8
CK_FB 32
AVSS
tran.spi
kvco.py
df = pd.read_csv(f)
freq = 1/df["tpd"]
kvco = np.mean(freq.diff()/df["vrosc"].diff())
266 15 Clocks and PLLs
tran_LayGtVtKttTt
1200 tran_LayGtVtKssTt
tran_LayGtVtKffTt
tran_LayGtVtKttTh
1000 tran_LayGtVtKssTh
tran_LayGtVtKffTh
Frequency [MHz]
tran_LayGtVtKttTl
tran_LayGtVtKssTl
800 tran_LayGtVtKffTl
600
400
The two blocks compare our reference clock to our feedback clock,
16 MHz x 32 = 512
and produce an error signal.
AVDD
𝐼 𝑐𝑝
𝐾 𝑝𝑑 =
2𝜋
CP_UP_N
xaa1
xaa0
AVDD
AVDD
Kcp = Ibp/2pi
VLPF
xbb0
VLPF
AVSS
AVSS
LPFZ
KICK
VBN
VLPFZ
SUN_PLL_PFD SUN_PLL_CP
VLPFZ
KICK
AVSS
SUN_PLL
IBPSR_1U
xbb1
xaa3
BIAS
IBPSR_1U
AVDD KICK
PWRUP_1V8 KICK_N
SS
In the book you’ll find a first order loop filter, and a second order
0nm/work/../design/SUN_PLL_SKY130NM/SUN_PLL.sch
loop filter. Engineers are creative, so you’ll likely find other loop
filters in the literature.
I would start with the “known to work” loop filters before you
explore on your own.
The loop filter has a unity gain buffer. My oscillator draws current,
while the VPLF node is high impedant, so I can’t draw current
/SUN_PLL.sch
16 MHz x 32 = 512 MHz PLL from the loop filter without changing the filter transfer function.
1 1
𝐾 𝑙𝑝 𝐻𝑙𝑝 (𝑠) = 𝐾 𝑙𝑝 +
𝑠 𝜔𝑧
1 1 + 𝑠𝑅𝐶1
𝐾 𝑙𝑝 𝐻𝑙𝑝 (𝑠) =
𝑠(𝐶1 + 𝐶2 ) 1 + 𝑠𝑅 𝐶1 𝐶2
𝐶1 +𝐶2
VDD_ROSC
CP_UP_N
xaa1 xaa5
AVDD
VFB
CP_DOWN
xbb0
VLPF
AVSS
LPFZ
AVSS
KICK
VBN
VBN
AVSS
VLPFZ
D SUN_PLL_CP SUN_PLL_BUF
VLPFZ
SUN_PLL_ROSC
KICK
AVSS
xaa6
AVDD
SUN_PLL_LPF
CK_FB
1
CK
PWRUP_1V8
CK_FB 32
AVSS
VDD_ROSC
xaa3
xbb1
15.4.5 Divider
BIAS
IBPSR_1U
xaa5
KICK SUN_PLL_DIVN
AVDD
V8 KICK_N xaa4
AVSS
AVDD
PWRUP_1V8_N
PWRUP_1V8_N
The divider is modelled as
PWRUP_1V8_N
L_KICK VO VDD_ROSC
SUN_PLL_BIAS
VI CK CK
PWRUP_1V8
VFB
b0
1
AVSS
VBN
𝐾 𝑑𝑖𝑣 =
AVSS
SUN_PLL_BUF
SUN_PLL_ROSC
𝑁 Designer
Updated
Carsten Wulff
wulff
Modified 2023-01-22 22:00:43
Copyright Carsten Wulff Software
xaa6
AVDD
UN_PLL_LPF
CK_FB
1
CK
PWRUP_1V8
CK_FB 32
AVSS
SUN_PLL_DIVN
With the loop transfer function we can start to model what happens
in the linear loop. What is the phase response, and what is the gain
response.
I’ve made a python model of the loop, you can find it at sun_pll_-
sky130nm/jupyter/pll
In the jupyter notbook below you can find some more information
on the phase/frequency detector, and charge pump.
sun_pll_sky130nm/jupyter/pfd
Below is a plot of the loop gain, and the transfer function from
input phase to divider phase.
We can see that the loop gain at low frequency is large, and
proportional to 1/𝑠 . As such, the phase of the divided down
feedback clock is the same as our reference.
100 Lg
div/ in
Magnitude [dB]
50
0
50
103 104 105 106 107 108
0 Frequency [Hz]
Lg
div/ in
Phase [Degrees]
50
Phase margin = 55.0
100
150
I power up the PLL and wait for the output clock to settle. I use
freq.py to plot the frequency as a function of time. The orange curve
is the average frequency. We can see that the output frequency
settles to 256 MHz.
tran_LayGtVtKttTt.raw
mid,end: 259.270,256.04 MHz
500
400
Frequency [MHz]
300
200
100
0
2 4 6 8 10 12 14
Time [us]
You can find the schematics, layout, testbenches, python script etc
at SUN_PLL_SKY130NM
Why would the thing take 30 minutes to start up? Does the tem-
perature need to settle? Is it the loop bandwidth of the PLL that is
low? Who knows, but 30 minutes is too long for a IC startup time.
And we can’t really pack the big box onto a chip.
“Ask for a quote” => The price is really high, and we don’t want to
tell you yet
The negative feedback loop ensures that the 5 MHz clock coming
out is proportional to the hyper-fine energy levels in the Rubidium
atoms. Negative feedback is cool! Especially when we have a pole
at DC and infinite gain.
276 16 Oscillators
16.2.1 Impedance
I Our job is to make a circuit that we can connect to the two pins
and provide the energy we will loose due to 𝑅 𝑠 .
D Rst Sh t IE Zin
Rs
Gp sCp
L Cp
CF
Gin
pkg
Assuming zero series resistance
t SCP
𝑠2𝐶 𝐿 + 1
Gin𝑍𝑖𝑛 = 𝑠 3 𝐶𝑃 𝐿𝐶𝐹 + 𝑠𝐶𝑃 +t𝑠𝐶SCP
𝐹
Eye 𝐹
+ 𝐶𝐹 + 𝐶𝑃
II
so
See Crystal oscillator impedance for a detailed explanation.
zm ss
In the impedance plot below we can clearly see that there are
two “resonance” points. Usually noted by series and parallel
resonance.
16.2.2 Circuit
Above the dotted line is what we have inside the IC. Call the left
side of the inverter XC1 and right side XC2. The inverter is biased
by a resistor, 𝑅 1 , to keep the XC1 at a reasonable voltage. The XC1
and XC2 will oscillate in opposite directions. As XC1 increases, XC2
will decrease. The 𝑅 2 is to model the internal resistance (on-chip
wires, bond-wire).
n n
The LC circuit will resonate back and forth. If there was no resis-
tance in the circuit, then the oscillation would never die out. The
system would be infinite Q.
That number may not tell you much, but think of it like this, it
will take 20 000 clock cycles before the amplitude falls by 1/e.
For example, if the amplitude of oscillation was 1 V, and you stop
282 16 Oscillators
introducing energy into the system, then 20 000 clock cycles later,
or 0.6 ms, the amplitude would be 0.37 V.
The same is roughly true for startup of the oscillator. If the crystal
had almost no amplitude, then an increase 𝑒 would take 20 k
cycles. Increasing the amplitude of the crystal to 1 V could take
milliseconds.
One of the key reasons for using crystals is their stability over
temperature. Below is a plot of a typical temperature behavior.
The cutting angle of the crystal affect the temperature behavior,
as such, the closer crystals are to “no change in frequency over
temperature”, the more expensive they become.
𝑡 𝑝𝑑 ≈ 𝑅𝐶
1 1
𝑅≈ ≈
𝑔𝑚 𝜇𝑛 𝐶 𝑜𝑥 𝑊 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
𝐿
2
𝐶≈ 𝐶 𝑜𝑥 𝑊 𝐿
3
284 16 Oscillators
tpd
𝑡 𝑝𝑑 ≈ 𝑊
2/3𝐶 𝑜𝑥 𝑊 𝐿 Er
𝐿 𝜇𝑛 𝐶 𝑜𝑥 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
1 𝜇𝑛 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
𝑓 = =
2 𝑁𝑡 𝑝𝑑 3 𝑁𝐿
4 2
𝜕𝑓 2𝜋𝜇𝑛
𝐾 𝑣𝑐𝑜 = 2𝜋 = 4
𝜕𝑉 𝐷𝐷 3 𝑁𝐿
2
𝜇𝑛 𝐶 𝑜𝑥 𝑊
𝐿 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
𝑓 =
2𝑁 3 𝐶 𝑜𝑥 𝑊 𝐿
2
+𝐶
2𝜋𝜇𝑛 𝐶 𝑜𝑥 𝑊
𝐿
𝐾 𝑣𝑐𝑜 =
2𝑁 3 𝐶 𝑜𝑥 𝑊 𝐿
2
+𝐶
Assume that the extra capacitance is much larger than the gate
capacitance, then
𝜇𝑛 𝐶 𝑜𝑥 𝑊
𝐿 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
𝑓 =
2𝑁 𝐶
f
t.FI Fifty tamarett
2𝜋𝜇𝑛 𝐶 𝑜𝑥 𝑊
𝐿
𝐾 𝑣𝑐𝑜 =
2𝑁 𝐶
c c e
16.3.3 Realistic
re
qq.LI
Assume you wanted to design a phase-locked loop, what type
of oscillator should you try first? If the noise of the clock is not
too important, so you don’t need an LC-oscillator, then I’d try the
oscillator below, although I’d expand the number of stages to fit
the frequency.
t
EYeI tamara
286 16 Oscillators
Since the 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 can only increase the frequency it’s important
that the 𝐼 𝑐𝑜𝑛𝑡𝑟𝑜𝑙 is set such that the frequency is below the target.
Maybe a small side track, but inject a signal into an oscillator from
an amplifier, the oscillator will have a tendency to lock to the
injected signal, we call this “injection locking”, and it’s common
to do in ultra high frequency oscillators (60 - 160 GHz). Assume
we allow the PLL to find the right 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 that corresponds to the
injected frequency. Assume that the injected frequency changes,
for example frequency shift keying (two frequencies that mean 1
or 0), as in Bluetooth Low Energy. The PLL will vary the 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙
of the PLL to match the frequency change of the injected signal, as
such, the 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 is now the demodulated frequency change.
Still today, there are radio recievers that use a PLLs to directly de-
modulate the incoming frequency shift keyed modulated carrier.
16.3 Controlled Oscillators 287
𝑑𝑉
𝐼=𝐶
𝑑𝑡
𝐼 𝑐𝑜𝑛𝑡𝑟𝑜𝑙 + 12 𝜇𝑝 𝐶 𝑜𝑥 𝑊
𝐿 (𝑉 𝐷𝐷 − 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 − 𝑉𝑡 ℎ )
2
𝑓 ≈
𝐶 𝑉 𝐷𝐷
2 𝑁
𝜕𝑓
𝐾 𝑣𝑐𝑜 = 2𝜋
𝜕𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙
𝜇𝑝 𝐶 𝑜𝑥 𝑊/𝐿
𝐾 𝑣𝑐𝑜 = 2𝜋
𝐶 𝑉 𝐷𝐷
2 𝑁
288 16 Oscillators
Today there are all digital loops where the oscillator is not really
a “voltage controlled oscillator”, but rather a “digital control
oscillator”. DCOs are common in all-digital PLLs.
16.3.5 Differential
16.3.6 LC oscillator
Most ring oscillators are too high noise for radio’s, we must use a
inductor and capacitor to create the resonator.
I 1
C fate
Vent
1
𝑓 ∝√
𝐿𝐶
o n
V
I U
R C
292 16 Oscillators
𝑉1 = 𝐼𝑅
𝑑𝑉
𝐼=𝐶
𝑑𝑡
𝐶𝑉2 𝐶𝐼𝑅
𝑑𝑡 = =
𝐼 𝐼
1 1
𝑓 = =
𝑑𝑡 𝑅𝐶
1 1
𝑓𝑜 = 𝑓 =
2 2𝑅𝐶
17.1.2 Rate
Gamers are crazy for speed, they care about milliseconds. So our
mice needs to be able to send and receive data quite often.
Multiply by
𝜋
> 716 kbps
▶ Yellow: Region 1
▶ Blue: Region 2
▶ Pink: Region 3
17.2.2 Antenna
assume
𝜆/4
is an OK antenna size (
𝜆 = 𝑐/ 𝑓
)
The below table shows the ISM band and the size of a quarter
wavelength antenna. Any frequency above 2.4 GHz may be OK
from a size perspective.
296 17 Low Power Radio
𝑃𝑇𝑋
𝑝=
4𝜋𝐷 2
𝜆2
𝐴𝑒 =
4𝜋
2
𝑃𝑇𝑋 𝜆
𝑃𝑅𝑋 = 2
𝐷 4𝜋
Or in terms of distance
𝑃𝑇𝑋 −𝑃𝑅𝑋 +20𝑙𝑜 𝑔10 𝑐
4𝜋 𝑓
𝐷 = 10 20
17.2 Carrier Frequency & Range 297
If we take the ideal equation above, and use some realistic numbers
for TX and RX power, we can estimate a range.
So the real world range of a radio can vary more than an order of
magnitude. Still, 2.4 GHz seems like a good choice for a mouse.
20 𝑙𝑜 𝑔10 𝑐/4𝜋 𝑓
D@n=2 D@n=6
Freq [dB] [m] [m] OK/NOK
2.45 GHz -40.2 97.4 4.6 :white_-
check_-
mark:
5.80 GHz -47.7 41.2 3.45 :white_-
check_-
mark:
24.12 -60.1 9.9 2.1 :x:
GHz
298 17 Low Power Radio
We could have a wired mouse for power, but that’s boring. Why
would we want a wired mouse to have wireless communication?
It must be powered by a battery, but what type of battery?
17.3.1 Battery
17.4 Decisions
Now we know that we need a 1 Mbps radio at 2.4 GHz that runs
of a 1.0 V - 1.8 V or 2.0 V - 3.6 V supply.
17.4.1 Modulation
People have been creative over the last 50 years in terms of encoding
bits onto carriers. Below is a small excerpt of some common
schemes.
17.4.2 BPSK
The equation for the unit circle is 𝑦 = 𝑒 𝑖(𝜔𝑡+𝜙) where 𝜙 is the phase,
and 𝜔 is the angular frequency.
Now imagine you have a strobe light matched to the “normal” car-
rier frequency. If one rotation of the wheel matched the frequency
of the strobe light, then the red dot would stay in exactly the same
place. If the wheel rotation was slightly faster, then the red dot
would move one way around the circle at every strobe. If the wheel
rotation was slightly slower, the red dot would move the other way
around the circle.
X X
R
There is another way to change phase 180 degrees, and that’s simply
to swap the phase in the transmitter circuit. Imagine as below we
have a local oscillator driving pseudo differential common source
stages with switches on top. If we flip the switches we can change
the phase 180 degrees pretty fast.
met
bo Jo bo I
Lo
jo
I
A É Fret B
q
R
LO
D
ti
Be it
LEE
I
In ZigBee, or 802.15.4 as the standard is called, the phase changes
is actually done with a constant envelope.
Q
The nice thing about constant envelope is that the radio transmitter
can be simple. We don’t need to change the amplitude. If we
have a PLL as a local oscillator, where we can change the phase
(or frequency), then we only need a power amplifier before the
LO
antenna.
jo pa
t B
q A
For phase and amplitude modulation, or complex transmitters, we
need a way to change the amplitude and phase. What a shocker.
LO pi
There are two ways to do that. A polar architecture where phase
change is done in the PLL, and amplitude in the power amplifier.
E
304 17 Low Power Radio
jo pa
I B
Fret
q A
R
LO pi
jo pa
LEE
I
A É Fret B
I q A
Or a Cartesian architecture where we make the in-phase compo-
nent, and quadrature-phase components in digital, then use two
R
pi pa
digital to analog converters, and a set of complex mixers to encode
onto the carrier. The powerLO amplifier would not need to change
Q
the amplitude, but it does need to be linear.
D
ti
Be it
LEE
I
LO
pa
Q
LO
j j
IR
Why would the constellation rotate you ask? Imagine the trans-
mitter transmits at 2 400 000 000 Hz. How does our reciever
generate the same frequency? We need a reference and a PLL.
The crystal-oscillator reference has a variation of +-50 ppm, so
2.4 𝑒 9 × 50/1 𝑒 6 = 120 kHz.
Assume our receiver local oscillator was at 2 400 120 000 Hz. The
transmitter sends 2 400 000 000 Hz + modulation. At the reciever we
multiply with our local oscillator, and if you remember your math,
multiplication of two sine creates a sum and a difference between
the two frequencies. As such, the low frequency part (the difference
between the frequencies) would be 120 kHz + modulation. As a
result, our constellation would rotate 120 000 times per second.
Assuming a symbol rate of 1MS/s our constellation would rotate
roughly 1/10 of the way each symbol.
Irx
Ei a
17.4.3 Single carrier, or multi carrier?
And I I Ault
Q
TX RX a S
9m glt
witta eilwitta.lt
Af e I I Af
IFFT TX RX a FFT
Q
outta
A.ltei
wt94 actei
There are more details in OFDM than the simple statement above,
but the details are just to fix challenges, such as “How do I recover
the symbol timing? How do I correct for frequency offset? How do
I ensure that my time domain signal terminates correctly for every
FFT chunk”
The genius with OFDM is that we can pick a few of the sub-carriers
to be pilot tones that carry no new information. If we knew exactly
what was sent in phase and amplitude, then we could measure the
phase and amplitude change due to the physical communication
channel, and we could correct the frequency space before we tried
to de-modulate.
In radio design there are so many choices it’s easy to get lost.
For our mouse, what radio scheme should we choose? One common
instances of “how to make a choice” in industry is “Delay the choice
as long as possible so your sure the choice is right”.
LNA ADC
Well, lets check if it’s a good idea. We know we’ll use 2.4 GHz, so
we need about 2.5 GHz bandwidth, at least. We know we want
good range, so maybe 100 dB dynamic range. In analog to digital
converter design there are figure of merits, so we can actually
compute a rough power consumption for such an ADC.
ADC FOM
𝑃
=
2𝐵𝑊 2𝑛
𝐵𝑊 = 2.5 GHz
At 1.6 W our mouse would only last for 2 hours. That’s too short.
It will never be a low power idea to convert the full 2.5 GHz
bandwidth to digital, we need some bandwidth selectivity in the
receive chain.
17.5 Bluetooth
Below are the Bluetooth LE channels. The green are the advertiser
channels, the blue are the data channels, and the yellow is the WiFi
channels.
The receive chain would have a LNA, mixer, anti-alias filter and
analog-to-digital converters. It’s likely that the receive path would
be complex (in-phase and quadrature phase) after mixer.
AAF ADC
IRX
MIX
LNA
AAF ADC QRX
I
MATCH
FREE
ADPLL
ITX
TX QTX
In the typical radio we’ll need the blocks below. I’ve added a column
for how many people I would want if I was to lead development
of a new radio.
Complexity
Blocks Key parameter Architecture(nr people)
Antenna Gain, impedance lambda/4 <1
RF match loss, input impedance PI- <1
match
Low noise NF, current, linearity LNTA 1
amp
17.6 Algorithm to design state-of-the-art LE radio 313
Complexity
Blocks Key parameter Architecture(nr people)
Mixer NF, current, linearity Passive 1
Anti-alias NF, current, linearity Active- 1
filter RC
ADC Sample rate, dynamic NS-SAR 1-2
range, linearity
PLL Phase noise, current AD-PLL 2-3
Baseband Eb/N0, gate count, SystemVerilog
> 10
current.
17.6.1 LNTA
The first thing that must happen in the radio is to amplify the noise
as early as possible. Any circuit has inherent noise, be it thermal-,
flicker-, burst-, or shot-noise. The earlier we can amplify the input
noise, the less contribution there will be from the radio circuits.
Vge Mixer
THE van
17.6.2 MIXER
In the mixer we multiply the input signal with our local oscillator.
Most often a complex mixer is used. There is nothing complex
about complex signal processing, just read
I
m
Is
Q2
Vn
I
LNA Un
a
Q2
un
Q
If the LO is the same as the carrier, then the modulation signal will
be at DC, often called direct conversion.
For FSK and direct conversion the low frequency noise can cause
issues, as such, it’s common to offset the LO from the transmitted
signal, for example 4 MHz offset. The low frequency noise problem
316 17 Low Power Radio
There is no “one correct choice”, there are trade-offs that both ways.
KISS (Keep It Simple Stupid) is one of my guiding principles when
working on radio architecture.
17.6.3 AAF
The anti alias filter rejects frequencies that can fold into the band
of interest due to sampling. A simple active-RC filters is often good
enough.
We often need gain in the AAF, as the LNA does not have sufficient
gain for the weakest signals. -100 dBm in 50 ohm is 6.2 nV RMS,
while input range of an ADC may be 1 V. Assume we place
the lowest input signal at 0.1 V, so we need a voltage gain of
20 log(0.1/6.2 𝑒 − 9) = 76dB in the reciever.
Gy
G Gs
or
Ca
L
CB
Vi G
63
Vo
17.6.4 ADC
At NTNU there have been multiple students through the years that
have made world-class ADCs, and there’s still students at NTNU
working on state-of-the-art ADCs.
The main selling point of that ADC was that it’s compiled from a
JSON file, a SPICE file and a technology file into a DRC/LVS clean
layout.
CK D8 CK D7 CK D6 CK D5 CK D4 CK D3 CK D2 CK D1 CK D0
DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N DP 1 P N
CI CO CI CO CI CO CI CO CI CO CI CO CI CO CI CO CI CO
LOGIC[8] LOGIC[7] LOGIC[6] LOGIC[5] LOGIC[4] LOGIC[3] LOGIC[2] LOGIC[1] LOGIC[0] CK
CK EI EO EI EO EI EO EI EO EI EO EI EO EI EO EI EO EI EO
DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 0 DP 1 DN 0 DN 1 DP 1 DN 0 DP 1 DN 0 DP 1 DN 0 DP 1 DN 0 X1
X2
CK
CK CM P
VP +
P
VN −
Bootstrapped 28 · CU N IT 27 · CU N IT 26 · CU N IT 25 · CU N IT 24 · CU N IT 23 · CU N IT 22 · CU N IT 21 · CU N IT 20 · CU N IT N
NMOS switches
(a)
MP 6 MP 7
DP 0 DN 0 DN 1 DP 1
N MP 2 EI MN 6 EI MN 9
A
EI MN 0 P MP 1 MN 5 MN 8
EO B
P MN 1 N MN 2 MN 3 P MN 4 N MN 7 CK MN 10
CI CO
I detest doing anything twice, so I love the fact that I never have to
re-draw that ADC again. I just fix the technology file (and maybe
some tweaks to the other files), and I have a completed ADC.
318 17 Low Power Radio
Comparator
Logic
106µm
CDAC
80µm
Switch
39µm
40µm
(a) (b)
17.6.5 AD-PLL
The phase locked loop is the heart of the radio, and it’s probably
the most difficult part to make. Depends a bit on technology, but
these days, All Digital PLLs are cool. Start by reading Razavi’s PLL
book.
food
ED N
fin to
yes
fmod
- ferror
DCO Cal. Engine
lf_state fine mode coarse
+
CLK Loop Filter
1 coarse
enable set_state
Sync. Phase Error
0 a0 + + DCO OUT
z -1 0
Counter Logic 1 + +
a1
BB-PD z -1
SS
D Q Detect
Q
enable
17.6.6 Baseband
Once the signal has been converted to digital, then the de-
modulation, and signal fixing start. That’s for another course, but
there are interesting challenges.
In the block diagram of the device the radio might be a small box,
and the person using the radio might not realize how complex the
radio actually is.
One of the first commercial ADCs, the DATRAC on page 24, was
a 11-bit 50 kSps that consumed 500 W. That’s Walden figure of
merit of 4 𝜇J/conv.step. Today’s state-of-the-art ADCs in the same
sampling range have a Walden figure of merit of 0.6 fJ/conv.step.
For wireless standards, there are some that can be run on en-
18.1 Thermoelectric 325
Other standards, like Bluetooth, WiFi, LTE are harder to run battery
less, because the energy requirement above 1 mW.
18.1 Thermoelectric
Apply heat to one end of a metal wire, what happens to the free
electrons? As we heat the material we must increase the energy
of the free electrons at the hot end of the wire. The atoms wiggle
more, and when the free electrons scatter off the atomic structure
there should be an exchange of energy. Think of the electrons at
the hot side as high energy electrons, while on the cold side there
are low energy electrons, I think.
Take a copper wire, bend it in half, heat the end with the loop, and
measure the voltage at the cold end. Would we measure a voltage
difference?
NO, there would not be a voltage difference between the two ends
of the wire. The voltage on the loop side would be different, but on
the cold side, where we have the ends, there would be no voltage
difference.
The voltage difference in the material between the hot and cold
end will create currents, but we can’t use them if we only have one
type of material.
The voltage difference at the hot and cold end is described by the
Seebeck coefficient
In the picture below we have a silicon (the cyan and yellow col-
ors).
For the material doped with donors (cyan, n-type) the Fermi level
is shifted towards the Conduction band (𝐸𝐶 ), and the dominant
charge transport is by electrons, maybe we get -1 mV/K from the
picture above.
Nuclear batteries were used in Voyager, and they still work to this
day. The nuclear battery is the round thing underneath Voyager
in the picture below. The radioisotopes provide the heat, space
provides the cold, and voila, 470 W to run the electronics.
330 18 Energy Sources
Ll or
1 50MY ÉITga
18.2 Photovoltaic
man
piezo
An electron/hole pair knocked out in the depletion region (1) will
separate due to the built-in field. The hole will go to P and the
electron to N. This increases the voltage VD across the diode.
Pr
A similar effect will occur if the electron/hole pair is knocked out
in the P region (2). Although the P region has an abundance of
holes, the electron will not recombine immediately. If the electron
diffuses close to the depletion region, then it will be swept across
to the N side, and further increase VD.
B A
P
minorities
imminent 3
up t
Va P
A circuit model of a Photodiode can be seen in figure below, where
Vb P
it is assumed that a single photodiode is used. It is possible to stack
photodiodes to get a higher output voltage.
Vb P
332 18 Energy Sources
man
piezo
Pr
As the load current is increased, the voltage VD will drop. As the
photo current is increased, the voltage VD will increase. As such,
there is an optimum current load where there is a balance between
the photocurrent, the voltage VD and the load current.
𝑉𝐷
𝐼 𝐷 = 𝐼𝑆 𝑒 𝑉𝑇
−1
𝐼𝐷 = 𝐼𝑃 ℎ𝑜𝑡𝑜 − 𝐼𝐿𝑜𝑎𝑑
𝐼𝑃 ℎ𝑜𝑡𝑜 − 𝐼𝐿𝑜𝑎𝑑
𝑉𝐷 = 𝑉𝑇 𝑙𝑛 +1
𝐼𝑆
𝑃𝐿𝑜𝑎𝑑 = 𝑉𝐷 𝐼𝐿𝑜𝑎𝑑
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
m = 1e-3
i_load = np.linspace(1e-5,1e-3,200)
P_load = V_D*i_load
plt.subplot(2,1,1)
18.3 Piezoelectric 333
plt.plot(i_load/m,V_D)
plt.ylabel("Diode voltage [mA]")
plt.grid()
plt.subplot(2,1,2)
plt.plot(i_load/m,P_load/m)
plt.xlabel("Current load [mA]")
plt.ylabel("Power Load [mW]")
plt.grid()
plt.savefig("pv.pdf")
plt.show()
From the plot below we can see that to optimize the power we
could extract from the photovoltaic cell we’d want to have a current
of 0.9 mA in the model above.
0.5
Diode voltage [V]
0.4
0.3
0.2
0.1
0.0
0.0 0.2 0.4 0.6 0.8 1.0
0.4
Power Load [mW]
0.3
0.2
0.1
0.0
0.0 0.2 0.4 0.6 0.8 1.0
Current load [mA]
18.3 Piezoelectric
I’m not sure I understand the piezoelectric effect, but I think it goes
something like this.
334 18 Energy Sources
From Gausses law we know that the electric field through a surface
is determined by the volume integral of the charges inside.
∮ ∭
1
E · 𝑑S = 𝜌 · 𝑑𝑉
𝜕Ω 𝜖0 𝑉
18.4 Electromagnetic
𝜆
Inductive <
2𝜋
Within the inductive near field the antenna’s can “feel” each other.
The NFC reader inside the card reader can “feel” the antenna of
the NFC tag. When the tag get’s close it will load down the NFC
reader by presenting a load impedance. As the circuit inside the
tag is powered, it can change the impedance of it’s antenna, which
is sensed by the reader, and thus the reader can get data from the
tag. The tag could lock in on the 13.56 MHz frequency and decode
both amplitude and phase modulation from the reader.
AirFuel RF
dBm W
30 1
0 1m
-30 1u
-60 1n
-90 1p
Now ask your self the question “What’s the power at a certain
distance?”. It’s easier to flip the question, and use Friis to calculate
the distance.
Assume
𝑃𝑇𝑋
= 1 W (30 dBm) and
𝑃𝑅𝑋
18.5 Triboelectric generator 337
= 10 uW (-20 dBm)
then
𝑃𝑇𝑋 −𝑃𝑅𝑋 +20 𝑙𝑜 𝑔10 𝑐
4𝜋 𝑓
𝐷 = 10 20
In the table below we can see the distance is not that far!
The key circuit challenge is the rectifier, and the high voltage output
of the triboelectric generator.
The key idea of the triboelectric circuit below is to rectify the sparse
voltage pulses and store the charge on a capacitor. Once the voltage
is high enough, then a temperature sensor is started.
18.5 Triboelectric generator 339
Also notice the “VDD_ext” in the figure. That means the system is
not fully harvested. The paper is a prime example on how we in
academia can ignore key portions of a system. They’ve focused on
the harvesting part, and making the temperature dependent pulse
width modulated signal. Maybe they’ve completely ignored how
the data is transmitted from the system to where it would be used,
and that’s OK.
18.6 Comparison
For a “energy harvesting circuit” you must also know the applica-
tion (wrist watch, or wall switch) to know what energy source is
available.
The power levels below are too low for the peak power consumption
of integrated circuits, so most applications must include a charge
storage device, either a battery, or a capacitor.
18.7 Want to learn more? 341
In analog on top we take the digital IP, and do the top level layout
by hand in analog tools.
The GDSII is not sufficient to integrate the analog IP. The digital
needs to know how the analog works, what capacitance is on every
digital input, the propagation delay for digital input to digital
outputs , the relation between digital outputs and clock inputs,
and the possible load on digital outputs.
There are both commercial an open source tools for digital simula-
tion. If you’ve never used a digital simulator, then I’d recommend
you start with iverilog. I’ve made some examples at dicex.
Commercial
▶ Cadence Excelium
▶ Siemens Questa
▶ Synopsys VCS
19.1.0.2 Counter
module counter(
output logic [WIDTH-1:0] out,
input logic clk,
input logic reset
);
parameter WIDTH = 8;
19.1 Digital simulation 347
endmodule // counter
For example:
X: no further events
When we synthesis the code below into a netlist it’s a bit harder to
see how the events will be scheduled, but we can notice that clk
and reset are still inputs, and for example the clock is connected to
d-flip-flops. The image below is the synthesized netlist
The nodal matrix could look like the matrix below, 𝑖 are the currents,
𝑣 the voltages, and 𝐺 the conductances between nodes.
▶ Euler
▶ Runge-Kutta
▶ Crank-Nicolson
▶ Gear
The system will have two simulators, one analog, with transient
simulation and differential equation solver, and a digital, with
event queue.
Most of the time, it’s stupid to try and simulate complex system-
on-chip with mixed-signal , full detail, simulation.
For IPs, like an ADC, co-simulation works well, and is the best way
to verify the digital and analog.
Digital Analog
Simulator Simulator
//tt06-sar/src/project.v
module tt_um_TT06_SAR_wulffern (
input wire VGND,
input wire VPWR,
input wire [7:0] ui_in,
output wire [7:0] uo_out,
input wire [7:0] uio_in,
output wire [7:0] uio_out,
output wire [7:0] uio_oe,
`ifdef ANA_TYPE_REAL
input real ua_0,
input real ua_1,
`else
// analog pins
inout wire [7:0] ua,
`endif
input wire ena,
input wire clk,
input wire rst_n
);
//tt06-sar/src/tb_ana.v
`ifdef ANA_TYPE_REAL
real ua_0 = 0;
real ua_1 = 0;
`else
tri [7:0] ua;
logic uain = 0;
assign ua = uain;
`endif
`ifdef ANA_TYPE_REAL
always #100 begin
ua_0 = $sin(2*3.14*1/7750*$time);
ua_1 = -$sin(2*3.14*1/7750*$time);
end
19.4 Analog SystemVerilog Example 353
`endif
//tt06-sar/src/tb_ana.v
tt_um_TT06_SAR_wulffern dut (
.VGND(VGND),
.VPWR(VPWR),
.ui_in(ui_in),
.uo_out(uo_out),
.uio_in(uio_in),
.uio_out(uio_out),
.uio_oe(uio_oe),
`ifdef ANA_TYPE_REAL
.ua_0(ua_0),
.ua_1(ua_1),
`else
.ua(ua),
`endif
.ena(ena),
.clk(clk),
.rst_n(rst_n)
);
#tt06-sar/src/Makefile
runa:
iverilog -g2012 -o my_design -c tb_ana.fl -DANA_TYPE_REAL
_
vvp -n my design
rund:
iverilog -g2012 -o my_design -c tb_ana.fl
vvp -n my_design
//tt06-sar/src/project.v
//Main SAR loop
always_ff @(posedge clk or negedge clk) begin
if(~ui_in[0]) begin
state <= OFF;
tmp = 0;
dout = 0;
end
else begin
if(OFF) begin
end
else if(clk == 1) begin
state = SAMPLE;
end
else if(clk == 0) begin
354 19 Analog SystemVerilog
state = CONVERT;
`ifdef ANA_TYPE_REAL
smpl = ua_0 - ua_1;
tmp = smpl;
else begin
tmp = tmp + lsb*2**(i-1);
if(i==7)
dout[i] = 1;
else
dout[i] = 0;
end
end
`else
if(tmp == 0) begin
dout[7] <= 1;
tmp <= 1;
end
else begin
dout[7] <= 0;
tmp = 0;
end
`endif
end
state = next_state;
end // else: !if(~ui_in[0])
end // always_ff @ (posedge clk)
//tt06-sar/src/project.v
always @(posedge done) begin
state = DONE;
sampled_dout = dout;
end
#2 done = 0;
else if(state == SAMPLE)
#1.6 done = 0;
else if(state == CONVERT)
#115 done = 1;
end
356 19 Analog SystemVerilog
or
358 20 How to write a project report
Shorter is better
You write a text to place ideas into anothers head. Ideas and
thoughts are best communicated in chunks. I can write a dense set
of text, or I can split a dense set of text into multiple paragraphs.
The more I try to cram into a paragraph, for example, how magical
the weather has been the last weeks, with lots of snow, and good
skiing, the more difficult the paragraph is to read.
You write a text to place ideas into anothers head. Ideas and
thoughts are best communicated in chunks.
I can write a dense set of text, or I can split a dense set of text into
multiple paragraphs.
The more I try to cram into a paragraph, for example, how magical
the weather has been the last weeks, with lots of snow, and good
skiing, the more difficult the paragraph is to read.
If you did something, then say “I” in the text. If there were more
people, then use “we”.
▶ As a result,
▶ As such,
▶ Accordingly,
▶ Consequently,
20.3.1 Introduction
The purpose of the introduction is to put the reader into the right
frame of mind. Introduce the problem statement, key references,
the key contribution of your work, and an outline of the work
presented. Think of the introduction as explaining the “Why” of
the work.
Although everyone has the same assignment for the project, you
have chosen to solve the problem in different ways. Explain what
you consider the problem statement, and tailor the problem state-
ment to what the reader will read.
Key references are introduced. Don’t copy the paper text, write
why they designed the circuit, how they chose to implement it,
and what they achieved. The reason we reference other papers
in the introduction is to show that we understand the current
state-of-the-art. Provide a summary where state-of-the-art has
moved since the original paper.
20.3.2 Theory
It is safe to assume that all readers have read the key references, if
they have not, then expect them to do so.
20.3.3 Implementation
For the analog, explain the design decisions you made, how did
you pick the transistor sizes, and the currents. Did you make other
choices than in the references? How does the circuit work?
For the digital, how did you divide up the digital? What were the
design choices you made? How did you implement readout of the
data? Explain what you did, and how it works. Use state diagrams
and block diagrams.
Use clear figures (i.e. circuitikz), don’t use pictures from schematic
editors.
20.3.4 Result
For analog circuits, show results from each block. Highlight key
parameters, like current and delay of comparator. Demonstrate
that the full analog system works.
20.3.5 Discussion
Give some insight into what is missing in the work. What should
be the next steps?
20.3.7 Conclusion
20.3.8 Appendix
20.4 Checklist
Item Description OK
Is the Describe which parts of the problem you chose
problem to focus on. The problem description should
description match the results you’ve achieved.
clearly
defined?
Is there a The reader might need help to understand why
clear the problem is interesting
explanation
why the
problem is
worth
solving?
Is status of You should make sure that you know what
state-of-the- others have done for the same problem. Check
art clearly IEEEXplore. Provide summary and references.
explained? Explain how your problem or solution is
different
Is the key Highlight what you’ve achieved. What was
contribu- your contribution?
tion clearly
explained?
Is there an Give a short summary of what the reader is
outline of about to read
the report?
362 20 How to write a project report
Item Description OK
Is it Have you included references to relevant
possible for papers
a reader
skilled in
the art to
understand
the work?
Is the The theory section should be less than 10 % of
theory the work
section too
long
Are all Have you explained how every single block
circuits works?
explained?
Are figures Remember to explain all colors, and all
clear? symbols. Explain what the reader should
understand from the figure. All figures must be
referenced in the text.
Is it clear It’s a good idea to explain what type of
how you testbenches you used. For example, did you use
verified the dc, ac or transient to verify your circuit?
circuit?
Are key You at least need current from VDD. Think
parameters through what you would need to simulate to
simulated? prove that the circuit works.
Have you Knowing how circuits fail will increase
tried to confidence that it will work under normal
make the conditions.
circuit fail?
Have you Try to look at the verification from different
been critical perspectives. Play devil’s advocate, try to think
of your own through what could go wrong, then explain
results? how your verification proves that the circuit
does work.
Have you Imagine that someone reads your work. Maybe
explained they want to reproduce it, and take one step
the next further. What should that step be?
steps?
No new in- Never put new information into conclusion. It’s
formation a summary of what’s been done
in
conclusion.
Story Does the work tell a story, is it readable? Don’t
surprise the reader by introducing new topics
without background information.
20.4 Checklist 363
Item Description OK
Chronology Don’t let the report follow the timeline of the
work done. What I mean by that is don’t write
“first I did this, then I spent huge amount of
time on this, then I did that”. No one cares what
the timeline was. The report does not need to
follow the same timeline as the actual work.
Too much How much time you spent on something
time should not be correlated to how much text
there is in the report. No one cares how much
time you spent on something. The report is
about why, how, what and does it work.
Length A report should be concise. Only include what
is necessary, but no more. Shorter is almost
always better than longer.
Template Use IEEEtran.cls. Example can be seen from an
old version of this document at
https://github.com/wulffern/dic2021/tree/
main/2021-10-19_project_report. Write in
LaTeX. You will need LaTeX for your project
and master thesis. Use http://overleaf.com if
you’re uncomfortable with local text editors
and LaTeX.
Spellcheck Always use a spellchecker. Misspelled words
are annoying, and may change content and
context (peaked versus piqued)
Bibliography