Advanced Integrated Circuits: Carsten Wulff
Advanced Integrated Circuits: Carsten Wulff
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? . . . . . . . . . . 6
2.4.2 What the team needs to know to design ICs 6
2.4.3 Zen of IC design (stolen from Zen of Python) 7
2.4.4 IC design mantra . . . . . . . . . . . . . . 8
2.4.5 Analog Design Process . . . . . . . . . . . 8
2.5 My Goal . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Syllabus . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 JNW (2025) . . . . . . . . . . . . . . . . . . . . . 10
2.7.1 Grading . . . . . . . . . . . . . . . . . . . 12
2.7.2 Group dynamics . . . . . . . . . . . . . . 12
2.8 Software . . . . . . . . . . . . . . . . . . . . . . . 13
3 A Refresher 15
3.1 There are standard units of measurement . . . . 15
3.2 Electrons . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 Probability . . . . . . . . . . . . . . . . . . . . . . 16
3.4 Uncertainty principle . . . . . . . . . . . . . . . . 17
3.5 States as a function of time and space . . . . . . 17
3.6 Allowed energy levels in atoms . . . . . . . . . . 18
3.7 Allowed energy levels in solids . . . . . . . . . . 18
3.8 Silicon Unit Cell . . . . . . . . . . . . . . . . . . . 19
3.9 Band structure . . . . . . . . . . . . . . . . . . . 20
3.10 Valence band and Conduction band . . . . . . . 21
3.11 Fermi level . . . . . . . . . . . . . . . . . . . . . . 21
3.12 Metals . . . . . . . . . . . . . . . . . . . . . . . . 22
3.13 Insulators . . . . . . . . . . . . . . . . . . . . . . 22
3.14 Semiconductors . . . . . . . . . . . . . . . . . . . 23
3.15 Band diagrams . . . . . . . . . . . . . . . . . . . 23
3.16 Density of electrons/holes . . . . . . . . . . . . . 23
3.17 Fields . . . . . . . . . . . . . . . . . . . . . . . . 24
3.18 Permittivity and Permeability . . . . . . . . . . . 24
3.19 Quantum electrodynamics . . . . . . . . . . . . . 25
3.20 Voltage . . . . . . . . . . . . . . . . . . . . . . . . 25
3.21 Current . . . . . . . . . . . . . . . . . . . . . . . 25
3.22 Drift current . . . . . . . . . . . . . . . . . . . . . 26
3.23 Diffusion current . . . . . . . . . . . . . . . . . . 27
3.24 Why are there two currents? . . . . . . . . . . . . 27
3.25 Currents in a semiconductor . . . . . . . . . . . 27
3.26 Resistors . . . . . . . . . . . . . . . . . . . . . . . 28
3.27 Capacitors . . . . . . . . . . . . . . . . . . . . . . 28
3.28 Inductors . . . . . . . . . . . . . . . . . . . . . . 28
4 Diodes 29
4.1 Why . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Silicon . . . . . . . . . . . . . . . . . . . . . . . . 29
4.3 Intrinsic carrier concentration . . . . . . . . . . . 31
4.4 It’s all quantum . . . . . . . . . . . . . . . . . . . 32
4.4.1 Density of states . . . . . . . . . . . . . . 34
4.4.2 How to think about electrons (and holes) 36
4.5 Doping . . . . . . . . . . . . . . . . . . . . . . . . 37
4.6 PN junctions . . . . . . . . . . . . . . . . . . . . 38
4.6.1 Built-in voltage . . . . . . . . . . . . . . . 38
4.6.2 Current . . . . . . . . . . . . . . . . . . . 39
4.6.3 Forward voltage temperature dependence 41
4.6.4 Current proportional to temperature . . . 42
4.7 Equations aren’t real . . . . . . . . . . . . . . . . 43
References . . . . . . . . . . . . . . . . . . . . . . 44
5 Noise 45
5.1 Noise . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Statistics . . . . . . . . . . . . . . . . . . . . . . . 45
5.3 Average Power . . . . . . . . . . . . . . . . . . . 46
5.4 Noise Spectrum . . . . . . . . . . . . . . . . . . . 47
5.5 Probability Distribution . . . . . . . . . . . . . . 48
5.6 PSD of a white noise source . . . . . . . . . . . . 49
5.7 Summing noise sources . . . . . . . . . . . . . . 49
5.8 Signal to Noise Ratios . . . . . . . . . . . . . . . 50
5.9 Noise figure and Friis formula . . . . . . . . . . 51
5.10 Spectral Density . . . . . . . . . . . . . . . . . . 51
5.10.1 Definition of Spectral Density . . . . . . . 52
5.10.2 Sources of Confusion . . . . . . . . . . . . 52
5.10.3 Example: Thermal Noise . . . . . . . . . . 54
5.10.4 Einstein: The source . . . . . . . . . . . . 54
6 Sky130nm tutorial 57
6.1 Tools . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.1.1 Setup WSL (Applicable for Windows users) 57
6.1.2 Setup public key towards github . . . . . 57
6.1.3 Provide git with author identity . . . . . 58
6.1.4 Get AICEX and setup your shell . . . . . 58
6.1.5 On systems with python3 > 3.12 . . . . . 58
6.1.6 Install Tools . . . . . . . . . . . . . . . . . 59
6.1.7 Install cicconf . . . . . . . . . . . . . . . . 59
6.1.8 Install cicsim . . . . . . . . . . . . . . . . 60
6.1.9 Setup your ngspice settings . . . . . . . . 60
6.2 Check that magic and xschem works . . . . . . . 60
6.3 Design tutorial . . . . . . . . . . . . . . . . . . . 60
6.3.1 Create the IP . . . . . . . . . . . . . . . . 60
6.3.2 The file structure . . . . . . . . . . . . . . 60
6.3.3 Github setup . . . . . . . . . . . . . . . . 62
6.3.4 Start working . . . . . . . . . . . . . . . . 63
6.3.5 Draw Schematic . . . . . . . . . . . . . . 63
6.3.6 Typical corner SPICE simulation . . . . . 64
6.3.7 All corners SPICE simulations . . . . . . 67
6.3.8 Draw Layout . . . . . . . . . . . . . . . . 69
6.3.9 Layout verification . . . . . . . . . . . . . 74
6.3.10 Extract layout parasitics . . . . . . . . . . 74
6.3.11 Simulate with layout parasitics . . . . . . 75
6.3.12 Make documentation . . . . . . . . . . . . 75
6.3.13 Edit [Link] . . . . . . . . . . . . . . . . 76
6.3.14 Setup github pages . . . . . . . . . . . . . 76
6.3.15 Frequency asked questions . . . . . . . . 76
7 Analog Design 77
7.1 Checklist . . . . . . . . . . . . . . . . . . . . . . . 77
7.1.1 Specification . . . . . . . . . . . . . . . . . 77
7.1.2 Design . . . . . . . . . . . . . . . . . . . . 78
7.1.3 Tapeout . . . . . . . . . . . . . . . . . . . 78
7.2 Schematic rules . . . . . . . . . . . . . . . . . . . 78
7.3 Layout rules . . . . . . . . . . . . . . . . . . . . . 80
8 IC and ESD 83
8.1 What blocks must our IC include? . . . . . . . . 83
8.2 Electrostatic Discharge . . . . . . . . . . . . . . . 86
8.2.1 When do ESD events occur? . . . . . . . . 87
8.2.2 Before/during PCB . . . . . . . . . . . . . 87
8.2.3 After PCB . . . . . . . . . . . . . . . . . . 87
8.2.4 Human body model (HBM) . . . . . . . . 88
8.2.5 Charged device model (CDM) . . . . . . 88
8.3 An HBM ESD zap example . . . . . . . . . . . . 90
8.4 Permutations . . . . . . . . . . . . . . . . . . . . 91
8.4.1 Why does this work? . . . . . . . . . . . . 93
8.5 But I just want a digital input, what do I need? . 96
8.5.1 Input buffer . . . . . . . . . . . . . . . . . 97
8.6 Latch-up . . . . . . . . . . . . . . . . . . . . . . . 98
8.6.1 How can current in one place lead to a
current somewhere else? . . . . . . . . . . 98
8.7 Want to learn more? . . . . . . . . . . . . . . . . 100
15 Oscillators 235
15.1 Atomic clocks . . . . . . . . . . . . . . . . . . . . 235
15.1.1 Microchip 5071B Cesium Primary Time and
Frequency Standard . . . . . . . . . . . . 235
15.1.2 Rubidium standard . . . . . . . . . . . . . 236
15.2 Crystal oscillators . . . . . . . . . . . . . . . . . . 238
15.2.1 Impedance . . . . . . . . . . . . . . . . . 239
15.2.2 Circuit . . . . . . . . . . . . . . . . . . . . 241
15.2.3 Temperature behavior . . . . . . . . . . . 243
15.3 Controlled Oscillators . . . . . . . . . . . . . . . 244
15.3.1 Ring oscillator . . . . . . . . . . . . . . . . 244
15.3.2 Capacitive load . . . . . . . . . . . . . . . 245
15.3.3 Realistic . . . . . . . . . . . . . . . . . . . 246
15.3.4 Digitally controlled oscillator . . . . . . . 248
15.3.5 Differential . . . . . . . . . . . . . . . . . 248
15.3.6 LC oscillator . . . . . . . . . . . . . . . . . 249
15.4 Relaxation oscillators . . . . . . . . . . . . . . . . 251
15.5 Want to learn more? . . . . . . . . . . . . . . . . 251
15.5.1 Crystal oscillators . . . . . . . . . . . . . . 251
15.5.2 CMOS oscillators . . . . . . . . . . . . . . 252
21 MOSFETs 321
21.1 Metal Oxide Semiconductor . . . . . . . . . . . . 321
21.2 Field Effect . . . . . . . . . . . . . . . . . . . . . 323
21.3 Analog transistors in the books . . . . . . . . . . 327
21.4 Transistors in weak inversion . . . . . . . . . . . 329
21.5 Transistors in strong inversion . . . . . . . . . . . 332
21.6 How should I size my transistor? . . . . . . . . . 335
21.7 Introduction to behavior . . . . . . . . . . . . . . 336
21.7.1 Drain Source Current . . . . . . . . . . . 336
21.7.2 Gate-source voltage . . . . . . . . . . . . 337
21.7.3 Inversion level . . . . . . . . . . . . . . . 337
21.7.4 Drain source voltage . . . . . . . . . . . . 339
21.7.5 Strong inversion . . . . . . . . . . . . . . 340
21.7.6 Low frequency model . . . . . . . . . . . 342
21.7.7 Transconductance . . . . . . . . . . . . . 342
21.7.8 Intrinsic gain . . . . . . . . . . . . . . . . 343
21.7.9 High frequency model . . . . . . . . . . . 344
21.7.10 Be careful with Cgd (blame Miller) . . . . 346
21.8 Weak inversion . . . . . . . . . . . . . . . . . . . 347
21.9 Velocity saturation . . . . . . . . . . . . . . . . . 348
21.9.1 Square law model . . . . . . . . . . . . . 349
21.9.2 Mobility Degradation . . . . . . . . . . . 349
21.9.3 What about holes (PMOS) . . . . . . . . . 350
21.10 OTHER . . . . . . . . . . . . . . . . . . . . . . . 350
21.10.1 Drain induced barrier lowering (DIBL) . . 351
21.10.2 Well Proximity Effect (WPE) . . . . . . . . 352
21.10.3 Stress effects . . . . . . . . . . . . . . . . . 352
21.10.4 Gate current . . . . . . . . . . . . . . . . . 353
21.10.5 Hot carrier injection . . . . . . . . . . . . 353
21.10.6 Channel initiated secondary-electron
(CHISEL) . . . . . . . . . . . . . . . . . . 354
21.11 Variability . . . . . . . . . . . . . . . . . . . . . . 354
21.11.1 Voltage variation . . . . . . . . . . . . . . 355
21.11.2 Systematic variations . . . . . . . . . . . . 355
21.11.3 Process variations . . . . . . . . . . . . . 356
21.11.4 Process corners . . . . . . . . . . . . . . . 356
21.11.5 Fix process variation . . . . . . . . . . . . 357
21.11.6 Temperature variation . . . . . . . . . . . 357
21.11.7 It depends on
𝑉𝐷𝐷
. . . . . . . . . . . . . . . . . . . . . . . . 358
21.11.8 How do we fix temperature variation? . . 358
21.11.9 Random Variation . . . . . . . . . . . . . 358
21.11.10 Pelgrom’s law . . . . . . . . . . . . . . . . 359
21.11.11 Transistors with same
𝑉𝐺𝑆
. . . . . . . . . . . . . . . . . . . . . . . . 359
21.11.12 What else can we do? . . . . . . . . . . . . 360
21.11.13 Transistor Noise . . . . . . . . . . . . . . . 361
22 Circuits 363
22.1 Current Mirrors . . . . . . . . . . . . . . . . . . . 363
22.1.1 Normal current mirror . . . . . . . . . . . 363
22.1.2 Source degeneration . . . . . . . . . . . . 366
22.1.3 Output resistance . . . . . . . . . . . . . . 367
22.2 Amplifiers . . . . . . . . . . . . . . . . . . . . . . 370
22.3 Source follower . . . . . . . . . . . . . . . . . . . 370
22.3.1 Output resistance . . . . . . . . . . . . . . 370
22.3.2 Why use a source follower? . . . . . . . . 371
22.4 Common gate . . . . . . . . . . . . . . . . . . . . 372
22.4.1 Input resistance . . . . . . . . . . . . . . . 373
22.4.2 Output resistance . . . . . . . . . . . . . . 373
22.4.3 Gain . . . . . . . . . . . . . . . . . . . . . 373
22.5 Common source . . . . . . . . . . . . . . . . . . 374
22.5.1 Gain . . . . . . . . . . . . . . . . . . . . . 375
22.5.2 Why common source? . . . . . . . . . . . 376
22.6 Differential pair . . . . . . . . . . . . . . . . . . . 376
22.6.1 Diff pairs are cool . . . . . . . . . . . . . . 377
24 SPICE 389
24.1 SPICE . . . . . . . . . . . . . . . . . . . . . . . . 389
24.2 Simulation Program with Integrated Circuit Em-
phasis . . . . . . . . . . . . . . . . . . . . . . . . 389
24.2.1 Today . . . . . . . . . . . . . . . . . . . . 389
24.2.2 But . . . . . . . . . . . . . . . . . . . . . . 390
24.2.3 Sources . . . . . . . . . . . . . . . . . . . 391
24.2.4 Passives . . . . . . . . . . . . . . . . . . . 392
24.2.5 Transistor Models . . . . . . . . . . . . . . 392
24.2.6 Transistors . . . . . . . . . . . . . . . . . . 394
24.2.7 Foundries . . . . . . . . . . . . . . . . . . 394
24.3 Find right transistor sizes . . . . . . . . . . . . . 394
24.3.1 Use unit size transistors for analog design 395
24.3.2 What about gm/Id ? . . . . . . . . . . . . 395
24.3.3 Characterize the transistors . . . . . . . . 396
24.4 More information . . . . . . . . . . . . . . . . . . 396
24.5 Analog Design . . . . . . . . . . . . . . . . . . . 396
24.6 Demo . . . . . . . . . . . . . . . . . . . . . . . . 396
I feel the lectures have gotten better. I did not take attendance in
2023, but there were 19 students that took the exam in 2024. I don’t
have all the dates, but an average attendance of 76 %.
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
Wk Attendance
2 21
3 21
4 23
5 20
6 22
7 24
9 20
9 24
11 20
12 17
14 16
15 14
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.
In 2025 I made a few tweaks. One change was the grading of the
project, I used github actions to do the GDS,DRC,LVS,SIM and
docs. The grading did not really work that well, although, it was a
good way to get students to get the designs correct on github. The
first milestones with the sim and the doc did not work. The last
milestone actions worked well.
For 2026 I should do the following changes:
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,
patience, and brain necessary to learn some of the hardest topics
in the world.
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.
2.4 There will always be analog circuits, because the real world is analog 5
[Link]
-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.
6 2 Introduction
Idea
Analog Design
Xschem
Parasitics
GDSII
Magic
RTL to GDSII
OpenLane
Tapeout
When you learn something new, it’s good to listen to someone that
has done whatever it is before.
Here is some guiding principles that you’ll likely forget.
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.
2.6 Syllabus 9
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.
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.
10 2 Introduction
“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 (𝑇)
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
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.
[Link] 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 13
2.8 Software
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 + 𝐴
and
𝐸2 = 𝐸0 − 𝐴
3.8 Silicon Unit Cell 19
𝐸𝐺 = 𝐸𝐶 − 𝐸𝑉
1
𝑓 (𝐸) =
𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇 +1
If the energy of the state is more than a few kT away from the
Fermi-level, then
3.12 Metals
In metals, the band splitting of the energy levels causes the valence
band and conduction band to overlap.
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
print("Bandgap of glass is above %.2f eV, maybe around %.2f eV " %(e_optical,e_ultra))
3.14 Semiconductors 23
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.
𝐼 = Area × 𝐽
26 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/𝑅
𝐼 = 𝐺𝑉 ⇒ 𝑉 = 𝑅𝐼
3.23 Diffusion current 27
Or Ohms law
𝑑𝜌
𝐽 = −𝑞𝐷𝑛
𝑑𝑥
ℏ2 𝜕 2 𝜕
− 𝜓(𝑥, 𝑡) + 𝑉(𝑥)𝜓(𝑥, 𝑡) = 𝑖ℏ 𝜓(𝑥, 𝑡)
2𝑚 𝜕 𝑥
2 𝜕𝑡
Both holes and electrons can only move if there are available
quantum states.
3.26 Resistors
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−𝜔𝑡)
4.4 It’s all quantum 33
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
𝑓 (𝐸) = = 𝑒 (𝐸𝐹 −𝐸)/𝑘𝑇
𝑒 (𝐸−𝐸𝐹 )/𝑘𝑇
𝑁𝑒 𝑑𝐸 = 𝑁(𝐸) 𝑓 (𝐸)𝑑𝐸
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
𝑝 𝑝 = 𝑁𝐴 , 𝑛 𝑝 =
𝑁𝐴
38 4 Diodes
4.6 PN junctions
The charge difference will create a field, and a built-in voltage will
develop across the depletion region.
∫ ∞
𝑛= 𝑁(𝐸) 𝑓 (𝐸)𝑑𝐸
𝐸𝐶
∫ ∞
𝐸𝐹𝑛 /𝑘𝑇
𝑛𝑛 = 𝑒 𝑁𝑛 (𝐸)𝑒 −𝐸/𝑘𝑇 𝑑𝐸
𝐸𝐶
∫ ∞
𝐸𝐹𝑝 /𝑘𝑇
𝑛𝑝 = 𝑒 𝑁𝑝 (𝐸)𝑒 −𝐸/𝑘𝑇 𝑑𝐸
𝐸𝐶
4.6 PN junctions 39
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
4.6.2 Current
𝑝𝑝
= 𝑒 −𝑞Φ0 /𝑘𝑇
𝑝𝑛
𝑝(−𝑥 𝑝 0 )
= 𝑒 𝑞(𝑉−Φ0 )/𝑘𝑇
𝑝(𝑥 𝑛 0 )
𝑝(𝑥 𝑛 0 )
= 𝑒 𝑞𝑉/𝑘𝑇
𝑝𝑛
40 4 Diodes
Δ𝑝 𝑛 = 𝑝(𝑥 𝑛 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 𝑉𝑇 = 𝑘𝑇/𝑞
4.6 PN junctions 41
𝐼𝐷
𝑉𝐷 = 𝑉𝑇 ln
𝐼𝑆
𝑉𝐷 = 𝑉𝑇 ln 𝐼𝐷 − 𝑉𝑇 ln 𝐼𝑆
𝐷𝑛 𝐷𝑝
ln 𝐼𝑆 = 2 ln 𝑛 𝑖 + ln 𝐴𝑞 +
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
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 𝐵 𝑐 𝐵𝑣
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
‡ 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.
42 4 Diodes
Although it’s not trivial to see that the diode voltage has a negative
temperature coefficient, if you do compute it as in [Link], 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.
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 𝑁
𝑞
TN
References
∫ +𝑇/2
1
𝑥(𝑡) = lim 𝑥(𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
∫ +𝑇/2
1
𝑥 2 (𝑡) = lim 𝑥 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
2
𝜎2 = 𝑥 2 (𝑡) − 𝑥(𝑡)
For a signals with a mean of zero the variance is equal to the mean
square. The auto-correlation of x(t) is defined as
𝑅 𝑥 (𝜏) = 𝑥(𝑡)𝑥(𝑡 + 𝜏)
∫ +𝑇/2
1
= lim 𝑥(𝑡)𝑥(𝑡 + 𝜏)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
46 5 Noise
∫ +𝑇/2
1
𝑃𝑎𝑣 = lim 𝑥 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
𝑁
1 X
𝑃𝑎𝑣 = 𝑥 2 (𝑖)
𝑁 𝑖=0
Voltage Current
𝑉𝑟𝑚𝑠
2 𝐼𝑟𝑚𝑠
2
𝑉𝑛2 𝐼𝑛2
𝑣 𝑛2 𝑖 𝑛2
Voltage Current
𝑉
q𝑟𝑚𝑠 𝐼𝑟𝑚𝑠
q
𝑉2 𝐼𝑛2
q 𝑛 q
𝑣 𝑛2 𝑖 𝑛2
5.4 Noise Spectrum 47
∫ ∞
𝑆𝑥 ( 𝑓 ) = 2 𝑅 𝑥 (𝜏)𝑒 −𝑗 2𝜋 𝑓 𝜏 𝑑𝜏
−∞
This can also be written as
∫ ∞ ∫ ∞
𝑆𝑥 ( 𝑓 ) = 2 𝑅 𝑥 (𝜏) cos(𝜔𝜏)𝑑𝜏 − 𝑅 𝑥 (𝜏)𝑗 sin(𝜔𝜏)𝑑𝜏
−∞ −∞
∫ 0 ∫ ∞
= 2 𝑅 𝑥 (𝜏) cos(𝜔𝜏)𝑑𝜏 + 𝑅 𝑥 (𝜏) cos(𝜔𝜏)𝑑𝜏
−∞ 0
∫ 0 ∫ ∞
− 2𝑗 𝑅 𝑥 (𝜏) sin(𝜔𝜏)𝑑𝜏 + 𝑅 𝑥 (𝜏) sin(𝜔𝜏)𝑑𝜏
−∞ 0
∫ ∞
= 4 𝑅 𝑥 (𝜏) cos(𝜔𝜏)𝑑𝜏
0
∫ ∞ ∫ ∞
− 2𝑗 − 𝑅 𝑥 (𝜏) sin(𝜔𝜏)𝑑𝜏 + 𝑅 𝑥 (𝜏) sin(𝜔𝜏)𝑑𝜏
0 0
∫ ∞
= 4 𝑅 𝑥 (𝜏) cos(𝜔𝜏)𝑑𝜏
0
∫ ∞ ∫ ∞
1 𝑗 2𝜋 𝑓 𝜏
𝑅 𝑥 (𝜏) = 𝑆 𝑥 ( 𝑓 )𝑒 𝑑𝑓 = 𝑆 𝑥 ( 𝑓 ) cos(𝜔𝜏)𝑑 𝑓
2 −∞ 0
If we set 𝜏 = 0 we get
∫ ∞
𝑥 2 (𝑡) = 𝑆 𝑥 ( 𝑓 )𝑑 𝑓
0
which means we can easily calculate the average power if we know
the power spectral density. As we will see later it is common to
express noise sources in PSD form.
48 5 Noise
𝑆 𝑦 ( 𝑓 ) = 𝑆 𝑥 ( 𝑓 )|𝐻( 𝑓 )|2
, where 𝑆 𝑦 ( 𝑓 ) is the output power spectral density, 𝑆 𝑥 ( 𝑓 ) is the
input power spectral density and 𝐻( 𝑓 ) is the transfer function of a
time-invariant linear system.
If we insert ([eq:psd_hf]) into ([eq:ms_psd]), with 𝑆 𝑥 ( 𝑓 ) =
𝑎 𝑐𝑜𝑛𝑠𝑡 𝑎𝑛𝑡 = 𝐷𝑣 we get
∫ ∫
𝑥 2 (𝑡) = 𝑆 𝑦 ( 𝑓 )𝑑 𝑓 = 𝐷𝑣 |𝐻( 𝑓 )|2 𝑑 𝑓 = 𝐷𝑣 𝑓𝑥
𝜋 𝑓0 1
=𝑓𝑥 =
2 4𝑅𝐶
where 𝑓𝑥 is the noise bandwidth and 𝑓0 is the 3dB frequency.
We haven’t told you this yet, but thermal noise is white and white
means that the power spectral density is flat (constant over all
frequencies). If 𝑆 𝑥 ( 𝑓 ) is our thermal noise source and 𝐻( 𝑓 ) is a
standard low pass filter, then equation ([eq:psd_hf]) tells us that
the output spectral density will be shaped by 𝐻( 𝑓 ). At frequencies
above the 𝑓𝑥 in 𝐻( 𝑓 ) we expect the root power spectral density to
fall by 20dB per decade.
∫ +𝑇/2
1
𝑅 𝑥 (𝜏) = lim 𝑥(𝑡)𝑥(𝑡 − 𝜏)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
" #
∫ +𝑇/2
1
= lim 𝑥 2 (𝑡)𝑑𝑡 𝛿(𝜏)
𝑇→∞ 𝑇 −𝑇/2
= 𝑥 2 (𝑡)𝛿(𝜏)
∫ ∞
𝑆𝑥 ( 𝑓 ) = 2 𝑥 2 (𝑡)𝛿(𝜏)𝑒 −𝑗 2𝜋 𝑓 𝜏 𝑑𝜏
−∞
∫ ∞
= 2 𝑥 2 (𝑡) 𝛿(𝜏)𝑒 −𝑗 2𝜋 𝑓 𝜏 𝑑𝜏
−∞
= 2 𝑥 2 (𝑡)
, since
∫
𝛿(𝜏)𝑒 −𝑗 2𝜋 𝑓 𝜏 𝑑𝜏 = 𝑒 0 = 1
This means that the power spectral density of a white noise source
is flat, or in other words, the same for all frequencies.
𝑣 𝑡𝑜𝑡
2
(𝑡) = (𝑣 1 (𝑡) + 𝑣 2 (𝑡))2 = 𝑣 12 (𝑡) + 2𝑣 1 (𝑡)𝑣2 (𝑡) + 𝑣 22 (𝑡)
The average power is defined as
50 5 Noise
∫ +𝑇/2
1
𝑒𝑡𝑜𝑡
2
= lim 𝑣 𝑡𝑜𝑡
2
(𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
∫ +𝑇/2
1
= lim 𝑣 12 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
∫ +𝑇/2
1
+ lim 𝑣 22 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
∫ +𝑇/2
1
+ lim 2𝑣 1 (𝑡)𝑣 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
∫ +𝑇/2
1
= 𝑒12 + 𝑒22 + lim 2𝑣 1 (𝑡)𝑣 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
If 𝑒12 and 𝑒22 are uncorrelated noise sources we can skip the last
term in ([eq:noisesum]) and just write
𝑒𝑡𝑜𝑡
2
= 𝑒12 + 𝑒22
Most natural noise sources are uncorrelated.
𝑆𝑖 𝑔𝑛𝑎𝑙 𝑝𝑜𝑤𝑒𝑟
𝑆𝑁 𝑅 = 10 log
𝑁 𝑜𝑖𝑠𝑒 𝑝𝑜𝑤𝑒𝑟
© 𝑣 𝑠𝑖 𝑔 ª
2
= 10 log ®
𝑒
« 𝑛 ¬
2
© 𝑣 𝑟𝑚𝑠 ª
= 20 log q ®®
« 𝑒𝑛 ¬
2
𝑆𝑖 𝑔𝑛𝑎𝑙 𝑝𝑜𝑤𝑒𝑟
𝑆𝑁 𝑅 = 10 log
𝑁 𝑜𝑖𝑠𝑒 𝑝𝑜𝑤𝑒𝑟 − 6 𝑓 𝑖𝑟𝑠𝑡 ℎ𝑎𝑟𝑚𝑜𝑛𝑖𝑐𝑠
5.9 Noise figure and Friis formula 51
𝑆𝑖 𝑔𝑛𝑎𝑙 𝑝𝑜𝑤𝑒𝑟
𝑆𝑁 𝐷𝑅 = 10 log
𝑁 𝑜𝑖𝑠𝑒 𝑝𝑜𝑤𝑒𝑟
𝑣 2𝑜
𝐹=
𝑠𝑜𝑢𝑟𝑐𝑒 𝑐𝑜𝑛𝑡𝑟𝑖𝑏𝑢𝑡𝑖𝑜𝑛 𝑡𝑜 𝑣 2𝑜
𝑁 𝐹 = 10 log(𝐹)
The noise factor can also be defined as
𝑆𝑁 𝑅 𝑖𝑛𝑝𝑢𝑡
𝐹=
𝑆𝑁 𝑅 𝑜𝑢𝑡𝑝𝑢𝑡
𝐹2 − 1 𝐹3 − 1
𝐹 = 1 + 𝐹1 − 1 + + + ....
𝐺1 𝐺1 𝐺2
Here 𝐹𝑖 is the noise figures of the individual stages and 𝐺 𝑖 is the
available gain of each stage. This can be rewritten as
𝑁
X 𝐹𝑖+1 − 1
𝐹 = 𝐹1 + Q𝑖−1
𝑖=1 𝑘=1
𝐺𝑖
Friiss formula tells us that it is the noise in the first stage that is the
most important if 𝐺1 is large. We could say that in a system it is
important to amplify the noise as early as possible!
∫ ∞
𝑆𝑥1 ( 𝑓 ) = 𝑅 𝑥 1 (𝜏)𝑒 −𝑗𝜔𝜏 𝑑𝜏
−∞
And the one often used in books about noise, like 2, is
∫ ∞
𝑆𝑥2 ( 𝑓 ) = 2 𝑅 𝑥 2 (𝜏)𝑒 −𝑗𝜔𝜏 𝑑𝜏
−∞
In both cases 𝑅 𝑥𝑖 (𝜏) is the auto-correlation function defined as
𝑅 𝑥𝑖 (𝜏) = 𝑥 𝑖 (𝑡)𝑥 𝑖 (𝑡 + 𝜏)
As we can plainly see
𝑆𝑥1 ( 𝑓 ) ≠ 𝑆𝑥2 ( 𝑓 )
, there is no way these two can be made equal if
𝑅 𝑥 1 (𝜏) = 𝑅 𝑥 2 (𝜏)
This is ok, there is no problem having two different definitions for
two different functions. In reality 𝑆 𝑥 1 ( 𝑓 ) and 𝑆 𝑥 2 ( 𝑓 ) are different
functions of frequency, and we could say that
𝑆 𝑥 2 ( 𝑓 ) = 2𝑆 𝑥 1 ( 𝑓 )
if ([eq:rxequal]) is true.
∫ ∞ ∫ ∞
1
𝑅 𝑥 1 (𝜏) = 𝑆 𝑥 1 ( 𝑓 )𝑒 𝑗𝜔𝜏 𝑑𝑤 = 𝑆 𝑥 1 ( 𝑓 )𝑒 𝑗𝜔𝜏 𝑑 𝑓
2𝜋 −∞ −∞
,since 𝑑𝑤 = 𝑑 𝑓 𝑑𝑤/𝑑 𝑓 = 2𝜋𝑑 𝑓 . And for ([eq:psd2])
∫ ∞
1
𝑅 𝑥 2 (𝜏) = 𝑆 𝑥 2 ( 𝑓 )𝑒 𝑗𝑤𝜏 𝑑 𝑓
2 −∞
∫ ∞
𝑆𝑥1 ( 𝑓 ) = 𝑅 𝑥 1 (𝜏)[cos(𝜔𝜏) + 𝑗 sin(𝜔𝜏)]𝑑𝜏
−∞
and it turns out that since 𝑅 𝑥 1 (𝜏) is an even function we can drop
the 𝑗 sin 𝜔𝜏 term. 𝑆 𝑥 1 ( 𝑓 ) is also an even function since the Fourier
Transform of an even function is even.
∫ ∞
𝑆𝑥1 ( 𝑓 ) = 𝑅 𝑥 1 (𝜏) cos(𝜔𝜏)𝑑𝜏
∫−∞∞
𝑅 𝑥 1 (𝜏) = 𝑆 𝑥 1 ( 𝑓 ) cos(𝜔𝜏)𝑑 𝑓
−∞
and
∫ ∞
𝑆𝑥2 ( 𝑓 ) = 2 𝑅 𝑥 2 (𝜏) cos(𝜔𝜏)𝑑𝜏
∫−∞∞
1
𝑅 𝑥 2 (𝜏) = 𝑆 𝑥 2 ( 𝑓 ) cos(𝜔𝜏)𝑑 𝑓
2 −∞
∫ ∞
𝑅 𝑥 2 (𝜏) = 𝑥 2 (𝑡)𝑥 2 (𝑡 + 𝜏) = 𝑆 𝑥 2 ( 𝑓 ) cos(𝜔𝜏)𝑑 𝑓
0
and if 𝜏 = 0
∫ ∞
𝑥 22 (𝑡) = 𝑆 𝑥 2 ( 𝑓 )𝑑 𝑓
0
So using spectral density definition ([eq:psd2]) we see that average
power (mean square value of 𝑥 2 (𝑡)) is equal to the integral from
0 to infinity of the spectral density. If we use ([eq:psd1]) average
power would be
54 5 Noise
∫ ∞
𝑥 12 (𝑡) =2 𝑆 𝑥 1 ( 𝑓 )𝑑 𝑓
0
𝑆𝑡 ℎ ( 𝑓 ) = 4 𝑘𝑇𝑅
where k is Boltzmann’s constant, T the temperature in Kelvin and
R the resistance. But ([eq:othermal]) is the spectral density when it
is defined as in ([eq:psd2]). If we were to use ([eq:psd1]) then the
spectral density of thermal noise would be
𝑆𝑡 ℎ ( 𝑓 ) = 2 𝑘𝑇𝑅
Both these spectral densities would give the same average power
value if we use the inverse Fourier Transform of ([eq:psd1]) and
([eq:psd2]).†
𝔐(Δ) = 𝐹(𝑡)𝐹(𝑡 + Δ)
and the intensity (spectral density) as
∫ 𝑇
Δ
𝐼(𝜃) = 𝔐(Δ) cos(𝜋 )𝑑Δ
0 𝜃
† Notethat if you calculate the average power of 𝑆𝑡 ℎ ( 𝑓 ) you’ll get infinity. You
have to include the bandwidth of the circuit you are considering for average
power to have a finite value.
5.10 Spectral Density 55
,where the period 𝜃 = 𝑇/𝑛 and 𝑇 is a very large value. The paper is
very short, only 1 page, but it is worth reading. Note that ([eq:psd1])
is often referred to as the Wiener-Khintchine theorem.
Sky130nm tutorial 6
6.1 Tools . . . . . . . . . . 57
6.1 Tools 6.1.1 Setup WSL (Appli-
cable for Windows
I would strongly recommend that you install all tools locally on users) . . . . . . . . . . 57
your system. 6.1.2 Setup public key
towards github . . . . 57
For the analog toolchain we need some tools, and a process design 6.1.3 Provide git with
kit (PDK). author identity . . . . 58
6.1.4 Get AICEX and setup
your shell . . . . . . . 58
▶ Skywater 130nm PDK. I use open_pdks to install the PDK
6.1.5 On systems with
▶ Magic VLSI for layout python3 > 3.12 . . . . 58
▶ ngspice for simulation 6.1.6 Install Tools . . . . . . 59
▶ netgen for LVS 6.1.7 Install cicconf . . . . . 59
▶ xschem 6.1.8 Install cicsim . . . . . 60
▶ python > 3.10 6.1.9 Setup your ngspice
settings . . . . . . . . . 60
The tools are not that big, but the PDK is huge, so you need to have 6.2 Check that magic and
about 50 GB disk space available. xschem works . . . . . 60
6.3 Design tutorial . . . . 60
6.3.1 Create the IP . . . . . . 60
6.1.1 Setup WSL (Applicable for Windows users) 6.3.2 The file structure . . . 60
6.3.3 Github setup . . . . . 62
6.3.4 Start working . . . . . 63
Install a Linux distribution such as Ubuntu 24.04 LTS by running 6.3.5 Draw Schematic . . . 63
the following command in PowerShell on Windows and follow the 6.3.6 Typical corner SPICE
instructions. simulation . . . . . . . 64
6.3.7 All corners SPICE
wsl --install -d Ubuntu-24.04
simulations . . . . . . 67
6.3.8 Draw Layout . . . . . 69
When you have installed the Linux distribution and signed into it, 6.3.9 Layout verification . 74
install make 6.3.10 Extract layout para-
sitics . . . . . . . . . . 74
sudo apt install make
6.3.11 Simulate with layout
parasitics . . . . . . . 75
6.3.12 Make documentation 75
6.1.2 Setup public key towards github 6.3.13 Edit [Link] . . . . . 76
6.3.14 Setup github pages . . 76
Do 6.3.15 Frequency asked
questions . . . . . . . . 76
ssh-keygen -t rsa
Then
cat ~/.ssh/id_rsa.pub
And add the public key to your github account. Settings - SSH and
GPG keys
58 6 Sky130nm tutorial
There are interactions with git that require an author identity. You
are supposed to use one of these interactions a lot during the
project, namely, git commit. What you need to provide is an email
address and a name. If you would like to keep your real email
address private/secret, read what it says on GitHub at your user
settings page under emails. Use the below commands to provide
the author identity information to git.
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 [Link]
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:$PATH
6.1 Tools 59
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.
cd aicex/tests/
make requirements
make tt
I’ve split the install of each of the tools. It’s possible to run the
commented out lines instead, but they often fail
#make eda_compile
#sudo make eda_install
make magic_compile magic_install
make netgen_compile netgen_install
make xschem_compile xschem_install
make iverilog_compile iverilog_install
make ngspice_compile # Sometimes fails
make ngspice_compile ngspice_install
On Mac, do
brew install yosys verilator
On Linux, do
make yosys_compile yosys_install
On all, do
python3 -m ensurepip --default-pip
cIcConf is used for configuration. How the IPs are connected, and
what version of IPs to get.
cd
cd pro/aicex/ip/cicconf
git checkout main
git pull
python3 -m pip install -e .
cd ../
Update IPs
cicconf clone --https
cd ../..
60 6 Sky130nm tutorial
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.
6.3 Design tutorial 61
Each IP has a few files that define the setup, you’ll need to modify
at least the [Link] and the [Link].
.gitignore # files that are ignored by git
[Link] # Frontpage documentation
[Link] # What libraries are used. Used by cicconf
[Link] # Setup names, authors etc
media # Where you should store images for documentation
tech -> ../tech_sky130A # The technology library
▶ 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
62 6 Sky130nm tutorial
All these files are text files, so you can edit them in a text editor,
but mostly you shouldn’t (except for the Markdown)
[Link] Simulations
cd sim
make cell CELL=JNW_EX
This will make a simulation folder for you. Repeat for all your
cells.
sim
Makefile
[Link] -> ../tech/cicsim/[Link]
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
[Link] -> ../tech/magic/[Link]
[Link] -> ../tech/magic/[Link]
xschemrc
cd jnw_ex_sky130a
git remote add origin \
git@[Link]:<your username>/jnw_ex_sky130a.git
6.3 Design tutorial 63
Use ‘I’ or ‘Shift+i’ (note the letter case) to open the library manager.
Click the jnw_ex_sky130A/design path, then JNW_ATR_SKY130A
and select JNWATR_NCH_4C5F0.sym
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
6.3 Design tutorial 65
File Description
Makefile Simulation commands
[Link] Setup for cicsim
[Link] Generate a README with simulation results
[Link] Measurement to be done after simulation
[Link] Optional python script to run for each simulation
[Link] Transient testbench
[Link] What measurements to summarize
cd JNW_EX
make typical
IBP 0 IBPS_5U dc 5u
V0 IBNS_20U 0 dc 1
Run simulation
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.
vgs:
src:
- vgs_m1
name: Gate-Source voltage
typ: 0.6
6.3 Design tutorial 67
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
Add the following lines (they automatically plot the current and
gate voltage)
import cicsim as cs
fname = name +".png"
print(f"Saving {fname}")
[Link](name + ".raw","time","v(ibps_5u),i(v0)" \
,ptype="",fname=fname)
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 [Link]
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.
70 6 Sky130nm tutorial
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 Move 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 to connect all of the transistors’ source
terminals.
Select a 0.5 um box below the transistors and paint the rectangle
with locali (middle click on locali)
Connect the sources to ground. Use the ‘wire tool’. Use ‘shift-right
click’ to change layer down
72 6 Sky130nm tutorial
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.
6.3 Design tutorial 73
[Link] 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
6.3 Design tutorial 75
VIEW=Sch
to
VIEW=Lay
Run
make typical
[Link] Corners
make all
- 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 [Link] -o [Link]
Open the [Link] and have a look a the results. The layout
should be close to the schematic simulation.
Finally, let’s setup the [Link] so that all the github workflows
run correctly.
Mine will look like this.
You need to setup the url (probably something like <your
username>.[Link]) to what is correct for you.
I’ve added the doc section such that the workflows will generate
the docs.
The sim is to run a typical simulation.
library: JNW_EX_SKY130A
cell: JNW_EX
author: Carsten Wulff
github: wulffern
tagline: The answer is 42
email: carsten@[Link]
url: [Link]
doc:
libraries:
JNW_EX_SKY130A:
- JNW_EX
sim:
JNW_EX: make typical
7.1.1 Specification
7.1.2 Design
7.1.3 Tapeout
Rules are nice. They reduce the cognitive load since a decision
already has been made. You may disagree with the rule, but
in analog design it’s not that important what the “rule” is, but
sometimes more important that the rule is followed.
Below are the rules I like. You may disagree, but if you’re my
student, then you don’t have a choice. Follow them, or the grade
may suffer.
7.2 Schematic rules 79
Although editors can handle mix of upper case and lower case,
SPICE, cannot. SPICE is case insensitive. That means AVDD ==
aVdd in SPICE, but AVDD != aVdd in editors. A such mixing case
is a bad idea, so one must be picked, and uppercase the chosen
one. Why? Why not?
Do: VDD -> VDD -> VDD, Don’t: VDD -> LOCALVDD -> CEL-
LVDD
| (sub block) |
| |
VDD -|-LVDD---/ ---- VDD |
| |
Here the net name VDD is used on the top level, while LVDD is
used in the sub-block. In the sub-block there is a power switch
between LVDD and VDD. In this case VDD != VDD on top level,
which can lead to long debugging times. There are, however, a few
exceptions. For example, using VDD on standard cells (inverters,
ANDs etc) is ok, even though the power supply is not called VDD
Do: W = 1.0 um, L = 180 nm, Use multiplier for other sizes
That way, you don’t have to worry about current direction in the
layout.
I’ve seen ICs have to be taped out again due to rotated transistors.
7.3 Layout rules 81
For large lengths (> 500 nm) the lithography effects are not that
severe, but the etching of the gate material will be asymmetric if
there are no poly dummies. Make sure the poly dummy is exactly
the same spacing on both sides.
For small lengths (< 200 nm) the lithography effects start to matter.
The light used in most litho is 193 nm. 193 nm is used all the way
down to about 7 nm.
Due to diffraction effects, it’s common to have extremely regular
poly spacing, an exact distance such that the interference from
neighboring poly’s align perfectly to the next poly.
[Link] Supply
The temperature sensor has two supplies, one analog (3.3 V) and
one digital (1.2 V), which must come from somewhere.
That has ability for both 3.3 V and 1.8 V I believe. An external low
dropout regulator (LDO) provide the digital supply (1.8 V).
[Link] Ground
[Link] Clocks
[Link] Digital
We need to read the digital outputs. We could either feed those off
chip, or use a on chip micro-controller. The TinyTapeout includes
options to do both. We could connect digital outputs to the logic
analyzer, and program the MCU to store the readings. Or we could
connect the digital output to the I/O and use an instrument in the
lab.
[Link] Bias
[Link] 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
Standards for testing at JEDEC
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
100 k
1.5 k
8.2 Electrostatic Discharge 89
∮ ∭
1
E · 𝑑S = 𝜌 · 𝑑𝑉
𝜕Ω 𝜖0 𝑉
E 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.
Our job, as electronics engineers, is to ensure we put in additional
I
circuits to prevent the fields during a CDM event from causing
damage.
For example, let’s say I have two inverters powered by different
supply, VDD1 and VDD2. If I in my ESD test ground VDD1, and
not VDD2, I will quickly bring VDD1 to zero, while VDD2 might
react slower, and stay closer to 1 kV. The gate source of the PMOS
in the second inverter will see approximately 1 kV across the oxide,
and will break. How could I prevent that?
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.
Now imagine an IC will hundreds of supplies, and billions of
inverters. How can I make sure that everything is OK?
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
8.4 Permutations 91
100 k
1.5 k
100 pF
8.4 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
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
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.
94 8 IC and ESD
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.
I
ht 30
r
ht
Pto
P
8.4 Permutations 95
[Link] 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.
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.
Even if it’s only a digital input, you still need to consider ESD
events.
Right after the die pad, sometimes under, there will be a primary
ESD protection that can conduct, in all directions, between input,
supply and ground.
XA3 .ENDS
(b)
{ "name" : "DI_1V8_ST28N",
XC1 "boundaryIgnoreRouting" : 0,
"composite" : 1, "noPowerRoute" : 1,
"schematic" : 0,
"class" : "Layout::LayoutDigitalCell",
XA2 "afterPlace" :{
"addPowerRings" :[
["M1","AVDD_1V0","t"],
["M1","AVSS","btrl"]
]
},
"beforeRoute" : {
"addPowerConnections" : [
["AVDD_1V0","XA","top"],
["AVSS","XC","left"],
["AVSS","XA4|XA2","bottom"]
],
"addConnectivityRoutes" : [
["M3","FILT_O","--|-","onTopR"],
["M2","SCHMITT_O","-|--"],
["M1","INV_O","-|--"]
]
}
}
OD CO PO M1 M2 M3 M4
(c) (d)
98 8 IC and ESD
8.6 Latch-up
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.
[Link] 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 [Link]
9.1 Routing
I know we say that, but it’s not right. What we forget is that by
voltage in a node we always, always mean voltage in a node referred to
ground.
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.
9.1 Routing 103
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.
104 9 References and bias
𝑉𝐵𝐸
𝑉𝐵𝐸
𝐼 𝐷 = 𝐼𝑆 𝑒 𝑉𝑇
− 1 + 𝐼 𝐵 ≈ 𝐼𝑆 𝑒 𝑉𝑇
𝑘𝑇
𝑉𝑇 =
𝑞
𝑘𝑇 𝐼𝐶
𝑉𝐵𝐸 = ln
𝑞 𝐼𝑆
𝐷𝑛 𝐷𝑝
𝐼𝑆 = 𝑞𝐴𝑛 𝑖2 +
𝐿 𝑛 𝑁𝐴 𝐿 𝑝 𝑁𝐷
However, it turns out that the 𝑉𝐵𝐸 decreases with temperature due
to the temperature dependence of 𝐼𝑆 .
The 𝑉𝐵𝐸 is linear with temperature with a property that if you
extrapolate the 𝑉𝐵𝐸 line to zero Kelvin, then all diode voltages
seem to meet at the bandgap voltage of silicon (approx 1.12 eV).
To see the temperature coefficient, I find it easier to re-arrange the
equation above.
Some algebra (see Diodes)
𝑘𝑇
𝑉𝐵𝐸 = (ℓ − 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.
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
106 9 References and bias
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.
ID
a verb in
R1 R
V02 V02
I N 1 N
D1 D2 D Dz
R2 R2
9.2 Bandgap voltage reference 107
ID VREE
b in
R RL VREE
a verb in
V02 V02
R1 R RL
1 N
D V02
Dz 03 V02 V02
I N 1 N
D1 D2 D Dz 03
Another method would be to stack the 𝑅 2 on top of 𝑅 1 as shown
below.
REE
VREE
R2 R2
Vn
R1
V02
I N
D1 D2
I 1 DUBE V
Rz Ry
I Ia Va IRz
Q Q2 Ir
In
8
use
Ere
2
É V21 VBG VRtVBE
Ny 2
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𝐼 .
pr
The voltage at the output will then be.
𝑘𝑇 𝑇0 𝑘 𝐽2 2𝑅 2 𝑉𝐺0 − 𝑉𝑏𝑒 0
to do I
𝑉𝐵𝐺 = 𝑉𝐺0 + (𝑚 − 1) ln +𝑇 ln −
𝑞 𝑇 𝑞 𝐽1 𝑅 1 𝑇0
𝑅2 𝑉𝐺0 − 𝑉𝑏𝑒 0
=
𝑅1 2𝑇0 𝑘 ln( 𝐽2 )
𝑞 𝐽1
𝑘𝑇 𝑇0 𝑘 𝐽2 2𝑅 2 𝑉𝐺0 − 𝑉𝑏𝑒 0
𝑉𝐵𝐺 = 𝑉𝐺0 + (𝑚 − 1) ln +𝑇 ln −
𝑞 𝑇 𝑞 𝐽1 𝑅 1 𝑇0
9.2 Bandgap voltage reference 109
𝑘𝑇 𝑇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
112 9 References and bias
𝑉𝐷 Δ𝑉𝐷
𝑉𝑂𝑈𝑇 = 𝑅 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
9.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
9.3.2 GM Cell
Ib ImmbxEMVett
lil Vetti tremlett
ITEM
j vett Mf Velte
6Me Y
T
1 1
Velt 2 Veltz
Vo Veltz
KI gu If
F Vo ZI
Vet If
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
Vo
which case Vo
Z gu ta
𝑉𝑜 = 𝑉𝐺𝑆1 − 𝑉𝐺𝑆2 = 𝑉𝑒 𝑓 𝑓 1 + 𝑉𝑡𝑛 − 𝑉𝑒 𝑓 𝑓 2 − 𝑉𝑡𝑛 = 𝑉𝑒 𝑓 𝑓 1 − 𝑉𝑒 𝑓 𝑓 2
1 𝑊1 2
𝐼𝐷 1 = 𝜇𝑛 𝐶 𝑜𝑥 𝑉
2 𝐿1 𝑒 𝑓 𝑓 1
114 9 References and bias
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
I Qf
E
9.4 Want to learn more? 115
An ADC will have a sample rate, and will alias (or fold) any signal
above half the sample rate, as such, we also must include a anti-
Why
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
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
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.
10.2 Filters 119
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.
10.2 Filters
combination of 1’st and 2’nd order stages can synthesize any order
filter.
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
Second order
Signal flow graphs are useful when dealing with linear systems.
𝑉𝑜 (𝑠) 𝑘 1 𝑠 + 𝑘 0
𝐻(𝑠) = =
𝑉𝑖 (𝑠) 𝑠 + 𝑤𝑜
K2 S
10.2 Filters 121
𝑢 = (𝑘 0 + 𝑘 1 𝑠)𝑉𝑖 − 𝜔0𝑉𝑜
𝑉𝑜 = 𝑢/𝑠
Wo
Vi ko V0
𝑢 = 𝑉𝑜 𝑠 = (𝑘 0 + 𝑘1 𝑠)𝑉𝑖 − 𝜔0𝑉𝑜
Ks
(𝑠 + 𝜔0 )𝑉𝑜 = (𝑘 0 + 𝑘 1 𝑠)𝑉𝑖
Second order
𝑉𝑜 𝑘1 𝑠 + 𝑘0
=
𝑉𝑖 𝑠 + 𝜔0
V25
Bi-quadratic just means “there are two quadratic equations”. Once
we match the 𝑘 ’s 𝜔0 and 𝑄 to our wanted 𝐻(𝑠) we can proceed
with the circuit implementation.
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.
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.
10.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
Gnc
is that this is Gm with capital G, not the 𝑔𝑚 that we use for small
signal analysis.
In a Gm-C filter the input and output nodes can have significant
swing, and thus cannot always be considered small signal.
Io
Vi Gm Vo V
c
𝐼𝑜 𝜔𝑡𝑖
𝑉𝑜 = = 𝑉𝑖
𝑠𝐶 𝑠
𝐺𝑚
𝜔𝑡𝑖 =
𝐶
Io
10.3.1 Differential Gm-C
wei
10.3 Gm-C
of
123
gmVi
V
Vit Gm ut am
to Gulf I
grivi guv
Vo
IE 𝑠𝐶𝑉𝑜 = 𝐺 𝑚 𝑉 𝑖
WEVi
wei e
of
𝑉𝑜 𝐺𝑚
𝐻(𝑠) = =
I 𝑉𝑖 𝑠𝐶
2
Differential circuits are fantastic for multiple reasons, power supply
Use 3D
rejection ratio, noise immunity, symmetric non-linearity, but the
Crease
qualities I like the most is that the outputs can be flipped to
implement negative, or positive gain.
figure
ut am
I c
guv
𝑉𝑜 𝐺𝑚
𝐻(𝑠) = =−
𝑉𝑖 𝑠𝐶
124 10 Analog frontend and filters
ex
Ganz
is
Vi s iz
Gm
i t Vols
do
do
i
is
iz
Given the transfer function from the signal flow graph, we see that
we can select 𝐶 𝑥 , 𝐶 𝑎 and 𝐺 𝑚 to get the desired 𝑘 ’s and 𝜔0
Gy
G Gs
𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
Ca
or
𝑠 + 𝑤𝑜 CB
GL
Vi G
63
𝑠 𝐶 𝑎𝐶+𝐶
𝑥
𝑥
+ 𝐺𝑚1
𝐶 𝑎 +𝐶 𝑥
Vo
𝐻(𝑠) = 𝐺𝑚2
𝑠+ 𝐶 𝑎 +𝐶 𝑥
20
Guy Gms
Vin
20
𝑘2 𝑠 2 + 𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 2 + 𝜔𝑄0 𝑠 + 𝜔2𝑜
10.3 Gm-C 125
𝑠 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
10.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.
10.4 Active-RC 127
Ga
Ven Ci Cr
Vout
G
𝑘1 𝑠 + 𝑘0
𝐻(𝑠) =
𝑠 + 𝑤𝑜
− 𝐶𝐶12 𝑠 − 𝐺1
𝐶2
𝐻(𝑠) = 𝐺2
𝑠+ 𝐶2
VI
Let’s work through the calculation.
Vo
[Link] Step 1: Simplify
An ideal OTA will force its inputs to be the same. As a result, the
potential at OTA− input must be 0.
The input current must then be
𝐼 𝑖𝑛 = 𝐺 𝑖𝑛 𝑉𝑖𝑛
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 𝐼 𝑖𝑛 .
That’s the only way to maintain the virtual ground at 0 V. If
the currents do not match, the voltage at virtual ground cannot
continue to be 0 V, the voltage must change.
128 10 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
𝑉𝑜𝑢𝑡 𝐺 𝑖𝑛
=−
𝑉𝑖𝑛 𝐺 𝑜𝑢𝑡
𝐺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 + 𝐶𝐵 𝑠 + 𝐶𝐴 𝐶𝐵
130 10 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.
1 1
1 1
Von Vop
1
Vin Vip
Von Vop
Vin Vip
VCREF
Von Vop
VCOUT
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.
10.8 Want to learn more? 133
Von Vop
VCOUT VCREF
BIAS x16[1:0]
VBP1
x18 x20 x11 x7
VBP2
x5[1:0]
VCONP VCOPP
VDD_1V8
x26 x28[3:0]
x17[1:0] x19 x21 x12 x8 x6[1:0]
CNRATR_PCH_8C4F0
CNRATR_NCH_8C1F2 CNRATR_NCH_8C1F2
VCP VON VSS VOP
VIN VIP
x22 VS x2
x24 x25 VSS x29[3:0] x30 x13[1:0] x10 VSS x23[3:0] x1 x2[1:0]
C=5.38e-14
SUNTR_RPPO16
VCBP
MF=1 c1
C1 c0
MF=1 c1
C2 c0
5/5
cap_mim_m3_1
VSC
x42 x43
SUNTR_RPPO16
x37 x38
VCONN VCOPN
VCBN1 VCBN2
Designer
Updated
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
𝜔 𝑝|𝑧 ∝ =
𝐶 𝑅𝐶
q √
𝜎𝑅𝐶 = 𝜎𝑅2 + 𝜎𝐶2 = 0.022 + 0.022 = 0.028 = 28 %
11.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).
138 11 Switched-Capacitor Circuits
Vi
zi 0
C
Q
Vgud
𝑄 𝜙2$ = 𝐶1𝑉𝐺𝑁 𝐷 = 0
𝑄
𝐼𝐼 = = 𝑄 𝑓𝜙
9 a 𝑑𝑡
‗I
C
use the $ to mark the end of the period. It comes from Regular Expressions.
11.3 Switched capacitor 139
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
𝑍 = 1/ 𝑓 𝐶 . The impedance of a capacitor isQ
complex (varies with
Vgudwhile the SC circuit impedance is real (a
frequency and time),
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.
142 11 Switched-Capacitor Circuits
𝑄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
𝑋𝑠 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝜏 𝑠 𝑛=−∞
Thus
∞
X
lim → 𝑋𝑠 (𝑠) = 𝑥 𝑐 (𝑛𝑇)𝑒 −𝑠𝑛𝑇
𝜏→0 𝑛=−∞
Or
∞
𝑗 𝑘 2𝜋
1 X
𝑋𝑠 (𝑗𝜔) = 𝑋𝑐 𝑗𝜔 −
𝑇 𝑘=−∞ 𝑇
144 11 Switched-Capacitor Circuits
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?
In python we can create a demo and see what happens when
we “sample” an “continuous time” signal. Hopefully it’s obvious
that it’s impossible to emulate a “continuous time” signal on a
digital computer. After all, it’s digital (ones and zeros), and it has
a clock!
We can, however, emulate to any precision we want.
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.
Secondly, I create continuous time signal. The time vector can
be used in numpy functions, like [Link](), and I combine three
sinusoid plus some noise. The sampling vector is a repeating
pattern of 11001100, so our sample rate should be 1/2’th of the input
sample rate. FFT’s can be unwieldy beasts. I like to use coherent
sampling, however, with multiple signals and samplerates I did
not bother to figure out whether it was possible.
The alternative to coherent sampling is to apply a window function
before the FFT, that’s the reason for the Hanning window below.
[Link]
#- Create a time vector
N = 2**13
t = [Link](0,N,N)
fd = 1/N*119
x_s = [Link](2*[Link]*f1*t) + 1/1024*[Link](N) + \
0.5*[Link](2*[Link]*(f1-fd)*t) + 0.5*[Link](2*[Link]*(f1+fd)*t)
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.
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
146 11 Switched-Capacitor Circuits
with.
As such x t should
limited before
be bandBefore Saulius
N
sampling
P T it it
Es th thBefore
f
Saulius
ask o
8
P T
Es thi
NIii it it
th
After sampling
f ask o
I f
Es th th Issampling
After
8 I
components
Es
are
wanted signalth
Iii
With an anti-alias filter (yellow) we ensure that the unwanted
i low enough before
th Is
(green) is undisturbed.
Sampling
Beforesampling.
f As a result, our
Anti Alias
ot I Before Sampling
o LP o SH o
Es th it th f Anti Alias
After sampling
ot I o LP o SH o
Es th it th f
8 1 I f
Es th thAfterf 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
11.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
11.4.6 Z-domain
440
O
0 Leros
Spectra repeat every ifs
2𝜋
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
bounds, or in other words, be unstable.
poles 440
We can translate between Laplace-domain and Z-domain with the
Bi-linear transform
O
0 Leros ifs
𝑠=
𝑧−1
𝑧+1
Discrete time
Warning: First-order approximation [Link]
iki/Bilinear_transform
spectra
Z plane at
b every
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
150 11 Switched-Capacitor Circuits
(
𝑘 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.
Firs
Hz
stable
unstable
ak
66 ha
It t a
xD
gy
Aza y
FIR
The first order filter can be implemented in python, and it’s really
not hard. See below. The 𝑥 𝑠 𝑛 vector is from the previous python
112
example.
H t Ea
E
we can see the sampled time domain and Hee
z
From the plot below
spectra on the left, and the filtered time domain and spectra on the
right.
[Link]
hlultakes
XE
4 Iya
11.4 Discrete-Time Signals 151
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 = [Link](z)
print("|z| = " + str(z_abs))
y = [Link](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
the art. Our abilities to use computers for design has improved a
bit the last three decades.
2
1X
𝐻(𝑧) = 𝑧 −1
3 𝑖=0
E
152 11 Switched-Capacitor Circuits
hl
XE
4
43
Iya
11.5 Switched-Capacitor
Cz
t
it q Ve
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
Qz
on 𝐶1 is
Qz
𝑄 1𝜙1 $ = 𝐶1𝑉1
𝑄 2 𝜙1 $ = 0
C E
11.5 Switched-Capacitor 153
Cz
t t
Ve un
Q
It’s the OTA that ensures that the negative input is the same as the
positive input, but the OTA cannot be infinitely fast. At the same
time, the voltage across 𝐶1 cannot change instantaneously. Neither
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
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
A
𝑉2 𝐶1
B
=
C
𝑉1 𝐶2
a
if
a
ur
11.5.1 Switched capacitor gain circuit
Vocutis Vi n
Cg
Redrawing the previous circuit, and adding a few more switches
we can create aHswitched capacitor gain circuit.
VoZa switch to sampleHE
There is now
Evi g a across 𝐶1 during
the input voltage
phase 1 and reset 𝐶2 . During phase 2 we configure the circuit to
leverage the OTA to do the charge transfer from 𝐶1 to 𝐶2 .
a
Cz
Vien
VoEu
i n
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 err
i HE
ga 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.
Cz
viii
VoEu
error
11.5 Switched-Capacitor 155
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
arrow
The output now will grow without bounds, so integrators are most
often used in filter circuits, or sigma-delta ADCs where there is
feedback to control the voltage swing at the output of the OTA.
Vos
C Cz
Cz
Nt
a
VoEu
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.
𝐶1
𝑉𝑜 [𝑛] = 𝑉𝑜 [𝑛 − 1] + 𝑉𝑖 [𝑛 − 1]
𝐶2
En I Vicu r
Et 𝑉𝑜 − 𝑧 −1𝑉𝑜 =
𝐶 1 −1
𝐶2
𝑧 𝑉𝑖
zaVi
É Maybe one confusing thing is that multiple transfer functions can
mean the same thing, as below.
EEE E 𝐻(𝑧) =
𝐶 1 𝑧 −1
𝐶2 1 − 𝑧 − 1
=
𝐶1 1
𝐶2 𝑧 − 1
11.5.3 Noise
2 𝑘𝑇
𝑉𝑛2 >
𝐶
11.5 Switched-Capacitor 157
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 (𝑡)
with mean of zero (or removed).
𝑥 𝑡𝑜𝑡
2
(𝑡) = 𝑥 12 (𝑡) + 𝑥 22 (𝑡) + 2𝑥 1 (𝑡)𝑥 2 (𝑡)
∫ +𝑇/2
1
𝜎𝑡𝑜𝑡
2
= 𝜎12 + 𝜎22 + lim 2 𝑥 1 (𝑡)𝑥 2 (𝑡)𝑑𝑡
𝑇→∞ 𝑇 −𝑇/2
𝜎𝑡𝑜𝑡
2
= 𝜎12 + 𝜎22
158 11 Switched-Capacitor Circuits
[Link] OTA
Not all SC circuits use OTAs, there are also comparator based SC
circuits.
Cz Cz
t t
it q Ve un
t c G
Q Q
[Link] Switches
Qz Qz
If your gut reaction is “switches, that’s easy”, then you’re very
wrong. Switches can be incredibly complicated. All switches will be
made of transistors, but usually we don’t have enough headroom
to use a single NMOS or PMOS. We may need a transmission
gate
C E E
A B A B A B
c
c
A B
C
𝑡 > − log(error)𝜏
c e
c e
A c e B c
A B
E e
C E
g
An Bu
i
i
Be
Ap
E e
C E
g
An Bu
on
if
a
ur
cutis
Vo Vi n
Cg
11.5.5 Example
H
VoZ
Evi HE
ga
In the circuit below there is an example of a switched capacitor cir-
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
Vo𝑘𝑇
Eu
𝑉𝑂 (𝑧) = 10 ln(𝑁)𝑧 −1
𝑞
error
162 11 Switched-Capacitor Circuits
n
I 2
TCalooff
ℏ
𝜎𝑥 𝜎𝑝 ≥
2
. There is a similar relation of energy and time, given by
ℎ
Δ𝐸Δ𝑡 >
2𝜋
where Δ𝐸 is the difference in energy, and Δ𝑡 is the difference in
time.
164 12 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.
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.
166 12 Oversampling and Sigma-Delta ADCs
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.
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.
12.1 ADC state-of-the-art 167
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.
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/[Link] FoM = 2.73 fJ/[Link]
−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/[Link]) 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).
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
nm and 130nm). In the summer of 2022 I made an open source
port to skywater 130nm.
SUN_SAR9B_SKY130NM
|NTF|0→BW -27.8 dB
Fig. 3. Die photo and ADC layout.
+ (g − 2)z −1 + z −2
a1 − 2) + (a2 − a1 + 1)z −2 12.1.2 High resolution FOM
Corrected on-chip: Corrected offline:
M SNDR 68.2 dB Uncal. Cal.
SNR 68.3 dB SNDR 64.3 dB 67.7
For high-resolution ADCs, it’s more common to use the Schreier dB
SFDR 84.6 dB SFDR
figure of merit, which can also be found in 69.6 dB 83.9 dB
0 0
and noise SNDR
transfer
68.2function.
dB
Cal. Uncal.
Power [dBFS]
Power [dBFS]
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]
12.2 Quantization
D
X
noise” 𝑒[𝑛], where 𝑥[𝑛] = 𝑦[𝑛] − 𝑒[𝑛].
een
XED o En
g
Maybe you’ve even heard the phrase “Quantization noise is white”
or “Quantization noise is a random Gaussian process”?
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
een
gEn
XED o
It
É
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 a
y
x
The quantization noise is contained between + 12 Least Significant
Bit (LSB) and − 12 LSB.
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.
I 1 i t t t t t t t
É
12.2 Quantization 173
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
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
12.2 Quantization 175
𝐴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.
176 12 Oversampling and Sigma-Delta ADCs
def adc(x,bits):
levels = 2**bits
y = [Link](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.
12.2 Quantization 177
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.
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.
ADCs. That’s why you should care about the details around
quantization noise.
12.3 Oversampling
𝑦 = 𝑥[𝑛] + 𝑥[𝑛 + 1]
𝑏 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
12.3 Oversampling 179
(𝑏 1 + 𝑏2 )2 = 2𝑏 2
(𝑂𝑆𝑅 × 𝐴)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 𝑑𝐵
180 12 Oversampling and Sigma-Delta ADCs
10 log(4) ≈ 6 𝑑𝐵
def oversample(x,OSR):
N = len(x)
y = [Link](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.
12.4 Noise Shaping 181
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 [Link]. 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
12.4.2 Sigma-delta principle
VI V
Let’s modify the feedback circuit into the one below. I’ve added
Hes ADCand theDAC
𝐷𝑜 is now the
VI
an ADC and a DAC to the feedback loop,
VX Hcs
output we’re interested V0
in. The equation for the loop would be
Do
HCS𝑜 ) − 𝑉𝑖 )]
Ux Vo Vx
𝐷𝑜 = 𝑎𝑑𝑐 [𝐻(𝑠) (𝑑𝑎𝑐(𝐷
VI Vo
But how can we now calculate the transfer function 𝐷
Vo E 𝑉 ? Both 𝑎𝑑𝑐
𝑜
VI YE
𝑖
and 𝑑𝑎𝑐 could be non-linear functions, so we can’t disentangle the
equation. Let’s make assumptions.
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.
𝑦 = 𝐻(𝑠)(𝑢 − 𝑦) + 𝑒
to yen
I o Ha
een
YET 𝑌(𝑧) HA
= 𝐸(𝑧) + 𝐻(𝑧) [𝑈(𝑧) −UET
𝑌(𝑧)] YET
YG ECz HE UG 4
The whole point of this exercise was to somehow shape the z quan-
tization noise, and we’re almost at the point, but to show how it
works we need to look at the transfer function for the signal 𝑈 and
ECHO for the noise 𝐸 .
y HU HY
t function
12.4.3 Signal transfer
STF
Assume U and E are uncorrelated, and E is zero
𝑌 = 𝐻𝑈 − 𝐻𝑌
𝑌 𝐻 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
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.
12.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 𝑦 𝑠𝑑 .
188 12 Oversampling and Sigma-Delta ADCs
The quantizer generates the next 𝑦 𝑠𝑑 and I have the option to add
dither.
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.
190 12 Oversampling and Sigma-Delta ADCs
−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.
12.6 Examples 191
↵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
< < < <
s1 (t) s2 (t) s3 (t) sN (t)
by A0i = /⇢i . i
Below we can see a power spectral density plot of the ADC, and
The Leapfrog
we can observe ADChow di↵ers
thefrom the Chain-of-integrators
quantization by the addi-
noise is shaped. I think it’s
tional feedback paths between neighboring states. The feedback from xi
atothird
xi 1 is achieved through ↵i , feeding a portion of xi back to the input complex
order NTF with a zero at zero frequency and a of
conjugate
integrator (ipole
1). at 8 MHzish.
Each integrator is stabilized by a local digital control,
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.
3.2 Parametrization
192 12 Oversampling and Sigma-Delta ADCs
0
û(t)
20 NTF
40
60
PSD [dB]
80
100
120
140
160
105 106 107
Frequency [Hz]
58
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.
13.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
200 13 Voltage regulation
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
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)
13.2 Linear Regulators 201
IN W
it 1,5
0,8V
0,8V
TI LOAD
I
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.
W
it 1,5
0,8V
0,8V
TI LOAD
II LOAD
13.2 Linear Regulators 203
The size of the pass-fet is set by the maximum Vgs, and the current
that needs to be delivered.
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 ... m=1000
* 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
For some applications a poor efficiency might be OK, but for most
battery operated systems we’re interested in using the electrons
from the battery in the most effective manner.
When we turn off the switch, the inductor current will not stop
immediately, it cannot, that’s what
𝑑𝐼
𝑉=𝐿
𝑑𝑡
tells us. As a result, the current continues, but now the current is
pulled from ground through the diode.
If the capacitors are the same size, then the output voltage would
be half the input voltage.
1 1 1 DutyCycle
Control
A
or
Vink
Vin A C
OAD ILOAD ILOAD
b B D
at Vin Voat
tion.
As such, the output voltage would be two times the input voltage,
assuming the capacitors are equal.
A
Vin
Vin 3 20in
A C C
Vin
B b b
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
Mott Ex
Vo
Ix C R
Vo
Control B
∫
1
V
LEI I
Efrat
𝐼 𝑥 (𝑡) =
𝐿
𝑉𝑥 (𝑡)𝑑𝑡
t T t
t
Ix by
and the voltage on the capacitor is given
I Ct I CDHVodt I In
I1 ∫
III Salt 𝑉𝑜 (𝑡) =
𝐶 II (𝐼 (𝑡) − 𝐼 (𝑡))𝑑𝑡
𝑥 𝑜
t
NII tx t
Before you dive into Matlab, Mathcad, Maple, SymPy or another
Ialt If
Vodtmath software, it helps to think a bit.
A favorite
ofI your
it
Vo TSIM
VIIIT t
qt is not great, but I don’t think there is any closed
My mathematics I VIA I
form solution to the output voltage of the DC/DC, especially since
ME
t state
the VEII th [Link] t
of thet NMOS and PMOS is time-dependent.
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.
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.6
Ix
Io
0.4
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]
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]
212 13 Voltage regulation
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.
14.1.2 Frequency
14.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.
14.1.4 Stability
14.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
For an analog designer the constraints from digital will tell us
what’s the maximumClkfrequency
in we can have at any point in time,
and what is the maximum cycle-to-cycle variation in the period.
BED XD
AID
Clk out
14.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.
VI VX
Hs
V0
Vo Vx H s
VI Vo Ux
Vo I
VI Vo YE
224 14 Clocks and PLLs
apply Vx
error, Vo
theUx H function 𝐻(𝑠) with high
s
VI
We then takeVo a transfer
gain, and control our oscillator frequency.
Vo Vo I
VI YE frequency is too high, we force the os-
If the down-divided output
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
ED N
Trouble is that dividing down the input frequency will reduce your
fin to
loop bandwidth, as the low-pass filter needs to be about 1/10’th of
yes
the reference frequency. As such, the PLL will respond slower to a
frequency change.
ED N
fin to
yes
Amos N
fin to
His N
food
ED N
fin to
yes
fmod
226 14 Clocks and PLLs
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
PWRUP_1V8
VFB
CP_DOWN
xd0
VLPF
AVSS
AVSS
LPFZ
AVSS
KICK
VBN
VBN
AVSS
VLPFZ
KICK
AVSS
xaa6
AVDD
SUN_PLL_LPF
IBPSR_1U CK_FB 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
Old din
It [Link] 𝜙𝑖𝑛 = 1 + 𝐿(𝑠)
𝐾 𝑜𝑠𝑐 𝐾 𝑝𝑑 𝐾 𝑙𝑝 𝐻𝑙𝑝 (𝑠)
IE
𝐿(𝑠) =
ILG 𝑁𝑠
For the linear model, we need to figure out the factors, like 𝐾 𝑣𝑐𝑜 ,
which must be determined by simulation.
𝑑𝑓
𝐾 𝑜𝑠𝑐 = 2𝜋
𝑑𝑉𝑐𝑛𝑡𝑙
VDD_ROSC
AVDD xaa5
xaa4
VO VDD_ROSC
CK
PWRUP_1V8
VFB
AVSS
SUN_PLL_BUF
SUN_PLL_ROSC
xaa6
[Link] SUN_PLL_SKY130NM/sim/ROSC/
AVDD
CK_FB
[Link] CK
PWRUP_1V8
tran_LayGtVtKttTt
1200 tran_LayGtVtKssTt
tran_LayGtVtKffTt
tran_LayGtVtKttTh
1000 tran_LayGtVtKssTh
tran_LayGtVtKffTh
Frequency [MHz]
tran_LayGtVtKttTl
tran_LayGtVtKssTl
800 tran_LayGtVtKffTl
600
/Users/wulff/pro/aicex/ip/sun_pll_sky130nm/work/../design/SUN_PLL_SKY130NM/SUN_PLL.sch
400
𝐼 𝑐𝑝
𝐾 𝑝𝑑 =
2𝜋
VDD_ROSC
CP_UP_N
xaa1
xaa0
AVDD
AVDD
AVDD
VFB
CP_DOWN
xbb0
VLPF
AVSS
AVSS
LPFZ
AVSS
KICK
VBN
VBN
AVSS
VLPFZ
KICK
AVSS
SUN_PLL_LPF
CK_FB
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
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.
1 1
𝐾 𝑙𝑝 𝐻𝑙𝑝 (𝑠) = 𝐾 𝑙𝑝 +
𝑠 𝜔𝑧
1 1 + 𝑠𝑅𝐶1
𝐾 𝑙𝑝 𝐻𝑙𝑝 (𝑠) =
𝑠(𝐶1 + 𝐶2 ) 1 + 𝑠𝑅 𝐶1 𝐶2
𝐶1 +𝐶2
VDD_ROSC
CP_UP_N
xaa1
xaa0
AVDD
AVDD
Kcp = Ibp/2pi xaa4
AVDD
VLPF
PWRUP_1V8
VFB
CP_DOWN
xbb0
VLPF
AVSS
LPFZ
AVSS
KICK
VBN
VBN
AVSS
VLPFZ
KICK
AVSS
x
SUN_PLL_LPF
CK_FB
CK_
xbb1
14.4.5 Divider
xaa3
BIAS
IBPSR_1U
SUN_PLL_KICK
SUN_PLL_BIAS
1
𝐾 𝑑𝑖𝑣 =
𝑁
B
PWRUP_1
AVSS
14.4 PLL Example 231
UF
SUN_PLL_ROSC
xaa6
AVDD
CK_FB
1
CK
PWRUP_1V8
CK_FB 32
AVSS
SUN_PLL_DIVN
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
[Link] 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.
238 15 Oscillators
15.2.1 Impedance
Our job is to make a circuit that we can connect to the two pins
and provide the energy we will loose due to 𝑅 𝑠 .
240
I
15 Oscillators
D Rst Sh t IE Zin
Rs
Gp sCp
L Cp
CF
Gin
pkg
Assuming zero series resistance t SCP
SCP
Gin
Eye
𝑍 𝑖𝑛 =
𝑠 2 𝐶 𝐹 𝐿 + t1
𝑠 3 𝐶𝑃 𝐿𝐶 𝐹 + 𝑠𝐶𝑃 + 𝑠𝐶 𝐹
L
É tsar
Notice that at 𝑠 = 0 the impedance goes to infinity, so a crystal is
high impedant at DC.
CF
Cp
fstet
Since the 1/(sCp) does not change much at resonance, then
[Link]
𝐿𝐶 𝐹 𝑠 2 + 1
𝑍 𝑖𝑛 ≈
𝐿𝐶 𝐹 𝐶 𝑝 𝑠 2 + 𝐶 𝐹 + 𝐶𝑃
so
See Crystal oscillator impedance for a detailed explanation.
zm
In the impedance plot below we can clearly see that there are
two “resonance” points. Usually noted by series and parallel
resonance.
15.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
242 15 Oscillators
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
15.2 Crystal oscillators 243
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
tpd
tp
2/3𝐶 𝑜𝑥 𝑊 𝐿
𝑡 𝑝𝑑 ≈ 𝑊
𝐿 𝜇𝑛 𝐶 𝑜𝑥 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ ) Erd
1 𝜇𝑛 (𝑉 𝐷𝐷 − 𝑉𝑡 ℎ )
𝑓 = =
2 𝑁𝑡 𝑝𝑑 3 𝑁𝐿
4 2
15.3 Controlled Oscillators 245
𝜕𝑓 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𝑁 𝐶
2𝜋𝜇𝑛 𝐶 𝑜𝑥 𝑊
𝐿
𝐾 𝑣𝑐𝑜 =
2𝑁 𝐶
c c e
15.3.3 Realistic
re
[Link]
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
ggEYeI tam
The circuit has a capacitance loaded ring oscillator fed by a current.
The 𝐼 𝑐𝑜𝑛𝑡𝑟𝑜𝑙 will give a coarse control of the frequency, while the
𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 can give a more precise control of the frequency.
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
15.3 Controlled Oscillators 247
Still today, there are radio recievers that use a PLLs to directly de-
modulate the incoming frequency shift keyed modulated carrier.
c c e
Ijt
inverters mostly act as switches, and when the PMOS is on, then the
cog
[Link]
I
rise time is controlled by the PMOS current mirror, the additional
𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 and the capacitor. For the calculation below we assume
that the pull-down of the capacitor by the NMOS does not affect
the frequency much.
𝑑𝑉
𝐼=𝐶
𝑑𝑡
𝐼 𝑐𝑜𝑛𝑡𝑟𝑜𝑙 + 12 𝜇𝑝 𝐶 𝑜𝑥 𝑊
𝐿 (𝑉 𝐷𝐷 − 𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙 − 𝑉𝑡 ℎ )
2
𝑓 ≈
𝐶 𝑉 𝐷𝐷
2 𝑁
𝜕𝑓
𝐾 𝑣𝑐𝑜 = 2𝜋
𝜕𝑉𝑐𝑜𝑛𝑡𝑟𝑜𝑙
248 15 Oscillators
𝜇𝑝 𝐶 𝑜𝑥 𝑊/𝐿
𝐾 𝑣𝑐𝑜 = 2𝜋
𝐶 𝑉 𝐷𝐷
2 𝑁
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.
Do Di De
C 2C 4C
15.3.5 Differential
[Link]
Differential circuits are potentially less sensitive to supply noise
multiply by -1, just flip the wires, as a result, I can use a 2 stage
ring differential ring oscillator.
15.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
15.4 Relaxation oscillators 251
1
𝑓 ∝√
𝐿𝐶
o n
V
I U
R C
𝑉1 = 𝐼𝑅
V RI 𝑑𝑉
𝐼=𝐶
𝑑𝑡
V2 I 𝐶𝑉2
𝑑𝑡 =
𝐼
CLE
=
𝐶𝐼𝑅
𝐼
re
dt
𝑓 =
1
𝑑𝑡
=
1
𝑅𝐶 EI
1 1
𝑓𝑜 = 𝑓 =
2 2𝑅𝐶
All in all, the packets we send from the mouse may need to have
the following bits.
16.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.
▶ Yellow: Region 1
▶ Blue: Region 2
▶ Pink: Region 3
16.2.2 Antenna
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.
𝑃𝑇𝑋
𝑝=
4𝜋𝐷 2
𝜆2
𝐴𝑒 =
4𝜋
2
𝑃𝑇𝑋 𝜆
𝑃𝑅𝑋 = 2
𝐷 4𝜋
Or in terms of distance
𝑃𝑇𝑋 −𝑃𝑅𝑋 +20𝑙𝑜 𝑔10 𝑐
4𝜋 𝑓
𝐷 = 10 20
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𝜋 𝑓
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?
16.3.1 Battery
16.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.
Next we need to decide what modulation scheme we want for our
light. How should we encode the bits onto the 2.4 GHz carrier
wave?
16.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.
16.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
A
260 16 Low Power Radio
X X Ae
R
rotation was slightly slower, the red dot would move the other way
around the circle.
X
That’s exactly how we can change the position in the constellation.
We increase the carrier frequency for a bit to rotate 180 degrees,
and we can decrease the frequency to go back 180 degrees. In
this example the dot would move around the unit circle, and the
amplitude of the carrier can stay constant.
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 IR 10 10
bo Jo bo I t
j
t
Lo
jo pa
I
A É Fret B
q A
R
LO pi
D
ti
Be it
LEE
In ZigBee, or 802.15.4 as the standard is called, the phase changes I
is actually done with a constant envelope.
p
The nice thing about constant envelope is that the radio transmitter
can be simple. We don’t need to change the amplitude. If we
Q
have a PLL as a local oscillator, where we can change the phase
(or frequency), then we only need a power amplifier before the
antenna.
LO
262 16 Low Power Radio
jo pa
I
A É Fret B
q jo
For phase and amplitude modulation, or complex transmitters, we
need a way to change the amplitude and Aphase. What a shocker.
pa
There are two ways to do that. A polar architecture where phase
R
I pi
É Fret B LO
change is done in the PLL, and amplitude in the power amplifier.
ti
Be it
LEE A
q
R
I
jo
LO
pa
pi
I
A É Fret B
pa
ti
Be it
LEE Q
q A
Or a Cartesian architecture where we make the in-phase compo-
R
I
digital to analog converters, pi
nent, and quadrature-phase components in digital, then use two
LOLO and a set of complex mixers to encode
onto the carrier. The power amplifier would not need to change
D
ti
Be it
LEE the amplitude, but it does need to be linear. pa
Q
I
pa
Q LO
LO
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
16.4.3 Single carrier, or multi carrier? a
And I I Ault
Q
TX RX a S
9m glt
witta [Link]
Af e I I Af
IFFT TX RX a FFT
Q
outta
[Link]
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.
16.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 (nr
Blocks Key parameter Architecture people)
Antenna Gain, impedance lambda/4 <1
RF match loss, input impedance PI-match <1
Low noise amp NF, current, linearity LNTA 1
Mixer NF, current, linearity Passive 1
Anti-alias filter NF, current, linearity Active-RC 1
ADC Sample rate, dynamic range, NS-SAR 1-2
linearity
PLL Phase noise, current AD-PLL 2-3
Baseband Eb/N0, gate count, current. SystemVerilog > 10
16.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
puttin un
16.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
disappears, however, we now have a challenge with the image
frequency (-4 MHz) that must be rejected, and we need an increased
bandwidth.
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.
16.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
16.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.
Comparator
Logic
106µm
CDAC
80µm
Switch
39µm
40µm
(a) (b)
16.6 Algorithm to design state-of-the-art LE radio 275
16.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
16.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/[Link]. Today’s state-of-the-art ADCs in the same
sampling range have a Walden figure of merit of 0.6 fJ/[Link].
For wireless standards, there are some that can be run on en-
ergy harvesting. Below is an overview from [1]. Many of us will
have a NFC card in our pocket for payment, or entry to build-
ings. NFC card has a integrated circuit that is powered from the
electromagnetic field from the NFC reader.
Other standards, like Bluetooth, WiFi, LTE are harder to run battery
less, because the energy requirement above 1 mW.
17.1 Thermoelectric 281
17.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.
284 17 Energy Sources
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.
Ll or
1 50MY
17.2 Photovoltaic
Pr
Ll or 17.2 Photovoltaic 287
50MY 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
man
p
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
288 17 Energy Sources
𝐼𝐷 = 𝐼𝑃 ℎ𝑜𝑡𝑜 − 𝐼𝐿𝑜𝑎𝑑
𝐼𝑃 ℎ𝑜𝑡𝑜 − 𝐼𝐿𝑜𝑎𝑑
𝑉𝐷 = 𝑉𝑇 𝑙𝑛 +1
𝐼𝑆
𝑃𝐿𝑜𝑎𝑑 = 𝑉𝐷 𝐼𝐿𝑜𝑎𝑑
#!/usr/bin/env python3
import numpy as np
import [Link] as plt
m = 1e-3
i_load = [Link](1e-5,1e-3,200)
P_load = V_D*i_load
[Link](2,1,1)
[Link](i_load/m,V_D)
[Link]("Diode voltage [mA]")
[Link]()
[Link](2,1,2)
[Link](i_load/m,P_load/m)
[Link]("Current load [mA]")
[Link]("Power Load [mW]")
[Link]()
[Link]("[Link]")
[Link]()
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.
17.3 Piezoelectric 289
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]
17.3 Piezoelectric
I’m not sure I understand the piezoelectric effect, but I think it goes
something like this.
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 𝑉
290 17 Energy Sources
17.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
292 17 Energy Sources
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.
17.5 Triboelectric generator 293
Assume
𝑃𝑇𝑋
= 1 W (30 dBm) and
𝑃𝑅𝑋
= 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.
17.5 Triboelectric generator 295
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.
17.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.
17.7 Want to learn more? 297
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.
Idea
Analog Design
Xschem
Parasitics
GDSII
Magic
RTL to GDSII
OpenLane
Tapeout
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
302 18 Analog SystemVerilog
▶ Siemens Questa
▶ Synopsys VCS
[Link] Counter
module counter(
output logic [WIDTH-1:0] out,
input logic clk,
input logic reset
);
parameter WIDTH = 8;
endmodule // counter
For example:
X: no further events
18.2 Transient analog simulation 303
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.
𝐺 𝐺 ··· 𝐺
1𝑁 𝑣 𝑖
© 11 12
ª© 1ª © 1ª
𝐺21 𝐺22 · · · 𝐺2𝑁 ® 𝑣2 ® 𝑖2 ®
. .. .. .. ®® .. ®® = .. ®®
.. . . . ® . ® . ®
« 𝐺 𝑁 1 𝐺 𝑁 2 · · · 𝐺 𝑁 𝑁 ¬ «𝑣 𝑁 ¬ « 𝑖 𝑁 ¬
304 18 Analog SystemVerilog
▶ 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
R3
R2[7:1]
R=0.047
R=0.047
1 * 0.3 / 0.3
1 * 0.3 / 0.3
res_generic_m4
res_generic_m4
ui_in[0] : Enable ADC. Useful to measure current consumption TIE_L uio_in[7:0]
clk : Clock, ~ 4 MHz
TIE_L2 uio_oe[7:1]
uio_oe[7:0]
R4
R1[7:1]
R=0.047
R=0.047
1 * 0.3 / 0.3
1 * 0.3 / 0.3
VPWR
res_generic_m4
res_generic_m4
AVDD
AVDD
AVDD
uio_oe[0] DONE uio_out[0]
Y A Y
AVSS
x5 x4 x3
SUNTR_TAPCELLB_CV SUNTR_TIEH_CV SUNTR_BFX1_CV
VGND
AVSS
AVSS
VPWR Power decoupling
c0 C2[8:0]
uo_out[7:0]
cap_mim_m3_1
C=6.617e-13 18 / 18
c1 MF=1
ua[7:0] Output capture
clk
x2
x1
SAR core
ena ui_in[0]
CKS ua[1]
SAR_IP
ENABLE ua[0]
CK_SAMPLE SAR_IN
clk CK_SAMPLE_BSSW
CK_SAMPLE SARN
SARN
d1
diode_pw2nd_05v5 CK_SAMPLE_BSSW SARP
area=2.025e11 EN SARP
rst_n pj=1.8e6
diode
D<7>
EN DONE
DONE
D2
d0 D<7> D<7>
D<6> D<7>
D<6> D<6>
D<5> D<6>
VGND D<5> D<5>
D<4> D<5>
D<4> D<4>
D<3> D<4>
D<3> D<3> SUNSAR_SAR8B_CV
D<2> D<3>
D<2> D<2>
D<1> D<2>
D<1> D<1>
D<0> SUNSAR_CAPT8B_CV
D<1>
D<0> D<0>
ui_in[0] uo_out[7] D<0>
DO<7> EN
uo_out[6] EN
DO<6> CK_SAMPLE
uo_out[5] CK_SAMPLE
d1
DO<5> CK_SAMPLE_BSSW
diode_pw2nd_05v5 uo_out[4] CK_SAMPLE_BSSW
ui_in[7:0] area=2.025e11 diode uo_out[3]
DO<4> VPWR
VREF
pj=1.8e6
D3
DO<3> VPWR
d0 uo_out[2] d1
diode_pw2nd_05v5 AVDD
DO<2> area=2.025e11 VGND
uo_out[1] diode AVSS
DO<1> pj=1.8e6
D1
VGND uo_out[0] d0
DO<0>
DONE
DONE
VPWR VGND
AVDD
VGND
AVSS
VGND TIE_L
TIE_L Designer Carsten Wulff
Updated wulff
Modified 2024-04-12 [Link]
Copyright Carsten Wulff Software
Library/Cell tt_um_TT06_SAR_wulffern
//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
`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
308 18 Analog SystemVerilog
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
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
or
Shorter is better
312 19 How to write a project report
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,
19.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.
The outline should be included towards the end of the introduction.
The purpose of the outline is to make this document easy to read. A
reader should never be surprised by the text. All concepts should
be eased into. We don’t want the reader to feel like they been
thrown in at the end of a long story. As such, if you chosen to solve
the problem statement in a way not previously solved in a key
references, then you should explain that.
A checklist for all chapters can be seen in table below.
19.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.
The purpose of the theory section is not to demonstrate that you
have read the references, but rather, highlight theory that the
reader probably does not know.
314 19 How to write a project report
19.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.
19.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.
19.3.5 Discussion
Give some insight into what is missing in the work. What should
be the next steps?
19.3.7 Conclusion
19.3.8 Appendix
19.4 Checklist
Item Description OK
Is the problem Describe which parts of the problem you chose to focus on. The
description problem description should match the results you’ve achieved.
clearly defined?
Is there a clear The reader might need help to understand why the problem is
explanation interesting
why the
problem is
worth solving?
Is status of You should make sure that you know what others have done for
state-of-the-art the same problem. Check IEEEXplore. Provide summary and
clearly references. Explain how your problem or solution is different
explained?
Is the key Highlight what you’ve achieved. What was your contribution?
contribution
clearly
explained?
Is there an Give a short summary of what the reader is about to read
outline of the
report?
Is it possible for Have you included references to relevant papers
a reader skilled
in the art to
understand the
work?
Is the theory The theory section should be less than 10 % of the work
section too long
Are all circuits Have you explained how every single block works?
explained?
Are figures Remember to explain all colors, and all symbols. Explain what
clear? the reader should understand from the figure. All figures must
be referenced in the text.
Is it clear how It’s a good idea to explain what type of testbenches you used. For
you verified the example, did you use dc, ac or transient to verify your circuit?
circuit?
Are key You at least need current from VDD. Think through what you
parameters would need to simulate to prove that the circuit works.
simulated?
Have you tried Knowing how circuits fail will increase confidence that it will
to make the work under normal conditions.
circuit fail?
Have you been Try to look at the verification from different perspectives. Play
critical of your devil’s advocate, try to think through what could go wrong, then
own results? explain how your verification proves that the circuit does work.
Have you Imagine that someone reads your work. Maybe they want to
explained the reproduce it, and take one step further. What should that step be?
next steps?
No new Never put new information into conclusion. It’s a summary of
information in what’s been done
conclusion.
Story Does the work tell a story, is it readable? Don’t surprise the reader
by introducing new topics without background information.
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.
316 19 How to write a project report
Item Description OK
Too much time How much time you spent on something 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 [Link]. Example can be seen from an old version of this
document at [Link]
/2021-10-19_project_report. Write in LaTeX. You will need
LaTeX for your project and master thesis. Use
[Link] 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)
Layout Generation 20
20.1 Layout . . . . . . . . . 317
20.1 Layout
20.2 Setup . . . . . . . . . . 317
20.3 CICPY . . . . . . . . . 317
The open source tools don’t have any automatic analog layout. 20.4 Placement . . . . . . . 317
To my knowledge, there is no general purpose analog automagic
layout anywhere in the world. It’s an unsovled problem. Many
have tried (including myself), but none have succeeded with a
generic analog layout engine.
There are a few things, though, that could help you on the way.
20.2 Setup
I assume that you have the latest and greatest aicex\ip setup.
cd aicex/ip/
cd jnw_gr05_sky130a
git checkout a1e3dfc324194729e042f5e653777b052759863b
cd work
20.3 CICPY
cd aicex/ip/cicpy
git checkout master
git pull
python3 -m pip install -e .
cd ..
cd cicspi
git checkout main
git pull
python3 -m pip install -e .
20.4 Placement
cd jnw_gr05_sky130a/work
cicpy sch2mag JNW_GR05_SKY130A OTA_Manuel
318 20 Layout Generation
The X and Y space is for the distance between groups. The unit is
“Ångstrøm”, so 1 um is 10 000 Å.
320 20 Layout Generation
MOSFETs 21
I’m stunned if you’ve never heared the word “transistor”. I think 21.1 Metal Oxide Semi-
most people have heard the word. What I find funny is that almost conductor . . . . . 321
nobody understand in full detail how transistors work. 21.2 Field Effect . . . . 323
21.3 Analog transistors
Through my 30 year venture into the world of electronics I’ve in the books . . . . 327
met “analog designers”, or people that should understand exactly 21.4 Transistors in weak
how transistors work. I used to hire analog designers, and I’ve inversion . . . . . . 329
interviewed hundred plus “analog designers” in my 8 years as 21.5 Transistors in
manager and I’ve met hundreds of students of analog design. I strong inversion . 332
would go as far as to say none of them know everything about 21.6 How should I size
transistors, including myself. my transistor? . . . 335
21.7 Introduction to
Most of the people I’ve met have a good brain, so that is not the
behavior . . . . . . 336
reason they don’t understand. Transistors are incredibly compli- 21.7.1 Drain Source Cur-
cated! I say this, because if at some point in this document, you rent . . . . . . . . . 336
don’t understand, then don’t worry, you are not alone. 21.7.2 Gate-source voltage 337
21.7.3 Inversion level . . . 337
In this document I’m focusing on Metal Oxide Semiconductor Field 21.7.4 Drain source volt-
Effect Transistors (MOSFETs), and ignore all other transistors. age . . . . . . . . . . 339
21.7.5 Strong inversion . 340
21.7.6 Low frequency
21.1 Metal Oxide Semiconductor 21.7.7
model . . . . . . . . 342
Transconductance 342
21.7.8 Intrinsic gain . . . 343
The first part of the MOSFET name illustrates the 3 dimensional 21.7.9 High frequency
composition of the transistor. Take a semiconductor (Silicon), grow model . . . . . . . . 344
21.7.10 Be careful with Cgd
some oxide (Silicon Oxide, SiO2), and place a metal, or conductive,
(blame Miller) . . . 346
gate on top of the oxide. With those three components we can build
21.8 Weak inversion . . 347
our transistor.
21.9 Velocity saturation 348
Something like the cartoon below where only the Metal (gate) of 21.9.1 Square law model 349
the MOS name is shown. 21.9.2 Mobility Degrada-
tion . . . . . . . . . 349
The oxide and the silicon bulk is not visible, but you can imagine 21.9.3 What about holes
them to be underneath the gate, with a thin oxide (a few nano (PMOS) . . . . . . . 350
meters thick) and the silicon the transparent part of the picture. 21.10 OTHER . . . . . . . 350
21.10.1 Drain induced
The length (L), and width (W) of the MOS is annotated in blue. barrier lowering
(DIBL) . . . . . . . 351
21.10.2 Well Proximity
Effect (WPE) . . . . 352
21.10.3 Stress effects . . . . 352
21.10.4 Gate current . . . . 353
21.10.5 Hot carrier injection 353
21.10.6 Channel initiated
secondary-electron
(CHISEL) . . . . . . 354
21.11 Variability . . . . . 354
21.11.1 Voltage variation . 355
21.11.2 Systematic varia-
tions . . . . . . . . . 355
21.11.3 Process variations 356
21.11.4 Process corners . . 356
21.11.5 Fix process varia-
tion . . . . . . . . . 357
322 21 MOSFETs
VD VS
MN1 MP1
VG VG
VS VD
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.
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.
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.
21.2 Field Effect 325
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.
MP1
Vin Vout
MN1
Figure 7: Inverter
326 21 MOSFETs
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.
21.3 Analog transistors in the books 327
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 𝐿
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
conduction band.
Source
In Gate
An electron in the source would see a energy barrier of 𝜙 𝐵 , and most
Drain
electrons would be turned around at the barrier. Some, however,
do have the energy to traverse the barrier and flow through the
n all of them would
bulk. Not
p reach the bulk,ndue to recombination,
but let’s assume the bulk is short, and all electrons injected into
the bulk show up at the drain.
e e
At the drain side they would fall down the potential barrier to the
drain. The nsame process wouldphappen in reverse, n from drain to
source.
Source
Source Gate
Gate Drain
Drain
n n
Mma
In p p
n n
e e
e e
In
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.
n
Mma p n
e e
where
𝑛 = (𝐶 𝑜𝑥 + 𝐶 𝑗 0 )/𝐶 𝑜𝑥
2
𝑘𝑇
𝐼𝐷 0 = (𝑛 − 1)𝜇𝑛 𝐶 𝑜𝑥
𝑞
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
you, and the drain would be into the picture.
É
É
Figure 13: Band diagram of a fictive MOSFET.
Ec
at É
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
21.6 How should I size my transistor? 335
In Figure 2 in
you can see how the free electron density is located underneath
the gate.
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.
336 21 MOSFETs
We could sit down, and try and figure out how the transistors
work.
or symbolically
𝐼𝐷𝑆 = 𝑓 (𝑉𝐺𝑆 , 𝑉𝐷𝑆 ) = 𝐺 𝑚 (𝑉𝐺𝑆 , 𝑉𝐷𝑆 , 𝐼𝐷𝑆 )𝑉𝐺𝑆 +𝐺 𝑑𝑠 (𝑉𝐺𝑆 , 𝑉𝐷𝑆 , 𝐼𝐷𝑆 )𝑉𝐷𝑆
Even now we can see that the model above is complicated. The
transconductance and conductance of the transistor is a function
of the other voltages, and the output current. It’s a non-linear
system!
21.7 Introduction to behavior 337
If the transistor was linear, then we would expect that the current
increased proportionally to gate/source voltage, but how does the
current look when we change the gate source voltage?
Below are the conditions I’ve used in the testbench. Notice there
is a 𝑉𝐵 that is the 𝑝− substrate, or bulk, of the transistor. When
we draw symbols of a transistor we don’t always include the bulk
node, because that’s most of the time connected to ground for
NMOS.
Param Voltage
VGS 0 to 1.8
VDS 1.0
VS 0
VB 0
In the plot below we can see the sweep of the gate voltage.
𝑖(𝑣𝑐𝑢𝑟) = 𝐼𝐷𝑆
10 3
i(vcur)
10 4
10 5
10 6
10 7
10 8
10 9
Define
𝑉𝑒 𝑓 𝑓 ≡ 𝑉𝐺𝑆 − 𝑉𝑡𝑛
, where
𝑉𝑡𝑛
338 21 MOSFETs
Weak inversion
𝑉𝑒 𝑓 𝑓 << 0
𝑊 𝑉𝑒 𝑓 𝑓 /𝑛𝑉𝑇
𝐼𝐷𝑆 ≈ 𝐼𝐷 0 𝑒 if 𝑉𝐷𝑆 > 3𝑉𝑇
𝐿
𝑛 ≈ 1.5
Moderate inversion
Strong inversion
𝑉𝑒 𝑓 𝑓 𝑉𝐷𝑆 if 𝑉𝐷𝑆 << 𝑉𝑒 𝑓 𝑓
𝑊 𝑉𝑒 𝑓 𝑓 𝑉𝐷𝑆 − 𝑉𝐷𝑆 /2 if 𝑉𝐷𝑆 < 𝑉𝑒 𝑓 𝑓
2
𝐼𝐷𝑆 = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
2 𝑉𝑒 𝑓 𝑓 if 𝑉𝐷𝑆 > 𝑉𝑒 𝑓 𝑓
1 2
21.7 Introduction to behavior 339
𝑖(𝑣𝑐𝑢𝑟) = 𝐼𝐷𝑆
340 21 MOSFETs
1e 5
1.4 i(vcur)
1.2
1.0
0.8
i(vcur)
0.6
0.4
0.2
0.0
0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75
vdrain
𝑉𝑒 𝑓 𝑓 𝑉𝐷𝑆 if 𝑉𝐷𝑆 << 𝑉𝑒 𝑓 𝑓
𝑊 𝑉𝑒 𝑓 𝑓 𝑉𝐷𝑆 − 𝑉𝐷𝑆 /2 if 𝑉𝐷𝑆 < 𝑉𝑒 𝑓 𝑓
2
𝐼𝐷𝑆 = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
2 𝑉𝑒 𝑓 𝑓 if 𝑉𝐷𝑆 > 𝑉𝑒 𝑓 𝑓
1 2
1e 5
1.4 i(vcur)
1.2
1.0
0.8
i(vcur)
0.6
0.4
0.2
0.0
0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75
vdrain
21.7 Introduction to behavior 341
342 21 MOSFETs
𝜕𝐼𝐷𝑆
𝑔𝑚 =
𝜕𝑉𝐺𝑆
1 𝜕𝐼𝐷𝑆
𝑔𝑑𝑠 = =
𝑟 𝑑𝑠 𝜕𝑉𝐷𝑆
21.7.7 Transconductance
Define
𝑊
ℓ = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
and
𝑉𝑒 𝑓 𝑓 = 𝑉𝐺𝑆 − 𝑉𝑡𝑛
21.7 Introduction to behavior 343
1
𝐼𝐷 = ℓ (𝑉𝑒 𝑓 𝑓 )2
2
and r
2𝐼𝐷
𝑉𝑒 𝑓 𝑓 =
ℓ
and
2𝐼𝐷
ℓ=
𝑉𝑒2𝑓 𝑓
𝜕𝐼𝐷𝑆 p
𝑔𝑚 = = ℓ𝑉𝑒 𝑓 𝑓 = 2ℓ 𝐼𝐷
𝜕𝑉𝐺𝑆
𝐼𝐷 2𝐼𝐷
𝑔𝑚 = ℓ𝑉𝑒 𝑓 𝑓 = 2 𝑉𝑒 𝑓 𝑓 =
𝑉𝑒 𝑓 𝑓
2 𝑉𝑒 𝑓 𝑓
Define
𝑊
ℓ = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
and
𝑉𝑒 𝑓 𝑓 = 𝑉𝐺𝑆 − 𝑉𝑡𝑛
1
𝐼𝐷 = ℓ𝑉𝑒2𝑓 𝑓 [1 + 𝜆𝑉𝐷𝑆 − 𝜆𝑉𝑒 𝑓 𝑓 )]
2
1 𝜕𝐼𝐷 1
= 𝑔𝑑𝑠 = = 𝜆 ℓ𝑉𝑒2𝑓 𝑓
𝑟 𝑑𝑠 𝜕𝑉𝐷𝑆 2
1
𝐼𝐷 = ℓ𝑉𝑒2𝑓 𝑓
2
which means
1
= 𝑔𝑑𝑠 ≈ 𝜆𝐼𝐷
𝑟 𝑑𝑠
𝑣 𝑜𝑢𝑡 𝑔𝑚
𝐴= = 𝑔𝑚 𝑟 𝑑𝑠 =
𝑣 𝑖𝑛 𝑔𝑑𝑠
2𝐼𝐷 1 2
𝐴= × =
𝑉𝑒 𝑓 𝑓 𝜆𝐼𝐷 𝜆𝑉𝑒 𝑓 𝑓
344 21 MOSFETs
v(a)
12
10
v(a)
8
𝑉𝑒 𝑓 𝑓 + 𝑉𝑡𝑛
𝐶 𝑔𝑠
and
𝐶 𝑔𝑑
𝑊 𝐿𝐶 𝑜𝑥 if 𝑉𝐷𝑆 = 0
𝐶 𝑔𝑠 =
3 𝑊 𝐿𝐶 𝑜𝑥 if 𝑉𝐷𝑆 > 𝑉𝑒 𝑓 𝑓
2
𝐶 𝑔𝑑 = 𝐶 𝑜𝑥 𝑊 𝐿 𝑜𝑣
𝐶 𝑠𝑏
and
𝐶 𝑑𝑏
𝐶 𝑠𝑏 = (𝐴 𝑠 + 𝐴 𝑐 ℎ )𝐶 𝑗𝑠
𝐶 𝑗0
𝐶 𝑗𝑠 = q
𝑉𝑆𝐵
1+ Φ0
!
𝑁𝐴 𝑁𝐷
Φ0 = 𝑉𝑇 𝑙𝑛
𝑛 𝑖2
𝐶 𝑑𝑏 = 𝐴 𝑑 𝐶 𝑗𝑑
𝐶 𝑗0
𝐶 𝑗𝑠 = q
𝑉𝐷𝐵
1+ Φ0
346 21 MOSFETs
If
𝑌(𝑠) = 1/𝑠𝐶
then
𝑌1 (𝑠) = 1/𝑠𝐶 𝑖𝑛
and
𝑌2 (𝑠) = 1/𝑠𝐶 𝑜𝑢𝑡
where
𝐶 𝑖𝑛 = (1 + 𝐴)𝐶
,
1
𝐶 𝑜𝑢𝑡 = (1 + )𝐶
2
𝐶1 = 𝐶 𝑔𝑑 𝑔𝑚 𝑟 𝑑𝑠
𝐶 𝑔𝑑
can appear to be 10 to 100 times larger!
If
𝑉𝑒 𝑓 𝑓 < 0
diffusion currents dominate.
𝑊 𝑉𝑒 𝑓 𝑓 /𝑛𝑉𝑇
𝐼𝐷 = 𝐼𝐷 0 𝑒
𝐿
, where
𝑉𝑇 = 𝑘𝑇/𝑞
,
𝑛 = (𝐶 𝑜𝑥 + 𝐶 𝑗 0 )/𝐶 𝑜𝑥
𝐼𝐷 0 = (𝑛 − 1)𝜇𝑛 𝐶 𝑜𝑥 𝑉𝑇2
𝐼𝐷
𝑔𝑚 =
𝑛𝑉𝑇
Subthreshold:
𝑔𝑚 1
= ≈ 25.6 [S/A] @ 300 K
𝐼𝐷 𝑛𝑉𝑇
Strong inversion:
𝑔𝑚 2
=
𝐼𝐷 𝑉𝑒 𝑓 𝑓
348 21 MOSFETs
v(gmid)
25
20
15
v(gmid)
10
0
0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75
vgmid
𝑣 ≈ 107 𝑐𝑚/𝑠
𝑑𝑉
𝑣 = 𝜇𝑛 𝐸 = 𝜇𝑛
𝑑𝑥
𝜇𝑛 ≈ 100 to 600 𝑐𝑚 2 /𝑉 𝑠
in nanoscale CMOS
108
107
𝑄(𝑥) = 𝐶 𝑜𝑥 𝑉𝑒 𝑓 𝑓 − 𝑉(𝑥)
𝑑𝑉
𝑣 = 𝜇𝑛 𝐸 = 𝜇𝑛
𝑑𝑥
𝑊
ℓ = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
𝑑𝑉
𝐼𝐷 = 𝑊 𝑄(𝑥)𝑣 = ℓ 𝐿 𝑉𝑒 𝑓 𝑓 − 𝑉(𝑥)
𝑑𝑥
𝐼𝐷 𝑑𝑥 = ℓ 𝐿 𝑉𝑒 𝑓 𝑓 − 𝑉(𝑥) 𝑑𝑉
∫ 𝐿 ∫ 𝑉𝐷𝑆
𝐼𝐷 𝑑𝑥 = ℓ 𝐿 𝑉𝑒 𝑓 𝑓 − 𝑉(𝑥) 𝑑𝑉
0 0
𝑉𝐷𝑆
1
𝐼𝐷 [𝑥]0𝐿 = ℓ 𝐿 𝑉𝑒 𝑓 𝑓 𝑉 − 𝑉 2
2 0
1 2
𝐼𝐷 𝐿 = ℓ 𝐿 𝑉𝑒 𝑓 𝑓 𝑉𝐷𝑆 − 𝑉𝐷𝑆
2
1
@𝑉𝐷𝑆 = 𝑉𝑒 𝑓 𝑓 ⇒ 𝐼𝐷 = ℓ𝑉𝑒2𝑓 𝑓
2
▶ Velocity saturation
▶ Vertical fields reduce channel depth => more charge-carrier
scattering
𝑊
ℓ = 𝜇𝑛 𝐶 𝑜𝑥
𝐿
𝜇𝑛
𝜇𝑛 _ 𝑒 𝑓 𝑓 =
([1 + (𝜃𝑉𝑒 𝑓 𝑓 )𝑚 ])1/𝑚
1 1
𝐼𝐷 = ℓ𝑉𝑒2𝑓 𝑓
2 ([1 + (𝜃𝑉𝑒 𝑓 𝑓 )𝑚 ])1/𝑚
350 21 MOSFETs
ℓ
𝑔𝑚(𝑚𝑜𝑏−𝑑𝑒 𝑔) =
2𝜃
𝜇 𝑝 < 𝜇𝑛
In intrinsic silicon:
𝜇𝑛 ≤ 1400[𝑐𝑚 2 /𝑉 𝑠] = 0.14[𝑚 2 /𝑉 𝑠]
𝜇𝑝 ≤ 450[𝑐𝑚 2 /𝑉 𝑠] = 0.045[𝑚 2 /𝑉 𝑠]
𝜇 𝑛 ≈ 3𝜇 𝑝
Doping (
𝑁𝐴 or𝑁𝐷
) reduces
𝜇
21.10 OTHER
[Link]
21.11 Variability
Provide
𝐼2 = 1𝜇𝐴
Use
𝑊1 𝑊2
=
𝐿1 𝐿2
What makes
𝐼2 ≠ 1𝜇𝐴
?
21.11 Variability 355
M1 M2
I1 I2
▶ Voltage variation
▶ Systematic variations
▶ Process variations
▶ Temperature variation
▶ Random variations
▶ Noise
𝑉𝐷𝐷 − 𝑉𝐺𝑆1
𝐼1 =
𝑅
If
𝑉𝐷𝐷
changes, then current changes.
Fix: Keep
𝑉𝐷𝐷
constant
If
𝑉𝐷𝑆1 ≠ 𝑉𝐷𝑆2 → 𝐼1 ≠ 𝐼2
356 21 MOSFETs
If layout direction of
𝑀1 ≠ 𝑀2 → 𝐼1 ≠ 𝐼2
If current direction of
𝑀1 ≠ 𝑀2 → 𝐼1 ≠ 𝐼2
If
𝑉𝑆1 ≠ 𝑉𝑆2 → 𝐼1 ≠ 𝐼2
If
𝑉𝐵1 ≠ 𝑉𝐵2 → 𝐼1 ≠ 𝐼2
If
𝑊 𝑃𝐸1 ≠ 𝑊 𝑃𝐸2 → 𝐼1 ≠ 𝐼2
If
𝑆𝑡𝑟𝑒 𝑠𝑠 1 ≠ 𝑆𝑡𝑟𝑒 𝑠𝑠 2 → 𝐼1 ≠ 𝐼2
...
q
𝑉𝐷𝐷 − 2
𝐼1 − 𝑉𝑡𝑝
𝑉𝐷𝐷 − 𝑉𝐺𝑆 𝜇𝑝 𝐶 𝑜𝑥 𝑊
𝐿
𝐼1 = =
𝑅 𝑅
𝜇𝑝
,
𝐶 𝑜𝑥
,
𝑉𝑡𝑝
will all vary from die to die, and wafer lot to wafer lot.
𝑅1
and tune
𝑅 𝑣𝑎𝑟
such that we get
𝐼1 = 1𝜇𝐴
1
𝐼𝐷 = 𝜇𝑛 𝐶 𝑜𝑥 (𝑉𝐺𝑆 − 𝑉𝑡𝑛 )2
2
High
𝐼𝐷 =
fast digital circuits
Low
𝐼𝐷 =
slow digital circuits
21.11.7 It depends on
𝑉𝐷𝐷
𝑉𝐷𝐷
𝑉𝐷𝐷
If you need stability over temperature, use 7.3.2 and 7.3.4 in CJM
(SUN_BIAS_GF130N)
𝑊
ℓ = 𝜇𝑝 𝐶 𝑜𝑥
𝐿
1
𝐼𝐷 = ℓ (𝑉𝐺𝑆 − 𝑉𝑡𝑝 )2
2
𝐶 𝑜𝑥
,
𝑉𝑡𝑝
, . . . random varation
ℓ1 ≠ ℓ2
𝑉𝑡𝑝 1 ≠ 𝑉𝑡𝑝 2
As a result
𝐼1 ≠ 𝐼2
, but we can make them close.
21.11 Variability 359
Δ𝑃
𝐴2𝑃
𝜎2 (Δ𝑃) = + 𝑆𝑃2 𝐷 2
𝑊𝐿
where
𝐴𝑃
and
𝑆𝑃
are measured, and
𝐷
is the distance between devices
Assume closely spaced devices (
𝐷≈0
)
𝐴2𝑃
⇒ 𝜎 (Δ𝑃) =
2
𝑊𝐿
𝑉𝐺𝑆
†
𝜎𝐼2𝐷
" #
𝜎ℓ2
2
1 𝑔𝑚
= 𝜎𝑣𝑡
2
+
𝐼𝐷
2 𝑊𝐿 𝐼𝐷 ℓ
𝜎𝐼2𝐷
" #
𝜎ℓ2
2
1 𝑔𝑚
= 𝜎𝑣𝑡
2
+
𝐼𝐷
2 𝑊𝐿 𝐼𝐷 ℓ
𝜎𝐼𝐷 1
∝√
𝐼𝐷 𝑊𝐿
Assume
𝜎𝐼𝐷
= 10%
𝐼𝐷
, We want
5%
, how much do we need to change WL?
𝜎𝐼 𝐷
𝐼𝐷 1 1
∝ √ =√
2 2 𝑊𝐿 4𝑊 𝐿
1%
would require 100 times the area
M1 M2
I1 I2
R1
Rvar
𝜎𝐼2𝐷
" #
𝜎ℓ2
2
1 𝑔𝑚
= 𝜎𝑣𝑡
2
+
𝐼𝐷
2 𝑊𝐿 𝐼𝐷 ℓ
Strong inversion
𝑔𝑚 1
⇒ = = 𝑙𝑜𝑤
𝐼𝐷 2𝑉𝑒 𝑓 𝑓
21.11 Variability 361
Weak inversion
𝑔𝑚 𝑞
⇒ = ≈ 25
𝐼𝐷 𝑛 𝑘𝑇
𝜎𝐼2𝐷
" #
𝜎ℓ2
2
1 𝑔𝑚
= 𝜎𝑣𝑡
2
+
𝐼𝐷
2 𝑊𝐿 𝐼𝐷 ℓ
" #
1 𝜎
2 ℓ
2
𝜎𝐼2𝐷 = 𝑔𝑚 2 𝜎𝑣𝑡
2
+ 𝐼𝐷
𝑊𝐿 ℓ
𝑖 𝑜 = 𝑖 𝑜+ − 𝑖 𝑜− = 𝑔𝑚 𝑣 𝑖 = 𝑔𝑚 (𝑣 𝑖+ − 𝑣 𝑖− )
𝜎𝐼2𝐷
" #
1 𝐼𝐷
2
𝜎ℓ2
𝜎𝑣2𝑖 = = 𝜎 2
+
𝑔𝑚 2 𝑊 𝐿 𝑣𝑡 𝑔𝑚 2 ℓ
High
𝑔𝑚
𝐼𝐷
is better (best in weak inversion)
io− io+
vi+ vi−
𝑃𝑆𝐷𝑇𝐻 ( 𝑓 ) = Constant
362 21 MOSFETs
𝐴
𝑃𝑆𝐷𝐺𝑅 ( 𝑓 ) ∝ Lorentzian shape ≈
𝑓2
1+ 𝑓0
1
𝑃𝑆𝐷 𝑓 𝑙𝑖𝑐 𝑘𝑒𝑟 ( 𝑓 ) ∝
𝑓
Circuits 22
22.1 Current Mirrors . . 363
22.1 Current Mirrors 22.1.1 Normal current
mirror . . . . . . . . 363
MOSFETs need a current for the transistor to be biased in the 22.1.2 Source degeneration 366
22.1.3 Output resistance . 367
correct operating region. The current must come from somewhere,
we’ll look at bias generators later. Usually there is a central bias 22.2 Amplifiers . . . . . . 370
circuit that provides a single, good, reference current. 22.3 Source follower . . 370
22.3.1 Output resistance . 370
On an IC, however, there will be many circuits, and they all need 22.3.2 Why use a source
a bias current (usually). As such, we need a circuit to copy a follower? . . . . . . . 371
current. 22.4 Common gate . . . 372
22.4.1 Input resistance . . 373
In the figure below you can see a selection of current mirros. They 22.4.2 Output resistance . 373
all do the same thing. Try to ensure that 𝑖 𝑖 and 𝑖 𝑜 are the same 22.4.3 Gain . . . . . . . . . 373
current. 22.5 Common source . . 374
22.5.1 Gain . . . . . . . . . 375
Which one we choose is usually determined by what we mean by 22.5.2 Why common
𝑖 𝑖 = 𝑖 𝑜 . Do we mean “within ± 10 %”, or “within ± 2 %”. source? . . . . . . . . 376
22.6 Differential pair . . 376
ii
22.6.1 Diff pairs are cool . 377
ii io ii io io
M1 M2 M3 M4 M3 M4
vb
ii io
M1 M2 M3 M4 M1 M2 M1 M2
If the two transistors are the same size, threshold voltage, mobility,
etc, and they have the same gate-source voltage, then the current
in them must be the same.
A current pushed into 𝑀1 will cause the 𝑉𝐺𝑆1 to rise, and at some
point, find a stable point where the current pushed in is equal to
the current in 𝑀1
𝑀2 will see the same 𝑉𝐺𝑆1 = 𝑉𝐺𝑆2 so the current will be the same,
provided the voltage at 𝑖 𝑜 is sufficient to pinch-off the channel of
𝑀2 , or the 𝑉𝐷𝑆2 ≈ 3 𝑘𝑇/𝑞 if the transitor is in weak-inversion.
364 22 Circuits
ii io
M1 M2
To see the small signal input resistance we can apply a test voltage
to the diode connected resistor, as shown in the figure below.
𝑖 𝑦 = 𝑔𝑑𝑠 𝑣 𝑦 + 𝑔𝑚 𝑣 𝑦
𝑣𝑦 1
𝑟 𝑖𝑛 = =
𝑖𝑦 𝑔𝑚 + 𝑔𝑑𝑠
22.1 Current Mirrors 365
1
𝑟 𝑖𝑛 ≈
𝑔𝑚
.
1 𝜇𝐴
Would the voltage be 𝑣 𝑦 = 𝑟 𝑖𝑛 𝑖 𝑦 = 1 𝜇𝑆 = 1 𝑉 ? NO! It’s important to
understand the difference between the small signal input resistance,
and the large signal impedance.
ii io
M1 M2
M3 M4
1
𝑟 𝑖𝑛 = + 𝑅𝑠
𝑔𝑚 1
ii io
M1 M2
Rs Rs
𝑣 𝑔𝑠 = −𝑣 𝑠
,
𝑣𝑠 = 𝑖𝑥 𝑅𝑠
368 22 Circuits
,
𝑣𝑥
𝑟 𝑜𝑢𝑡 =
𝑖𝑥
𝑣𝑥 − 𝑣𝑠
𝑖 𝑥 = 𝑔𝑚 2 𝑣 𝑔𝑠 +
𝑟 𝑑𝑠 2
𝑣𝑥 − 𝑖𝑥 𝑅𝑠
𝑖 𝑥 = −𝑖 𝑥 𝑔𝑚 2 𝑅 𝑠 +
𝑟 𝑑𝑠 2
𝑣 𝑥 = 𝑖 𝑥 𝑟 𝑑𝑠 2 + 𝑅 𝑠 (𝑔𝑚 2 𝑟 𝑑𝑠 2 + 1)
Rearranging
𝑅 𝑆 = 𝑟 𝑑𝑠 2
𝑟 𝑜𝑢𝑡 ≈ 𝑟 𝑑𝑠 2 (𝑟 𝑑𝑠 4 𝑔𝑚 4 )
22.1 Current Mirrors 369
ii io
M3 M4
vb
M1 M2
𝑟 𝑜𝑢𝑡 ≈ 𝑟 𝑑𝑠 2 (𝐴𝑟 𝑑𝑠 4 𝑔𝑚 4 )
370 22 Circuits
22.2 Amplifiers
Input resistance
≈∞
Gain
𝑣𝑜
𝐴=
𝑣𝑖
Output resistance
𝑟 𝑜𝑢𝑡
𝑖 𝑜 = 𝑣 𝑜 (𝑔𝑑𝑠 + 𝑔𝑠 ) − 𝑔𝑚 𝑣 𝑖 + 𝑣 𝑜 𝑔𝑚
22.3 Source follower 371
𝑣𝑖 = 0
𝑖 𝑜 = 𝑣 𝑜 (𝑔𝑑𝑠 + 𝑔𝑠 + 𝑔𝑚 )
𝑣𝑜 1
𝑟 𝑜𝑢𝑡 = =
𝑖𝑜 𝑔𝑚 + 𝑔𝑑𝑠 + 𝑔𝑠
1
𝑟 𝑜𝑢𝑡 ≈
𝑔𝑚
Input resistance
Gain
Output resistance
22.4 Common gate 373
𝑖 = 𝑔𝑚 𝑣 + 𝑔𝑑𝑠 𝑣
1 1
𝑟 𝑖𝑛 = ≈
𝑔𝑚 + 𝑔𝑑𝑠 𝑔𝑚
𝑅𝐿
1
𝑟 𝑖𝑛 ≈ 1+
𝑔𝑚 𝑟 𝑑𝑠
22.4.3 Gain
𝑣𝑜 − 𝑣𝑖
𝑖 𝑜 = −𝑔𝑚 𝑣 𝑖 +
𝑟 𝑑𝑠
𝑖𝑜 = 0
374 22 Circuits
0 = −𝑔𝑚 𝑣 𝑖 𝑟 𝑑𝑠 + 𝑣 𝑜 − 𝑣 𝑖
𝑣 𝑖 (1 + 𝑔𝑚 𝑟 𝑑𝑠 ) = 𝑣 𝑜
𝑣𝑜
= 1 + 𝑔𝑚 𝑟 𝑑𝑠
𝑣𝑖
If
𝑅 𝐿 >> 𝑟 𝑑𝑠
,
𝑅𝑆 = 0
and
𝑔𝑠 = 0
(𝑔𝑚 + 𝑔𝑑𝑠 )𝑟 𝑑𝑠
𝐴= = 1 + 𝑔𝑚 𝑟 𝑑𝑠
1
𝑟 𝑖𝑛 ≈ ∞
𝑟 𝑜𝑢𝑡 = 𝑟 𝑑𝑠
, it’s same circuit as the output of a current mirror
Gain
22.5 Common source 375
22.5.1 Gain
𝑣𝑜
𝑖 𝑜 = 𝑔𝑚 𝑣 𝑖 +
𝑟 𝑑𝑠
𝑖𝑜 = 0
𝑣𝑜
−𝑔𝑚 𝑣 𝑖 =
𝑟 𝑑𝑠
𝑣𝑜
= −𝑔𝑚 𝑟 𝑑𝑠
𝑣𝑖
376 22 Circuits
Input resistance
𝑟 𝑖𝑛 ≈ ∞
Gain
𝐴 = 𝑔𝑚 𝑟 𝑑𝑠
Output resistance
𝑟 𝑜𝑢𝑡 = 𝑟 𝑑𝑠
𝑣 𝑜 = 𝑔𝑚 𝑟 𝑑𝑠 𝑣 𝑖
and
𝑣 𝑜 = −𝑔𝑚 𝑟 𝑑𝑠 𝑣 𝑖
▶ Calibre xRC
380 23 Integrated Passives
▶ Synopsys StarRC
▶ Cadence Quantus
▶ Magic VLSI
3D EM Simulators
▶ Keysight ADS
▶ HFSS
▶ Synopsys TCAD
23.2 Resistors
That’s why almost all analog circuits rely on the relative sizes of
passives, not the absolute value. If a circuit does rely on absolute
values, then it usually needs to be trimmed in production.
23.2.1 Polysilicon
23.2.2 Diffusion
Non-linear capacitance
23.2.3 Metal
23.3 Capacitors
nRF52832
3200𝜇𝑚 × 3000𝜇𝑚 = 9600 𝑘𝜇𝑚 2
S
< 5 𝑘𝜇𝑚 2
M
< 50 𝑘𝜇𝑚 2
L
< 200 𝑘𝜇𝑚 2
XL
> 200 𝑘𝜇𝑚 2
Unit capacitance
≈ 1 𝑓 𝐹/𝜇𝑚 2 /𝑙𝑎 𝑦𝑒𝑟
M1 M2 M3 M4 (a)
C1B
C4
C8
C2
C16
C1A
CT OP
(b)
dicex/sim/spice/NCHIO/[Link]
* gate cap
.include ../../../models/ptm_130.spi
vdrain D 0 dc 1
vgaini G 0 dc 0.5
vbulk B 0 dc 0
vcur S 0 dc 0
.op
Moscap is
≈ 10 𝑓 𝐹/𝜇𝑚 2
23.3.4 Varactors
23.4 Inductors
Usually two top metals, because they are thick (low ohmic)
≈ ±10
% to
±20
%
0.1 % to 1 %
>2
% or more
𝑖3 = 0 = 𝑖1 − 𝑖2
𝑉𝑖 − 𝑉𝑜 𝑉𝑜
0= −
𝑅 1/𝑠𝐶
0 = 𝑉𝑖 − 𝑉𝑜 − 𝑉𝑜 𝑠𝑅𝐶
𝑉𝑜 (1 + 𝑠𝑅𝐶) = 𝑉𝑖
𝑉𝑜 1
=
𝑉𝑖 1 + 𝑠𝑅𝐶
23.7 Diodes 387
)‗ of
𝜎𝑅 = 20
%,
𝜎𝐶 = 20
%
√
𝜎𝑅𝐶 = 0.22 + 0.22 = 28
%
23.7 Diodes
‗ If
you don’t remember how standard deviation works, read Introduction to
mathematics of noise sources
SPICE 24
24.1 SPICE . . . . . . . . 389
24.1 SPICE
24.2 Simulation Program
with Integrated
Circuit Emphasis . 389
24.2 Simulation Program with Integrated 24.2.1 Today . . . . . . . . . 389
Circuit Emphasis 24.2.2 But . . . . . . . . . . 390
24.2.3 Sources . . . . . . . . 391
24.2.4 Passives . . . . . . . 392
To manufacture an integrated circuit we have to be able to predict 24.2.5 Transistor Models . 392
how it’s going to work. The only way to predict is to rely on our 24.2.6 Transistors . . . . . . 394
knowledge of physics, and build models of the real world in our 24.2.7 Foundries . . . . . . 394
computers. 24.3 Find right transistor
sizes . . . . . . . . . 394
One simulation strategy for a model of the real world, which 24.3.1 Use unit size tran-
absolutely every single integrated circuit in the world has used to sistors for analog
come into existence, is SPICE. design . . . . . . . . 395
24.3.2 What about gm/Id ? 395
Published in 1973 by Nagel and Pederson 24.3.3 Characterize the
transistors . . . . . . 396
SPICE (Simulation Program with Integrated Circuit Emphasis)
24.4 More information . 396
24.5 Analog Design . . . 396
24.6 Demo . . . . . . . . . 396
24.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.
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.
24.2.2 But
for example
ngspice [Link]
The expensive tools have built graphical user interface around the
SPICE simulator to make it easier to run multiple scenarios.
24.2.3 Sources
I1 0 VDN dc In
I2 VDP 0 dc Ip
V2 VSS 0 dc 0
V1 VDD 0 dc 1.5
24.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
24.2.6 Transistors
24.2.7 Foundries
Each foundry has their own SPICE models bacause the transistor
parameters depend on the exact physics of the technology!
[Link]
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
=
𝐼𝑑 𝑉𝑒 𝑓 𝑓
396 24 SPICE
[Link]
CH_2C1F2.html
Ngspice Manual
Installing tools
On failure, go back
24.6 Demo
[Link]
n
CMOS Logic 25
25.1 CMOS Logic . . . 397
25.2 Analog transistor
to digital transistor 397
25.1 CMOS Logic 25.3 CMOS static logic
assumptions . . . . 399
25.4 Don’t break rules
unless you know
exactly why it will
be OK . . . . . . . . 401
25.2 Analog transistor to digital transistor
25.5 Logic cells . . . . . 401
25.5.1 CMOS static logic is
inverting . . . . . . 401
25.5.2 Rules for inverting
logic . . . . . . . . . 404
NMOS current (W = 0.4u L=0.15u) as a function of 25.6 SR-Latch . . . . . . 408
25.7 D-Latch (16 transis-
𝑉𝐺𝑆
tors) . . . . . . . . . 409
and 25.8 Other logic cells . 409
𝑉𝐷𝑆 25.9 AOI22: and or
invert . . . . . . . . 410
25.10 Tristate inverter . 411
25.11 Mux . . . . . . . . . 411
25.12 There are other
dicex/lectures/l13/[Link] types of logic . . . 413
25.13 Speed . . . . . . . . 414
25.14 Flip-flops and
speed . . . . . . . . 414
25.15 Timing analysis . 415
25.16 Timing analysis
tools . . . . . . . . . 416
25.17 Every gate must
be simulated to
provide behavior
over input tran-
sition and load
capacitance . . . . 419
25.18 All analog blocks
must have associ-
ated liberty file to
describe behavior
and timing paths
If you integrate
analog into digital
top flow . . . . . . 419
25.19 Gate Delay . . . . 419
25.20 Delay estimation . 419
25.21 Elmore Delay . . . 420
25.22 Delay components 420
25.23 Modern IC timing
analysis requires
computers with
advanced programs 422
25.24 Best number of
398 25 CMOS Logic
25.3 CMOS static logic assumptions 399
NOT
A A
B B
y y
A B A B
25.4 Don’t break rules unless you know exactly why it will be OK 401
A B AB AB AB ATB
0 0 1 I o o AI ITE DM
0 1 I 0 O l ATB FB DM
1 0 T O O 1
1 O AB AT
1 O f y
ATB ART
I B ATB AB FEED
1 I I 0 0 AT AT
1
I 0 I 0 0 1 Atb AT
0 I 1 0 0 I
00 0 0 1 I
A Y
1 0
0 1
402 25 CMOS Logic
PU OFF ON
PD
OFF Z 1
ON 0 X
PD = Pull-down PU = Pull-up
Pull-up series
A B Y
0 0 1
0 1 Z
1 0 Z
1 1 Z
Pull-up paralell
25.5 Logic cells 403
A B Y
0 0 1
0 1 1
1 0 1
1 1 Z
A ABY
00 1
Of X
IO X
B
1 It
Y
1
ABY
00 1
B 01 1
A
19
[.table-separator: #000000, stroke-width(1)] [.table: margin(8)]
Pull-down series Y
A B AY ABY
0 0 Z 00 X
0 1 Z
1 0 Z
of X
1 1 0
B lot
111
Pull-down paralell
Y ABY
A B Y
0 0 Z
0 1 0
OO X
A
1 0 0
B
1 1 0
ol
101
I l
A
Y
A ABY
00 X
of X
B lot
111
Y ABY
OO X
A B ol
101
I l
Pull-up OR
⇒
PMOS in series
⇒
POS AND
⇒
PMOS in paralell
⇒
PAP
Pull-down OR
⇒
NMOS in paralell
⇒
NOP AND
⇒
NMOS in series
⇒
NAS
25.5 Logic cells 405
Y = AB = NOT ( A AND B)
AND PU
⇒
PMOS in paralell PD
⇒
NMOS in series
406 25 CMOS Logic
A B NOT(A AND B)
0 0 1
0 1 1
1 0 1
1 1 0
Y = A + B = NOT ( A OR B)
OR PU
⇒
25.5 Logic cells 407
PMOS in series PD
⇒
NMOS in paralell
A B NOT(A OR B)
0 0 1
0 1 0
1 0 0
1 1 0
408 25 CMOS Logic
25.6 SR-Latch
Remember De-Morgan
𝐴𝐵 = 𝐴 + 𝐵
𝐴+𝐵=𝐴·𝐵
𝑄 = 𝑅𝑄 = 𝑅 + 𝑄 = 𝑅 + 𝑄
𝑄 = 𝑆𝑄 = 𝑆 + 𝑄 = 𝑆 + 𝑄
QQ ND S Q
L 1
01 I R Q
0 I
XX O
S
E
R Q
𝑄 =𝑅+𝑄
,
𝑄 =𝑆+𝑄
S R Q ~Q
0 0 X X
0 1 0 1
1 0 1 0
1 1 Q ~Q
Q
R Q
25.7 D-Latch (16 transistors)
C D Q ~Q
0 X Q ~Q
1 0 0 1
1 1 1 0
What about
Y = AB
and
Y=A+B
?
Y = AB = AB
Y = A+B = A+B
410 25 CMOS Logic
Y = A OR B = NOT( NOT( A OR B ) )
Y = AB + CD
I 1
A B
C D
Y
A C
B b
TE
É A E
A Y YE y
E E
E
Po A
143
A
É A E
[.table-separator: #000000, stroke-width(1)] [.table: margin(8)]
A Y YE y
E E
25.10 Tristate inverter E
A
E A Y
0 0 Z
0 1 Z
1 0 1
1 1 0
Y
E
25.11 Mux
S Y
0 NOT(P1)
0 NOT(P1)
1 NOT(P0)
1 NOT(P0)
MUK
412 25 CMOS Logic
PO Pl
s s
n Y
s s
f i
D-Latch (12 transistors)
Pl
gPO
s E
Q
D Q
L C
c
5 s
E
Po Pl
D-Flip Flop (< 26 transistors)
25.12 There are other types of logic 413
BENT X v3
AN
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
25.13 Speed
[Link]
100
10 2
10 3
BENT X v3
AN
dicex/lib/SUN_TR_GF130N.spi:
Setup time: How long before clk does the data need to change
v(d)
1
0
v(ck)
1
0
v(q)
1
0
v(qn)
1
0
0.0 0.5 1.0 1.5 2.0 2.5
Time(dff_setup_8.csv) 1e 9
Hold time: How long after clk can the data change
v(d)
1
0
v(ck)
1
0
v(q)
1
1
v(qn)
0
0.0 0.5 1.0 1.5 2.0 2.5
Time(dff_hold_-[Link]) 1e 9
Timing is not OK
as so
so 99 130
98 100 30
I
93 40 20
97 60
40
There will
Synopsys PrimeTime be some criticalpaths
Free OpenTimer
that must be analysed and maybe
fixed
osu018_stdcells.lib
cell (INVX1) {
cell_footprint : inv;
area : 16;
cell_leakage_power : 0.0221741;
418 25 CMOS Logic
pin(A) {
direction : input;
capacitance : 0.00932456;
rise_capacitance : 0.00932196;
fall_capacitance : 0.00932456;
}
pin(Y) {
direction : output;
capacitance : 0;
rise_capacitance : 0;
fall_capacitance : 0;
max_capacitance : 0.503808;
function : "(!A)";
timing() {
related_pin : "A";
timing_sense : negative_unate;
cell_fall(delay_template_5x5) {
index_1 ("0.005, 0.0125, 0.025, 0.075, 0.15");
index_2 ("0.06, 0.18, 0.42, 0.6, 1.2");
values ( \
"0.030906, 0.037434, 0.038584, 0.039088, 0.030318", \
"0.04464, 0.057551, 0.073142, 0.077841, 0.081003", \
"0.064368, 0.091076, 0.11557, 0.126352, 0.144944", \
"0.139135, 0.174422, 0.232659, 0.261317, 0.321043", \
"0.249412, 0.28434, 0.357694, 0.406534, 0.51187");
}
fall_transition(delay_template_5x5) {
index_1 ("0.005, 0.0125, 0.025, 0.075, 0.15");
index_2 ("0.06, 0.18, 0.42, 0.6, 1.2");
values ( \
"0.032269, 0.0648, 0.087, 0.1032, 0.1476", \
"0.036025, 0.0726, 0.1044, 0.1236, 0.183", \
"0.06, 0.0882, 0.1314, 0.1554, 0.2286", \
"0.1494, 0.1578, 0.2124, 0.2508, 0.3528", \
"0.288, 0.2892, 0.3192, 0.3576, 0.492");
}
cell_rise(delay_template_5x5) {
index_1 ("0.005, 0.0125, 0.025, 0.075, 0.15");
index_2 ("0.06, 0.18, 0.42, 0.6, 1.2");
values ( \
"0.037639, 0.056898, 0.083401, 0.104927, 0.156652", \
"0.05258, 0.083003, 0.119028, 0.141927, 0.207952", \
"0.07402, 0.112622, 0.162437, 0.191122, 0.271755", \
"0.15767, 0.201007, 0.284096, 0.331746, 0.452958", \
"0.285016, 0.326868, 0.415086, 0.481337, 0.653064");
}
rise_transition(delay_template_5x5) {
index_1 ("0.005, 0.0125, 0.025, 0.075, 0.15");
index_2 ("0.06, 0.18, 0.42, 0.6, 1.2");
values ( \
"0.031447, 0.059488, 0.0846, 0.0918, 0.138", \
"0.047167, 0.0786, 0.1044, 0.1224, 0.1734", \
"0.072, 0.096, 0.1398, 0.1578, 0.222", \
"0.1866, 0.1914, 0.2358, 0.2748, 0.3696", \
"0.3648, 0.3648, 0.384, 0.4146, 0.5388");
}
}
internal_power() {
related_pin : "A";
fall_power(energy_template_5x5) {
index_1 ("0.005, 0.0125, 0.025, 0.075, 0.15");
index_2 ("0.06, 0.18, 0.42, 0.6, 1.2");
values ( \
"0.009213, 0.004772, 0.00823, 0.018532, 0.054083", \
"0.009047, 0.005677, 0.005713, 0.015244, 0.049453", \
"0.008669, 0.006332, 0.002998, 0.01159, 0.04368", \
"0.007879, 0.007243, 0.001451, 0.004701, 0.030385", \
"0.007605, 0.007297, 0.003652, 0.000737, 0.020842");
}
rise_power(energy_template_5x5) {
25.17 Every gate must be simulated to provide behavior over input transition and load capacitance 419
𝐶 ≈ 1 fF/𝜇m
420 25 CMOS Logic
𝑅 ≈ 1 kΩ𝜇m
𝐶 ≈ 1 fF/𝜇m
,
𝑅 ≈ 1 kΩ𝜇m
𝑡 𝑝𝑑 = 𝑅 × 6𝐶 = 6𝑅𝐶
𝑡 𝑝𝑑 = 6 × 1 × 103 × 1 × 10−15 s
𝑡 𝑝𝑑 = 6 × 10−12 = 6 ps
p = 9 or 12 RC
f = 5h RC
𝑑𝑟𝑒 𝑎𝑙
𝑑=
𝜏
,
𝜏 = 3𝑅𝐶
25.22 Delay components 421
Parasitic delay
⇒ 𝑝 = 12𝑅𝐶/3𝑅𝐶 = 4
Effort delay
5
⇒ 𝑓 = 5 ℎ𝑅𝐶/3𝑅𝐶 = ℎ
3
Delay
5
⇒𝑑= 𝑓 +𝑝 = ℎ+4
3
Parasitic delay
⇒𝑝=4
Logic effort
5
⇒𝑔=
3
Electrical effort
⇒ℎ=1
Effort
⇒ 𝑓 = 𝑔ℎ
Delay
2
⇒ 𝑑 = 𝑓 + 𝑝 = 𝑔ℎ + 𝑝 = 5
3
Real delay
2
⇒ 𝑑 = 5 × 3 ps = 17 ps
3
number of stages 1 N
Q
logical effort g G= (gi )
Cin Cout(path)
electrical effort h= Cout H= Cin(path)
effort f = gh F = GBH
P
effort delay f DF = fi
P
parsitic delay p P = pi
P
delay d=f +p D= di = DF + P
422 25 CMOS Logic
64
1 4 16
64
H
It 64
number of stages 1 N
Q
logical effort g G= (gi )
Cin Cout(path)
electrical effort h= Cout H= Cin(path)
TIC
Q
G IT si T
Conpath +Cof f path
branching effort b= Conpath B= bi
effort f = gh F = GBH
P
effort delay f DF = fi
parsitic delay B p1 P =
P
pi
P
delay d=f +p D=
64 di = DF + P
F GBH
𝐻 = 𝐶 𝑐𝑜𝑢𝑡 /𝐶 𝑖𝑛 = 64
Y delay
Path effort
𝐺= 𝑔 =
Y
1=1 𝑖
‡ Often De
called power gating
E Fi
64 D 64 1
a f
25.26 Trends 423
𝐵=1
𝐹 = 𝐺𝐵𝐻 = 64
One stage
𝑓 = 64 ⇒ 𝐷 = 64 + 1 = 65
𝐷𝐹 = 12, 𝑝 = 3 ⇒ 𝐷 = 12 + 3 = 15
𝑓 =4
(Used to be
𝑓 =𝑒
)
25.26 Trends
3500
500
3000
2500 400
Frequency [MHz]
Power [uW]
2000 300
1500
200
1000
100
500
0 0
0.4 0.6 0.8 1.0 1.2 1.4 0.4 0.6 0.8 1.0 1.2 1.4
0.6
4000
dPower/dFrequency [uW/MHz]
0.5
dFrequency/dVDD [f/V]
3500
0.4
3000
0.3
2500
0.2
2000 0.1
1500 0.0
0.4 0.6 0.8 1.0 1.2 1.4 0.4 0.6 0.8 1.0 1.2 1.4
VDD [V] VDD [V]
424 25 CMOS Logic
2.2 1e9
2.0
1.8
Frequency [Hz]
1.6
1.4
1.2
1.0
0.8
25 0 25 50 75 100 125 150
1e7
0.4
dFrequency/dTemp [f/K]
0.6
0.8
1.0
1.2
25 0 25 50 75 100 125 150
Temperature [C]
module counter(
output logic [WIDTH-1:0] out,
input logic clk,
input logic reset
);
parameter WIDTH = 8;
endmodule // counter
25.27 Attack vector 425
.SUBCKT counter out_7 out_6 out_5 out_4 out_3 out_2 out_1 out_0 clk reset AVDD AVSS
* SPICE netlist generated by Yosys 0_9 (git sha1 1979e0b1, gcc 10_3_0-1ubuntu1~20_10 -fPIC -Os)
X0 out_2 1 AVDD AVSS IVX1_CV
X1 out_3 2 AVDD AVSS IVX1_CV
X2 out_4 3 AVDD AVSS IVX1_CV
X3 out_5 4 AVDD AVSS IVX1_CV
X4 out_6 5 AVDD AVSS IVX1_CV
X5 out_0 6 AVDD AVSS IVX1_CV
X6 out_1 7 AVDD AVSS IVX1_CV
X7 6 7 8 AVDD AVSS NRX1_CV
X8 out_0 out_1 9 AVDD AVSS NDX1_CV
X9 1 9 10 AVDD AVSS NRX1_CV
X10 10 11 AVDD AVSS IVX1_CV
X11 2 11 12 AVDD AVSS NRX1_CV
X12 out_3 10 13 AVDD AVSS NDX1_CV
X13 out_3 10 14 AVDD AVSS NRX1_CV
X14 12 14 15 AVDD AVSS NRX1_CV
X15 3 13 16 AVDD AVSS NRX1_CV
X16 16 17 AVDD AVSS IVX1_CV
X17 out_4 12 18 AVDD AVSS NRX1_CV
X18 16 18 19 AVDD AVSS NRX1_CV
X19 4 17 20 AVDD AVSS NRX1_CV
X20 out_5 16 21 AVDD AVSS NDX1_CV
X21 out_5 16 22 AVDD AVSS NRX1_CV
X22 20 22 23 AVDD AVSS NRX1_CV
X23 5 21 24 AVDD AVSS NRX1_CV
X24 out_6 20 25 AVDD AVSS NRX1_CV
X25 24 25 26 AVDD AVSS NRX1_CV
X26 out_7 24 27 AVDD AVSS NRX1_CV
X27 out_7 24 28 AVDD AVSS NDX1_CV
X28 28 29 AVDD AVSS IVX1_CV
X29 27 29 30 AVDD AVSS NRX1_CV
X30 out_0 out_1 31 AVDD AVSS NRX1_CV
X31 8 31 32 AVDD AVSS NRX1_CV
X32 out_2 8 33 AVDD AVSS NRX1_CV
X33 10 33 34 AVDD AVSS NRX1_CV
X34 35 clk AVSS reset out_0 35 AVDD AVSS DFSRQNX1_CV
X35 32 clk AVSS reset out_1 36 AVDD AVSS DFSRQNX1_CV
X36 34 clk AVSS reset out_2 37 AVDD AVSS DFSRQNX1_CV
X37 15 clk AVSS reset out_3 38 AVDD AVSS DFSRQNX1_CV
426 25 CMOS Logic
300.0
250.0
200.0
150.0
100.0
50.0
−0.0
0.0 20.0 40.0 60.0 80.0 100.0 120.0 140.0
time ns
dicex/sim/verilog/counter_sv/counter_attack_tb.cir
VDDA AVDD_ATTACK 0 dc 0.5 pulse(1.5 0.6 tcd trf trf tapw taper)
25.27 Attack vector 427
1.6
1.4
1.2
1.0
0.8
0.6
0.4
0.2
0.0
−0.2
0.0 20.0 40.0 60.0 80.0 100.0 120.0 140.0
time ns
300.0
250.0
200.0
150.0
100.0
50.0
0.0
−50.0
0.0 20.0 40.0 60.0 80.0 100.0 120.0 140.0
time ns
428 25 CMOS Logic
Power
25.29 Power
Instantanious power:
𝑃(𝑡) = 𝐼(𝑡)𝑉(𝑡)
Energy :
∫ 𝑇
𝑃(𝑡)𝑑𝑡
0
[J]
25.31 Power dissipated in a resistor 429
Average power:
∫ 𝑇
1
𝑃(𝑡)𝑑𝑡
𝑇 0
[W or J/s]
Ohm’s Law
𝑉𝑅 = 𝐼𝑅 𝑅
𝑉𝑅2
𝑃𝑅 = 𝑉𝑅 𝐼𝑅 = 𝐼𝑅2 𝑅 =
𝑅
𝑑𝑉
𝐼𝐶 = 𝐶
𝑑𝑡
∞ ∞ 𝑉𝐶 𝑉𝐷𝐷
𝑑𝑉 𝑉2
∫ ∫ ∫
𝐸𝐶 = 𝐼𝐶 𝑉𝐶 𝑑𝑡 = 𝐶 𝑉𝐶 𝑑𝑡 = 𝐶𝑉 𝑑𝑉 = 𝐶
0 0 𝑑𝑡 0 2 0
1
𝐸𝐶 = 𝐶𝑉𝐷𝐷
2
2
1
𝐸𝐶 = 𝐶𝑉𝐷𝐷
2
2
𝑑𝑉
𝐼𝑉 𝐷𝐷 = 𝐼𝐶 = 𝐶
𝑑𝑡
∞ ∞ 𝑉𝐷𝐷
𝑑𝑉
∫ ∫ ∫
𝐸𝑉 𝐷𝐷 = 𝐼𝑉 𝐷𝐷 𝑉𝐷𝐷 𝑑𝑡 = 𝐶 𝑉𝐷𝐷 𝑑𝑡 = 𝐶𝑉𝐷𝐷 𝑑𝑉 = 𝐶𝑉𝐷𝐷
2
0 0 𝑑𝑡 0
Only half the energy is stored on the capacitor, the rest is dissipated
in the PMOS
430 25 CMOS Logic
1
𝐸𝐶 = 𝐶𝑉𝐷𝐷
2
2
𝐸𝑉 𝐷𝐷 = 𝐶𝑉𝐷𝐷
2
𝑃𝑉 𝐷𝐷 = 𝐶𝑉𝐷𝐷
2
𝑓
Define
𝑃𝑖
to be the probability that a node is 1
Define
𝑃𝑖 = 1 − 𝑃𝑖
to be the probability that a node is 0
𝛼 𝑖 = 𝑃𝑖 𝑃𝑖
Random data
𝑃 = 0.5
,
𝛼 = 0.25
Clocks
𝛼=1
Gate PY
AND2 PA PB
NAND2 1 − PA PB
Gate PY
AND2 PA PB
NAND2 1 − PA PB
I
Y
C z
b
Atte F AI E ABCD
Assume
1
𝑃 = 𝑃𝐴 = 𝑃𝐵 = 𝑃𝐶 = 𝑃𝐷 =
2
DI 5 E
𝑃𝑋 = 𝑃𝑍 = 1 − 𝑃𝑃 = 1 −
1 3
=
4 4
DE 5 E 𝑃𝑋 = 𝑃𝑌 =
1
4
Pr PC PD 0,5
1 1 1
𝑃𝑌 = × =
PA
4 4 16
1 1 15 1 15
𝛼= 1− = =
16 16 16 16 256
25.39 Strategies to reduce dynamic power 433
Gate PY
AND2 PA PB
NAND2 1 − PA PB
I
Y
C z
b
Atte
Use De Morgan first
FAB + CD
AI E ABCD
𝐴+𝐵=𝐴·𝐵
DI 5 E
AB + CD = ABCD = 𝐴𝐵𝐶𝐷
5 E
4
DE
1 1
⇒𝑃 𝑌 = 𝑃𝐴 𝑃𝐵 𝑃𝐶 𝑃𝐷 = =
2 16
P
𝑃𝑡𝑜𝑡 = 𝛼𝐶𝑉𝐷𝐷
2
𝑓
Pr PC PD 0,5
PA 25.39 Strategies to reduce dynamic power
1. Stop clock
2. Stop activity
3. Reduce clock frequency
Py
434 25 CMOS Logic
BENT X v3
AN
Clk in
Lo
Enable Clk out
Logic D Q
Clk in
Lo
25.39.2 Stop activity
Alo yo
Alo
XXX
yo
I
XXX Bos
Bos
x o3
x o3
BED XD
AID
I
Clk out
BED XD
AID § Often called clock gating
Clk out
as
Gig
Ef
ClkB<ClkA
for
Inputs Gated
egg
outputs
Logic
VDDH
VDDL
[Link]
Fast logic Slow logic Level
I 1 1 1 1 shifter 1
any rook
Uno ont
it
faut
d
¶ Often e velocity sot
called power gating
4 2 Quadratic
so onto 2
436 25 CMOS Logic
𝐶 2𝑉𝐷𝐷
3
𝐸𝐷𝑃 = 𝑘
(𝑉𝐷𝐷 − 𝑉𝑡 )1 to 2
𝑉𝐷𝐷
3
𝑉𝐷𝐷−𝑜𝑝𝑡 = 𝑉𝑡 ∈ [1.5, 3]𝑉𝑡
3 − 1 to 2
25.40 Wires
Pitch = w + s
These days
𝐴𝑅 ≈ 2
Use 1-segment
𝜋
-model for Elmore delay
438 25 CMOS Logic
C/2 R C/2
---/\/\/\---
| |
--- ---
--- ---
| |
--- ---
- -
resistivity ⇒ 𝜌 [Ωm]
𝜌 𝑙 𝑙
𝑅= = 𝑅□
𝑡𝑤 𝑤
𝑅 = 𝑅□ × # of squares
1.7𝜇Ω𝑐𝑚
𝑅 𝑠 ℎ𝑒 𝑒𝑡−𝑚 1 ≈ ≈ 0.1Ω/□
200𝑛𝑚
1.7𝜇Ω𝑐𝑚
𝑅 𝑠 ℎ𝑒 𝑒𝑡−𝑚 9 ≈ ≈ 0.006Ω/□
3𝜇𝑚
Pitfalls
25.48 Contacts
25.50 FSM
Mealy machine
Careful with
An FSM where outputs depend on current
tate and inputs
output comb
for analogsystem
glitches
1
Moore machine
Careful with
An FSM where outputs depend on current output comb
state for analogsystem
in glitches
y
fates
out
so I t
CLK
Carsten Wulff 2021 5
25.53.1 dicex/sim/counter_sv/counter.v
module counter(
output logic [WIDTH-1:0] out,
input logic clk,
input logic reset
);
parameter WIDTH = 8;
logic [WIDTH-1:0] count;
always_comb begin
count = out + 1;
end
endmodule // counter
25.54 Battery charger FSM 441
1 C = 2950 mA
0.1 C = 295 mA
Voltage above
𝑉𝑇𝑅𝐼𝐶𝐾𝐿𝐸
Voltage close to
𝑉𝑇𝐸𝑅𝑀
If voltage close to
𝑉𝑇𝐸𝑅𝑀
and current is close to
𝐼𝑇𝐸𝑅𝑀
, then charging complete
𝑉𝑅𝐸𝐶𝐻𝐴𝑅𝐺𝐸
Fast charge (1 C)
Constant voltage
Charging complete
25.54 Battery charger FSM 443
iterm = 0
vterm = 0
vtrkl = 0
vterm = 1 Const. Voltage
Fast charge vrchrg = 0
vtrkl = 1 iterm = 1
Trickle charge
vrchrg = 1 Complete
digraph finite_state_machine {
rankdir=LR;
size="8,5"
iterm = 0
vterm = 0
vtrkl = 0
vterm = 1 Const. Voltage
Fast charge vrchrg = 0
vtrkl = 1 iterm = 1
Trickle charge
vrchrg = 1 Complete
end
VCONST: begin
trkl <= 0;
fast <= 0;
vconst <= 1;
done <= 0;
end
25.54 Battery charger FSM 445
DONE: begin
trkl <= 0;
fast <= 0;
vconst <= 0;
done <= 1;
end
endcase // case (state)
end // else: !if(reset)
end
endmodule
dicex/sim/verilog/bcharger_sv/[Link]
# read design
read_verilog -sv [Link];
hierarchy -top bcharger;
# mapping flip-flops
dfflibmap -liberty ../../../lib/SUN_TR_GF130N.lib
# mapping logic
abc -liberty ../../../lib/SUN_TR_GF130N.lib
vtrkl
BUF
A $441 $442
$437 Y A Y
iterm BUF A Y B NDX1_CV IVX1_CV
IVX1_CV
A $444
A $447 Y
vterm BUF Y B NRX1_CV
B NRX1_CV
A $452
BUF A $451 Y
A Y B NDX1_CV
vrchrg $450 NRX1_CV
Y B
B NRX1_CV
A $445
Y
B NDX1_CV
$435 A 0:0 - 0:0
A Y $453
IVX1_CV A $443 Y
Y B NDX1_CV
B NRX1_CV
$436 $446 A $455
A Y A Y A Y
IVX1_CV IVX1_CV $454 NDX1_CV
Y B
B NRX1_CV 0:0 - 1:1
next_state 1:1 - 0:0
A $440 $449
1:1 - 0:0 Y A Y
B NRX1_CV IVX1_CV
0:0 - 0:0
A $438 A
Y $448
0:0 - 0:0 B NDX1_CV Y
B NDX1_CV BUF CK
state Q
0:0 - 0:0 D $322
R DFSRQNX1_CV
CK QN $429
Q S
D $321
R DFSRQNX1_CV CK 1'0
QN Q
S $428 D $326 0:0 - 1:1
1'0
1'0 R DFSRQNX1_CV
QN $433
S
trkl
BUF
clk
$439
A Y
IVX1_CV CK
Q vconst
D $324
R DFSRQNX1_CV
0:0 - 0:0 QN $431
S
1'0
BUF
reset
CK
Q fast
D $325
R DFSRQNX1_CV
QN $432
S
1'0
0:0 - 0:0
CK
Q done
D $323
R DFSRQNX1_CV
QN $430
S
1'0
bcharger
Mixed Signal Simulation in
NGSPICE 26
26.1 Mixed Signal Simu-
26.1 Mixed Signal Simulation in ngspice lation in ngspice . . 447
26.2 Digital simulation . 447
26.2 Digital simulation 26.3 Transient analog
simulation . . . . . . 448
26.4 Demo . . . . . . . . . 449
▶ The order of execution of events at the same time-step do
26.5 The circuit . . . . . . 450
not matter
26.6 The digital code . . 450
▶ The system is causal. Changes in the future do not affect
26.7 Compile RTL . . . . 451
signals in the past or the now
26.8 Import object into
There are both commercial an open source tools for digital simula- SPICE file . . . . . . 451
tion. If you’ve never used a digital simulator, then I’d recommend 26.9 Import in testbench 452
you start with iverilog. I’ve made some examples at dicex. 26.10 Override default
digital output voltage452
Commercial 26.11 Running . . . . . . . 452
▶ Cadence Excelium
▶ Siemens Questa
▶ Synopsys VCS
Open Source
▶ iverilog/vpp
▶ Verilator
▶ SystemDotNet
logic rst = 0;
end // dig
endmodule
𝐺 𝐺 ··· 𝐺
1𝑁 𝑣 𝑖
© 11 12
ª© 1ª © 1ª
𝐺21 𝐺22 · · · 𝐺2𝑁 ® 𝑣2 ® 𝑖2 ®
. .. .. .. ®® .. ®® = .. ®®
.. . . . ® . ® . ®
« 𝐺 𝑁 1 𝐺 𝑁 2 · · · 𝐺 𝑁 𝑁 ¬ «𝑣 𝑁 ¬ « 𝑖 𝑁 ¬
The simulator, and devices model the non-linear current/voltage
behavior between all nodes
as such, the 𝐺 ’s may be non-linear functions, and include the 𝑣 ’s
and 𝑖 ’s.
Transient analysis use numerical methods to compute time evolu-
tion
The time step is adjusted automatically, often by proprietary algo-
rithms, to trade accuracy and simulation speed.
The numerical methods can be forward/backward Euler, or the
others listed below.
▶ Euler
▶ Runge-Kutta
▶ Crank-Nicolson
▶ Gear
26.4 Demo 449
Digital Analog
Simulator Simulator
26.4 Demo
Tutorial at [Link]
Repository at [Link]
What we want from the digital is to control the binary value of the
current DAC.
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="../[Link]" 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
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 ../[Link]
.include ../[Link]
* 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
...
26.11 Running
The Transformer follows this overall architecture using stacked self-attention and point-wise, fully
connected layers for both the encoder and decoder, shown in the left and right halves of Figure 1,
espectively.
Neural Nets 3blue1brown
3.1 Encoder and Decoder Stacks
Encoder: The encoder is composed of a stack of N = 6 identical layers. Each layer has two
ub-layers. The first is a multi-head self-attention mechanism, and the second is a simple, position-
wise fully connected feed-forward network. We employ a residual connection [11] around each of
he two sub-layers, followed by layer normalization [1]. That is, the output of each sub-layer is
LayerNorm(x + Sublayer(x)), where Sublayer(x) is the function implemented by the sub-layer
𝑎 𝑙+1 =in𝜎(𝑊
tself. To facilitate these residual connections, all sub-layers 𝑙 𝑎 𝑙 +as𝑏 well
the model, 𝑙 ) as the embedding
ayers, produce outputs of dimension dmodel = 512.
Decoder: The decoder is also composed of a stack of N = 6 identical layers. In addition to the two
ub-layers in each encoder layer, the decoder inserts a third sub-layer, which performs multi-head
attention over the output of the encoder stack. Similar to the encoder, we employ residual connections
around each of the sub-layers, followed by layer normalization. We also modify the self-attention
ub-layer in the decoder
A NNstackconsists
to prevent of
positions from attending
addition, to subsequent
multiplication, and positions. This
a non-linear func-
masking, combined with fact that the output embeddings are offset by one position, ensures that the
tion
predictions for position i can depend only on the known outputs at positions less than i.
3.2 Attention
An attention function can be described as mapping a query and a set of key-value pairs to an output,
where the query, keys, values, and output are all vectors. The output is computed as a weighted sum
3
454 27 Analog Neural Networks and Translinear Circuits
𝑤 𝑤12 ... 𝑤 1𝑛 𝑥1 𝑏1
© 11
𝑤21 𝑤22 ... 𝑤 2𝑛 𝑥2 𝑏2 ®
ª
y = 𝜎 . .. .. .. . + . ®
.. . . .
.. .. ®
®
« 𝑚1 𝑤𝑚2
𝑤 . . . 𝑤 𝑚𝑛 𝑥 𝑛 𝑏 𝑚 ¬
!
𝑅−1 X
X 𝑆−1 X
𝐶−1
OA(𝑥,𝑦,𝑘) = 𝑓 IA(𝑥+𝑖,𝑦+𝑗,𝑐) × 𝑊(𝑖,𝑗,𝑐,𝑘)
𝑖=0 𝑗=0 𝑐=0
Assume N neurons
Wil
91
win
win
yu
wan
𝑉1 + 𝑉2 + 𝑉3 + 𝑉4 = 0
456 27 Analog Neural Networks and Translinear Circuits
Addition
Vo V V2 V3
V1 V2 V3
a
a a
a
Is current law
27.0.2 Kirchoff’s
Is IY I ILE
The algebraic sum of currents in a network of conduc-
tors meeting at a point is zero
I
MAC
Io
M
vs
m
get
𝑖1 + 𝑖2 + 𝑖3 + 𝑖4 = 0
457
Is
Is IY I ILE
MAC
See Charge concervation on Wikipedia
Ci 2 03
Qy V4
V3
Q VIC qucY 03036
Io
a a M a a
vs
m
get
𝑄4 = 𝑄1 + 𝑄2 + 𝑄3
27.1 Multiplication
𝐶1 𝐶𝑁
Is 𝑉𝑂 =
𝐶𝑇𝑂𝑇
𝑉1 + · · · +
𝐶𝑇𝑂𝑇
𝑉𝑁
Is IY I ILE
Make capacitors digitally controlled, then
𝐶1
𝑤1 =
𝐶𝑇𝑂𝑇
27.1.2 Mixing
MAC 𝐼 𝑀 1 = 𝐺 𝑚 𝑉𝐺𝑆
𝐼 𝑜 = 𝐼 𝑀 1 𝑡 𝑖𝑛𝑝𝑢𝑡
Io
M
vs
m
get
27.1 Multiplication 459
10 3
i(vcur)
10 4
10 5
10 6
10 7
10 8
10 9
𝑊 −𝑉𝑡 ℎ /𝑛𝑈𝑇
𝐼 = ℓ 𝑒 𝑉𝐺𝑆 /𝑛𝑈𝑇 , ℓ = 𝐼𝐷 0 𝑒
𝐿
𝐼
𝑉𝐺𝑆 = 𝑛𝑈𝑇 ln
ℓ
Il Iz Is It
𝑉1 + 𝑉2 = 𝑉3 + 𝑉4
𝐼1 𝐼2 𝐼3 𝐼4
𝑛𝑈𝑇 ln + ln = 𝑛𝑈𝑇 ln + ln
ℓ1 ℓ2 ℓ3 ℓ4
460 27 Analog Neural Networks and Translinear Circuits
𝐼1 𝐼2 𝐼3 𝐼4
ln = ln
ℓ 1ℓ 2 ℓ 3ℓ 4
𝐼1 𝐼2 𝐼3 𝐼4
=
ℓ 1ℓ 2 ℓ 3ℓ 4
𝐼1 𝐼2 = 𝐼3 𝐼4 , if ℓ 1ℓ 2 = ℓ 3ℓ 4
𝐼1 𝐼2 = 𝐼3 𝐼4
𝐼1 = 𝐼 𝑎 , 𝐼2 = 𝐼 𝑏 + 𝑖 𝑏 , 𝐼3 = 𝐼 𝑏 , 𝐼4 = 𝐼 𝑎 + 𝑖 𝑎
𝐼 𝑎 (𝐼𝑏 + 𝑖 𝑏 ) = 𝐼𝑏 (𝐼 𝑎 + 𝑖 𝑎 )
𝐼 𝑎 𝐼𝑏 + 𝐼 𝑎 𝑖 𝑏 = 𝐼𝑏 𝐼 𝑎 + 𝐼𝑏 𝑖 𝑎
𝐼𝑏
𝑖𝑏 = 𝑖𝑎
𝐼𝑎
ℓ 1ℓ 2 = ℓ 3ℓ 4
𝑊 −𝑉𝑡 ℎ /𝑛𝑈𝑇
ℓ1 = 𝐼𝐷 0 𝑒
𝐿
𝑎 𝑣𝑡
𝜎𝑡 ℎ = √
𝑊𝐿
ℓ2 𝑎
± √ 𝑣𝑡 /𝑛𝑈
= 𝑒 𝑊𝐿 𝑇
ℓ1
[Link] Demo
JNW_SV_SKY130A
27.2 Want to learn more? 461