EECS 373 - Fall 2026 - Lecture 15: "DACs" — Transcript
Full transcript
- 0:00All
- 0:02right.
- 0:12All right, we're going to get started.
- 0:14Let's see here.
- 0:17All right, so
- 0:19I talked to almost all of you. 30 groups
- 0:21is a lot. We saw some more
- 0:23group discussions to go through,
- 0:26but because we changed schedule around a
- 0:28little bit
- 0:30Project
- 0:31revisions are due on Friday. Please
- 0:34label your revised project proposal as
- 0:37revision so we can look at the delta
- 0:39between the first and the second. You're
- 0:40only really graded on the second and
- 0:42really the purpose of the project
- 0:44proposal is to force you to think
- 0:46through all the pieces of your project
- 0:50and kind of get your head around the
- 0:51scope.
- 0:52The thing I want you all to think about
- 0:54in the like the next week or so is
- 0:57and maybe next two weeks is really you
- 0:58need to
- 0:59You have a very vague notion of some
- 1:01aspects of your project and you need to
- 1:02start getting line of sight on them and
- 1:04understanding how complicated they are.
- 1:07How does it really work? If you can't
- 1:09gauge how much work is ahead of you,
- 1:11you're in a lot of trouble. So if maybe
- 1:13you have lots of questions about how
- 1:15your wireless module is going to work
- 1:16and it feels like a opaque black box and
- 1:18it's horrible, right? Like it's just
- 1:19complete unknown. You don't know
- 1:21anything about RF, well start doing some
- 1:23research online, get the parts, go talk
- 1:25to James, go talk to me or the IAs and
- 1:28get that information so it's not
- 1:29overwhelming so you know like how much
- 1:31work is it going to take to get that
- 1:33done.
- 1:34I worry when there's unknowns in your
- 1:36mind and then you get to like a week
- 1:38before the deadline and you just haven't
- 1:39even started it. That's usually a recipe
- 1:41for disaster.
- 1:44Okay.
- 1:46Oh, anyways, yeah. So the revised
- 1:47version put it in your project folders.
- 1:50Homework 7 is due on Monday. It's going
- 1:52to be on DAX.
- 1:56And then the homework solutions for
- 1:59homework 7 were released today and
- 2:00there's um
- 2:02uh practice exams online uh right now.
- 2:06And we have our fi- second fi- or second
- 2:08midterm uh next week, so a week from
- 2:11Friday in Dow. I promise I will actually
- 2:15check it to see if you can complete it
- 2:17on within the scope of the time.
- 2:19I'll even ask other people to check it.
- 2:22I mean we all uh
- 2:24uh not all the IAs got to look at it,
- 2:25but me and um
- 2:26James did and uh I think we just made it
- 2:29a little bit too long.
- 2:30Uh it's going to be the same kind of
- 2:31format. You'll get a data sheet, maybe
- 2:33that Wednesday beforehand. We'll have a
- 2:35review time in class where we'll go over
- 2:38the data sheet. We'll do a review of the
- 2:39exam. So, it shouldn't be very different
- 2:42from what you're already seeing um
- 2:46uh on your practice exams.
- 2:47Any questions so far?
- 2:53Uh and then next week after the exam,
- 2:55we're going to do student presentations,
- 2:57so there's documentation should be
- 2:58posted online. Um basically, these are
- 3:01you will come up for
- 3:03haven't figured exact time, but say 12
- 3:05to 15 minutes. Your team will talk about
- 3:07some piece of technology. So, this is an
- 3:08opportunity for you to deep dive, learn
- 3:11about some piece of embedded systems,
- 3:12then you will present to the rest of the
- 3:13class, so the rest of the class will
- 3:15learn about uh that piece of embedded
- 3:16system. So, an example would be how does
- 3:19XB work? So, a lot of people have
- 3:20wireless on their uh projects. Uh so,
- 3:23having a team describe how to interface
- 3:26with XB and get it working is benefit
- 3:28for the entire group or of entire class,
- 3:30so we'll probably have that team go
- 3:31earlier. And if it's I know there's a
- 3:33team that's going to use like a magnetic
- 3:35strip reader. Not many people are going
- 3:36to use that. It's still good knowledge
- 3:37to know, so we'll probably have that
- 3:39person go in the end. So, it's twofold.
- 3:41First, it helps you as part of your
- 3:43program requirements, uh present, uh you
- 3:45know, get feedback on presenting skills.
- 3:47Um it also helps teach the rest of the
- 3:49class about some nuanced piece of
- 3:52hardware.
- 3:53Um I typically assign topics based on
- 3:57your project proposals trying to load
- 3:58balance across um
- 4:01uh
- 4:02you know, all the teams not everybody
- 4:04can obviously do wireless, uh but try
- 4:06and load balance against the projects.
- 4:08Um
- 4:10if you're if you get assigned a topic
- 4:12and it seems completely weird, like
- 4:13that's not part of your project, just
- 4:15let me know.
- 4:16And then I and James will do practice
- 4:18presentations with you. We you'll come
- 4:19for like 15 minutes and just give it
- 4:21give it a practice talk and we'll give
- 4:23you feedback on like how to improve it,
- 4:25uh how to make it better for a general
- 4:26audience, all those sorts of things.
- 4:28And then while you're doing practice
- 4:30talks, man you know,
- 4:32uh attendance is required and you will
- 4:34be your there will be a peer grading
- 4:36component to this. Well, people will be
- 4:37voting, ranking, and those sorts of
- 4:39things and giving feedback. Um
- 4:42yeah, any questions?
- 4:48Oh.
- 4:49Okay.
- 4:51And so as you can see, we're getting to
- 4:52the end of the semester. Things are
- 4:54going to change, so we got our midterm
- 4:55coming up next week.
- 4:57Do a little bit of PCB design, some
- 4:59extra work, and then it's student
- 5:00presentations. And then I'm not exactly
- 5:03sure when the presentations are going to
- 5:04start stop. I haven't uh filled out the
- 5:06entire schedule.
- 5:08But uh after at least after
- 5:10Thanksgiving, there's no formal class
- 5:12anymore. This is just dedicated time for
- 5:14you to uh do your projects. I have
- 5:17milestone meetings milestone meetings
- 5:19are typically
- 5:21uh by request. Either I'm requesting of
- 5:23you to come and talk to us, or you're
- 5:25requesting to meet with one of us um
- 5:27outside of like just uh catch James or
- 5:29the IAs in the lab. So those are not
- 5:31inherently mandatory for everyone.
- 5:34Um and then we have the expo is going to
- 5:36take it'll be outside of class time.
- 5:39Um like it'll be on that Wednesday, but
- 5:40because there are so many
- 5:42uh students this semester, it's going to
- 5:44have to start earlier and end later. You
- 5:46at least need to have somebody there to
- 5:48man your booth. I understand someone
- 5:49might have class at a different time.
- 5:51But uh that's what we're uh we're going
- 5:53to have to
- 5:54well, it's going to have to be outside
- 5:55of class time. We can't just completely
- 5:57limit it to class time.
- 5:59All right, any logistics questions?
- 6:06I'm not that well organized. You must
- 6:07have questions.
- 6:12Okay.
- 6:14All right. So, this set of lectures
- 6:16we've been talking about
- 6:18analog trying to get these analog
- 6:19signals into the digital world and vice
- 6:21versa. We've talked about analog signals
- 6:23in general and then ADCs and now we're
- 6:25going to talk about DACs, which are
- 6:26digital to analog converters. There's
- 6:29several different types and then the
- 6:30specific ones that you have on your
- 6:32device.
- 6:33Oh.
- 6:36Uh there's some good references.
- 6:38So, DACs, the equivalent mental model
- 6:40here is, you know, a function generator.
- 6:43This is going to be able to produce
- 6:45arbitrary waveforms. That's the goal
- 6:47under certain limitations. So, you want
- 6:49a device that is sure can do an like a
- 6:52digital value. Sorry, not digital value.
- 6:54Like a analog voltage value, but really
- 6:56it's more about doing time series
- 6:58things. So, can you make a sine wave or
- 7:00a square wave or a triangle wave or some
- 7:02arbitrary thing? And so, the function
- 7:04generator you have there is very um
- 7:07capable,
- 7:08but your little microcontrollers are
- 7:10also pretty capable in the sense that it
- 7:12can go up to several megahertz. This is
- 7:14maybe 20 megahertz is pretty standard
- 7:16for a cheap benchtop piece of equipment.
- 7:18And this one will go to like plus or
- 7:19minus 20 volts. Your little DAC will
- 7:21only go like plus or minus zero to three
- 7:24volts or 3.3 volts. So, different in
- 7:26range and you could probably adjust that
- 7:28if you had an amplifier on the output,
- 7:30but
- 7:31uh that is essentially what your
- 7:32microcontroller can do is arbitrary
- 7:34functions.
- 7:35Um and then there's lots of nuance about
- 7:37how to get that to work.
- 7:39Um the other alternative way of looking
- 7:40at this is just a just a speaker, right?
- 7:42So, when you think about
- 7:44uh you know, the headphone jack, all
- 7:46those jacks and microphone accessories
- 7:49on your consumer electronics are just
- 7:50highly optimized ADCs and DACs and
- 7:53usually they're optimized cuz they're
- 7:54trying to target specifically the audio
- 7:57band and how humans hear in
- 8:01uh sound. So, that that's slightly
- 8:02different than just an arbitrary
- 8:03function generator or arbitrary
- 8:06ADC.
- 8:08So, as you can imagine, we're
- 8:09essentially going to be doing the
- 8:10opposite of an ADC. Here, you're going
- 8:12to have some digital code, right? Some,
- 8:15uh, binary values that are going to, uh,
- 8:17be turned into an analog value. Now, it
- 8:19should be clear like this is just one
- 8:21point on that sine wave and you would be
- 8:23changing that bit value over time to
- 8:26approximate a sine wave. Uh, it's not
- 8:27that you just put one value like that
- 8:29binary code that yields a sine wave. Um,
- 8:32but that's the idea is you have some
- 8:34digital input it'll be turned into an
- 8:35analog output.
- 8:38Uh,
- 8:39yeah. Any
- 8:42questions?
- 8:44Okay. So, when we talked about, uh,
- 8:46ADCs, we had all these caveats about
- 8:49like, "Oh, we had the sample and hold
- 8:51circuit." We had to figure out why we
- 8:52wanted to have a sample and hold
- 8:54circuit. We talked about, "Hey, wait a
- 8:56second, if it's a really weak signal,
- 8:58right? Maybe it won't be able to charge
- 9:00up the input capacitor and we'd have to
- 9:01have special caveats for that." And then
- 9:04I said, "Oh, you know, maybe, uh, as I
- 9:06sample the thing, I'm going to have to
- 9:08hold it, uh, because the, um, the
- 9:12conversion process is going to take a
- 9:13while."
- 9:14Um, so we have those same sort of ideas
- 9:17related to, uh, DACs. So, one of them is
- 9:19loading effects.
- 9:21So, remember the DAC is trying to drive
- 9:23a signal outside of the device.
- 9:25And so, the way to think about loading
- 9:27effects here are just a simple voltage
- 9:29divider. Here, we have a a DAC module,
- 9:31has some finite resistance, and then you
- 9:34have a load that has some finite, uh,
- 9:36amount of resistance. And so, ideally,
- 9:38you would say that your, uh, DAC would
- 9:39have, uh, zero source resistance. That
- 9:42would be the best. And it's just not
- 9:43possible, but that's what you'd want.
- 9:45And you want your load resistance to be,
- 9:47you know, infinite, really, really high.
- 9:49And that would be nice, uh, and then
- 9:50whatever voltage you put out on the V
- 9:52desired would be the voltage output. You
- 9:54can you can look at the math there and
- 9:56figure that out. Um, but the reality is
- 9:58that, uh, the load is not going to be
- 10:01finite. It's going to be some value and
- 10:03it could be capacitive or inductive,
- 10:04which would also create, uh, challenges.
- 10:06So, can you guys take like 30 seconds
- 10:09and tell me what are some what are some
- 10:11things that have uh standard loads or
- 10:13even hard loads to drive?
- 10:16Take Take 30 seconds, talk amongst
- 10:17yourself.
- 10:31>> [clears throat]
- 10:42[clears throat]
- 10:55>> What do you think? What would be a load
- 10:57that you'd have to drive typical
- 10:58embedded systems with a DAC?
- 11:07Yeah.
- 11:08Speakers. What's the resistance of a
- 11:09speaker typically?
- 11:164 8 ohms. Yeah, so 8 16. Depends like
- 11:19home speakers for some reason I think
- 11:20are like 8 and like car speakers are 16
- 11:22or something like that. Maybe it's 4 and
- 11:248. Like you know, it's kind of
- 11:26surprising. Why are they so low? Well,
- 11:28they're actually inductors.
- 11:29Uh there's inductive mode There's an
- 11:30inductive element that's trying to push
- 11:32this uh magnet back and forth.
- 11:34Um what are some But that's really
- 11:36small, right? So, if you have 8 here and
- 11:38anything over there, right? You're going
- 11:40to get a
- 11:41anything even high, you're going to get
- 11:43something less than your desired
- 11:44voltage. Now, you're going to have to
- 11:45have some amplification. So, imagine
- 11:47here that our load is very a small
- 11:49number. Uh
- 11:51So, okay. So, some standard loads like
- 11:53just even a GPIO pin on a
- 11:55microcontroller is like 100k.
- 11:57Um which is not that bad, but if you're
- 12:01trying to do some exact measurement,
- 12:02it's fine. Uh it can be a problem. A
- 12:05capacitor, anything with capacitance is
- 12:07hard.
- 12:08Um so, there's a lot of different loads
- 12:09that could be a problem.
- 12:12And so, the way to get around that
- 12:14is
- 12:15um you can use a voltage buffer. So this
- 12:17is kind of like the same topology that
- 12:19you saw inside a um
- 12:23uh
- 12:24the sample and hold circuit. It's just
- 12:26that here we're trying to buffer the
- 12:27output. So whatever is there on our
- 12:29source is that input into V V in is very
- 12:32very small. So the desired
- 12:35the drop is going to be zero or nearly
- 12:37zero cuz there's no current going
- 12:39through R0. And then the op-amp is
- 12:41taking the responsibility of driving as
- 12:43much current as required to drive that
- 12:45load. So here aside from the
- 12:48inaccuracies in the op-amp um
- 12:51uh you're going to get V out is going to
- 12:52be the same as V in or V desired. So
- 12:55that's a that's the value of that.
- 12:58And so we can look at this in like a
- 12:59little circuit example here.
- 13:03Let's see.
- 13:06All right. So here I'm going to vary
- 13:08these little sliders, vary the value of
- 13:10these resistors. Is that true?
- 13:13No. Wait. No, for some reason I'm
- 13:15varying RS. I don't like that.
- 13:18Mhm. Well, that gives you example here.
- 13:20Let's try and do this.
- 13:23Uh slider.
- 13:30All right.
- 13:33It did not work. Oh, there we go. Okay.
- 13:36R load for both of them. So here as I
- 13:38change the resistance you can see that
- 13:39this voltage no matter what this
- 13:40resistance is is always five and that is
- 13:43going to be some other value. So here is
- 13:44this you can see here's the challenge
- 13:46and it gets much worse if you're trying
- 13:47to do like an AC signal into a DAC or
- 13:51into a capacitor. You get some weird
- 13:53effects or an inductor.
- 13:56Okay.
- 13:57Any questions on why you would need a
- 13:58voltage buffer for an output?
- 14:02Is this you people you guys remember
- 14:03this from 215?
- 14:05Does this seem like intuitive knowledge?
- 14:09>> [snorts]
- 14:10>> No? You guys Yeah.
- 14:12Go ahead.
- 14:12>> Yes, sir.
- 14:14What's the reason that we just don't
- 14:15make the
- 14:16uh load very high
- 14:20>> You don't have that option. You're
- 14:22trying to drive some load. So, if it's a
- 14:23speaker, right? Um it could be 8 ohms.
- 14:26You don't have a choice.
- 14:28Um if you were trying to drive like uh
- 14:31you don't really drive motors this way,
- 14:32but I mean technically you could.
- 14:34There's a lot of weird
- 14:35um
- 14:36things. I don't know why I can't think
- 14:37of any, but like a piezoelectric speaker
- 14:39is like is a high impedance thing, but
- 14:41slightly capacitive. And then you get
- 14:42some a loading conditions.
- 14:45Um
- 14:47You could even think of like an LED if
- 14:48you're trying to do dimming an LED with
- 14:50voltage, which is probably the wrong way
- 14:51to do it. You would still have some load
- 14:53on that that would uh change the output
- 14:55voltage.
- 14:59Yeah.
- 15:06Correct.
- 15:08Right. That's true. I forgot to tell you
- 15:09why we care. I just started I I just
- 15:12knew I cared. I forgot to tell you why.
- 15:14We're going to spend the rest of lecture
- 15:15trying to make our desired or the output
- 15:18of this
- 15:19uh thing right here. We're going to
- 15:20figure out all these fancy ways to make
- 15:22this analog voltage, but then I don't
- 15:24want to get corrupted by my load. So,
- 15:26that's why we're putting this buffer in
- 15:27between.
- 15:30It's a good question.
- 15:32Okay.
- 15:36All right, there's loading effects. So,
- 15:37let's talk about like the simplest
- 15:40uh possible analog output. In fact, you
- 15:42don't even need a full DAC for this. And
- 15:44this is a great way if you just need to
- 15:46like add a buzzer to your to your final
- 15:49project. You're like, "I just need a few
- 15:51extra points. I don't want to put time
- 15:52and effort into this. I just want to get
- 15:54points as fast as possible." This is a
- 15:55way to do it.
- 15:57You don't even need a DAC.
- 15:59Uh like the full DAC on your device, but
- 16:01it still is a version of getting an
- 16:02analog output.
- 16:05So, imagine you have a GPIO pin and
- 16:06you're just going to put PWM signals
- 16:08through. You can see here this is like
- 16:10an RC filter. And so, the idea here is
- 16:12that you're going to smooth out the um
- 16:16the high frequency components, leaving
- 16:18only the low frequency components. And
- 16:20then you will get over time, you will
- 16:22get an analog output on average. And so,
- 16:26um, it would turn into something like
- 16:27this. This would be a better example
- 16:29where I have a bit stream going out and
- 16:31then this is the filtered version. And
- 16:33you still get some distortion because
- 16:35basically there's an RC discharge going
- 16:37on here. And so you're charging up and
- 16:38discharging. But by varying the duty
- 16:41cycle, uh, you will be able to uh,
- 16:44create a very high value or a low value.
- 16:48So let's see an example of that.
- 16:52Uh, here.
- 16:56All right. So here is this something
- 16:57that makes a square wave or a uh, that
- 16:59we can change the duty cycle on. And
- 17:01then this is just an output buffer just
- 17:02to show that that exists. I didn't put a
- 17:04load resistor on there. And here's the
- 17:06filter.
- 17:07And so if I change Oh, and then down
- 17:09here we can see the red lines are the
- 17:12output of the the PWM pin.
- 17:15Let's say. And then this is Let's see
- 17:17what's over here. And this is the blue
- 17:19line down there is the analog output
- 17:21voltage. As I changed my duty cycle,
- 17:25you can see that on average that value
- 17:27raises and lowers.
- 17:29So here, now I have a higher value. And
- 17:32this is all I did was change the duty
- 17:33cycle of something and now I have a
- 17:34different analog value. And the reason
- 17:37we have the buffer on there is because I
- 17:38put any load on the output, right? It
- 17:40would that resistor that 5K resistor is
- 17:42very large. So I get a big voltage drop.
- 17:45And so this is like a very cheap way to
- 17:46make an analog signal.
- 17:50And so, that some of the challenges with
- 17:51this version here is that
- 17:54um, it's actually fairly slow in a sense
- 17:56compared to your clock. It makes it have
- 17:58to have multiple clock wave signals to
- 18:01change this. So compared to something
- 18:02that would maybe in one clock cycle be
- 18:05able to produce an analog output, this
- 18:07is particularly slow way of doing it.
- 18:09Um, and there's a lot of there's ripple
- 18:11on it. And it's hard to reduce that
- 18:13ripple under all conditions. Maybe
- 18:14certain certain frequencies,
- 18:17uh, you could do it well, but certainly
- 18:18not all possible scenarios Can you get
- 18:21rid of that signal?
- 18:26Any questions here?
- 18:33So
- 18:34a piezoelectric buzzer would be a great
- 18:35example here and you'll you won't get
- 18:37high fidelity sound but you'll certainly
- 18:39get buzzers and tones if you needed to
- 18:41indicate something.
- 18:42Uh
- 18:44yeah.
- 18:46Okay.
- 18:48All right, so that's like the simplest
- 18:49way and then we can go to some of the
- 18:51more classic ways of making um
- 18:55uh resistors. Uh I mean
- 18:58DACs. So oops, let's go this way. So the
- 19:03resistor um resistor voltage divider is
- 19:06kind of like the flash ADC. It's kind of
- 19:08the inverse. So here we'll have a
- 19:11voltage ladder and this produces all the
- 19:14possible voltages. Now if you remember
- 19:16back to the ADC version this voltage
- 19:18ladder was the references, right? This
- 19:20was
- 19:21if you had a voltage of this particular
- 19:23value you would compare and see if you
- 19:26were higher and lower and that would
- 19:27produce the output. Here you have a
- 19:29voltage ladder and then you're selecting
- 19:31which one of those voltages voltage do
- 19:33you want to have on the output.
- 19:35So we can take a a look at that.
- 19:39Oops.
- 19:47Uh so here we're just going to
- 19:49have a binary selection. This is
- 19:51the last version I showed you before it
- 19:53was there's no decoder but this
- 19:55structure essentially makes
- 19:56encoder let's say that we can use to
- 19:59change my take the binary value into
- 20:01like
- 20:03um
- 20:04one hot encoding space.
- 20:06And so here I can change like if I have
- 20:08all the switches are low then I'm
- 20:11connecting the bottom thing and you see
- 20:13it's like negative nano volts. That's
- 20:14just be as kind of maybe the error and
- 20:16false start but should be effectively
- 20:19zero and nano volts is zero and then
- 20:21here I can add in let's do the lowest
- 20:23bit. I don't know this is the lowest
- 20:24bit. And then I can add in particular
- 20:27things in here. Multiple things are
- 20:28being switched in at once, but then
- 20:29these outputs are actually uh deciding
- 20:31what goes in. And so now I can hit my
- 20:33binary value to hit any one of these
- 20:36three-bit values here.
- 20:38And basically all you're just doing is
- 20:39having a switching network that selects
- 20:42the voltage is already here.
- 20:47What questions you have?
- 20:53Why don't you take a a couple minutes or
- 20:55a minute to talk amongst yourselves
- 20:56about the pros and cons and reflect upon
- 20:59the pros and cons of a flash ADC and see
- 21:01if those kind of cuz this is like the
- 21:03mirror image of a flash ADC. So like
- 21:05what are the pros and cons of this
- 21:06particular topology?
- 21:15>> [clears throat]
- 21:38[snorts]
- 21:56>> You guys are quiet.
- 21:58Normally if I give you a chance to talk
- 21:59like you you can't stop. You're excited
- 22:01to talk to each other.
- 22:03Like no.
- 22:07All right, what's what's the one
- 22:08advantage of this uh style compared to
- 22:12uh well I have you haven't seen any
- 22:14other ones. You saw one other one. So
- 22:15what's the advantage compared to the
- 22:16other ADC that or DAC that you saw?
- 22:26Yeah.
- 22:28Very fast. You call it a flash
- 22:30DAC if you want, nobody calls it that,
- 22:31but it's called a R RC ladder. Um
- 22:35Uh but yes, it's very flat fast. So this
- 22:37because, you know, all the values here
- 22:40are instantly available and all you have
- 22:42to do is switch between them. There's
- 22:44not even um
- 22:45uh just switching delay. There's no
- 22:47other um there's no comparators even
- 22:50involved. So it's actually pretty um
- 22:54power or you don't have the power
- 22:55consumption of the comparators, just of
- 22:57the uh resistor ladder.
- 22:59What else? What are some other uh what's
- 23:01the disadvantage?
- 23:04Yeah.
- 23:09Yeah, so um it's it's it's typically
- 23:12more like it wasn't manufactured
- 23:14correctly, that's typically what it is.
- 23:16And it it still remains hard to get all
- 23:18those uh voltage steps to be perfectly
- 23:20accurate. Maybe only with eight
- 23:22resistors it's not that big a deal, but
- 23:23you know, if you had um you know, 32 or
- 23:26128 resistors, okay, it's going to get a
- 23:28little bit harder. And so you imagine
- 23:30that if one of them was 99, that means
- 23:32that little step or you you know, even
- 23:34smaller, that little step is going to be
- 23:35slightly different, right? That little
- 23:37uh step from one binary value to another
- 23:40binary value, that that voltage step
- 23:42would be smaller than you would expect
- 23:43or could be larger. So that's that's the
- 23:45challenge. Any other advantages or
- 23:47disadvantages?
- 23:52Yeah.
- 23:55That's probably higher power
- 23:56consumption. I guess we didn't really
- 23:57talk about we don't have much to give it
- 23:59an example to, but yeah, you do have to
- 24:01have um this voltage ladder going, which
- 24:03may be not that bad um because there's
- 24:06no other switches or anything. I mean,
- 24:07the switches are pretty minimal, but
- 24:09they aren't like comparators and stuff,
- 24:10but it's not the cheapest. Uh it's
- 24:12probably also pretty large on silicon.
- 24:15Uh a non-obvious problem and probably a
- 24:18problem most embedded people wouldn't
- 24:19consider because either it's already in
- 24:21your microcontroller and you don't care
- 24:22how much how big it is or uh you're
- 24:25buying an external module and the size
- 24:26doesn't matter. But I think that would
- 24:27proportionally say that this topology
- 24:29could be expensive in this in a sense
- 24:31that
- 24:32uh it takes up more area and the area of
- 24:34your silicon is the the forcing function
- 24:36for cost.
- 24:39I don't know. What else is there?
- 24:40Complexity is relatively simple. There's
- 24:42not much going on here. So, that's nice.
- 24:48Okay.
- 24:49Uh
- 24:50let's see.
- 24:53Okay. So, one of the challenge here the
- 24:55the challenges of this one is now we
- 24:57have to have um
- 24:59a switch for every particular value,
- 25:01right? So, what happens if you wanted to
- 25:03reduce the number of switches?
- 25:05Um so, we can think about some
- 25:08structures.
- 25:09Um you know, it would be more effective
- 25:11if we didn't have to do that binary
- 25:13encoding with those switches if we could
- 25:14just actually switch the voltage in. And
- 25:16so, we're going to use an analog
- 25:17structure to help us and that's the
- 25:19summing amplifier. Did you guys see
- 25:21summing amplifiers in 215? Those that
- 25:23took 215?
- 25:26Yeah. Okay.
- 25:28Um really remember this class you don't
- 25:30have to know anything about analog. I
- 25:31promise. You just have to have like
- 25:33basic intuitive knowledge. It sums some
- 25:35voltages. That's all this thing does.
- 25:37So, we'll see an example of how does a
- 25:38summing volt you know, amplifier sums
- 25:40some voltages? There's an equation here.
- 25:42It's a gain factor. And then uh the
- 25:45trick with this topology is that it
- 25:47gives a negative voltage output. We can
- 25:49assume that on your devices uh that the
- 25:52analog engineers have done a good job of
- 25:54actually producing a positive voltage
- 25:56output and all the inputs are going to
- 25:57be negative voltages. It's not that hard
- 25:59to do all that. It's just the extra
- 26:01circuitry to demonstrate that to you
- 26:02would be kind of hard. So, I won't do
- 26:04that. But, uh you can conceptually see
- 26:06how it would work.
- 26:07And so, here
- 26:09Uh wait a second. Where Oh, you're off
- 26:11to side. Why? Why?
- 26:17Come on. Pinch.
- 26:22Okay.
- 26:24Um okay. So, anyways, here
- 26:27Is there a
- 26:28view fit?
- 26:32I don't remember.
- 26:35I don't know. All right.
- 26:36Well, anyways, uh so here we have some
- 26:38two voltages and we have the output
- 26:40voltage and it's just a simply All
- 26:42right, so I change these two voltages.
- 26:44Um they happen to be negative in this
- 26:45example, so we get a positive output,
- 26:47but you can just see that they're
- 26:48summing them and here really the trick,
- 26:50the conceptual trick, is that the
- 26:52current being driven through this node
- 26:54here, we can add currents together
- 26:56easier than you can add voltages
- 26:58together. So, here we're going to sum
- 27:00these volt- these currents together. I
- 27:01have a current that's being defined
- 27:03going through uh resistor one and
- 27:05another current being defined going
- 27:07through resistor two. This node is
- 27:09always uh uh
- 27:12uh equal to zero. It's being trying to
- 27:13be driven to zero. And now this voltage
- 27:16uh divide or so this resistance divided
- 27:18by the voltage drop across here defines
- 27:20the current. So, as I increase my uh
- 27:23voltage, let's say
- 27:25or decrease my voltage
- 27:27uh in this particular case, but increase
- 27:28the voltage drop across this thing, more
- 27:32Oh, god, the whole time it was I was
- 27:34doing so good. I was just in there and
- 27:37it Oh,
- 27:38Jesus.
- 27:41Oh, man, I'm not going to be able to do
- 27:43that that good again.
- 27:45Oh, man.
- 27:48All right, thank you for letting me
- 27:49know. All right.
- 27:53One nice guy, the rest of you were like,
- 27:54let's see how far he can go.
- 27:57All right. Uh what I want to show you, I
- 27:59don't know. You guys have to imagine
- 28:00what I was talking about. Um
- 28:03Anyways, I changed this voltage in here
- 28:06and uh you can see the voltage out here
- 28:08is proportionally changing. Yes, it's
- 28:10negative, but we're going to ignore that
- 28:11fact for a second.
- 28:13And so it's doing the summing action and
- 28:15the trick, the conceptual trick, is that
- 28:17it's the current through here is the
- 28:19summation of the current going through
- 28:21here and here. And you could have n
- 28:23number of branches and so the voltage
- 28:25drop uh the voltage drop across this
- 28:27thing creates the current and now I can
- 28:30create different voltage drops because I
- 28:31can change these voltages.
- 28:34Let's see like that. And now we see that
- 28:36it's pulling more current as I increase
- 28:38this current as I increase this voltage
- 28:40here or increase the voltage drop, I'm
- 28:42pulling more current. Yeah, you can see
- 28:44that there. And so now that value is
- 28:47larger. So we're going to sum the
- 28:49currents together. That's the the trick.
- 28:50That's all you have to remember. This
- 28:52allows you to have voltage that sums the
- 28:54current.
- 28:56All right.
- 28:58What questions you have?
- 29:03Okay.
- 29:06Yeah, ch-ch-ch. So now we can take
- 29:08advantage of that. So here this is the
- 29:10R2R ladder. Basically, the idea is we
- 29:13want to have a voltage ladder that idea
- 29:17but instead of having lots of switches
- 29:20or instead of having lots of switches,
- 29:22we want to minimize the number of
- 29:23switches. Um and there's good reasons
- 29:26for that as well. And so here what we're
- 29:28going to do is we're going to use these
- 29:30to create different currents of
- 29:32different proportions. And so uh by
- 29:35sizing them correctly so we have the
- 29:36first ladder, all those are R uh value R
- 29:40and it could be any value R per se, but
- 29:43say it's like, you know, a kiloohm. And
- 29:44then all the resistors in this part are
- 29:472R. And so making resistors that are
- 29:51uh matched is easier than making
- 29:53infinite number of values. And then
- 29:55things that are double are easy because
- 29:57in layout you would just double the
- 29:59resistance or double the stack that you
- 30:00would come up and come down. And so now
- 30:03you basically have two resistors of R
- 30:05size just linked together. And so now
- 30:07these are still structures that are
- 30:08pretty good at being the same size,
- 30:10which is nice when you're manufacturing.
- 30:12The the the errors are a little bit more
- 30:14tolerable. And so now they're going to
- 30:16produce different currents through here
- 30:18and then we're going to
- 30:19uh sum those switches together. So for
- 30:21example, you're going to see here this
- 30:22would be half the current, quarter the
- 30:24current, eighth, and a 16th. And then
- 30:26you can walk through this math to kind
- 30:28of figure out, okay, I can switch those
- 30:30in. So here's the switching factor say
- 30:31they're one or zero. And then that's
- 30:33going going added into my summing
- 30:35amplifier, which will pull current in
- 30:37through here.
- 30:39Okay?
- 30:42Now, I won't make the same mistake.
- 30:44Okay.
- 30:49So, here is that voltage ladder. Uh here
- 30:52is 50k and 100k, doesn't really matter.
- 30:54And as you can see, there's actually no
- 30:56current going through here cuz
- 30:57everything's disconnected. And if I go
- 30:59to one of the smaller bits here, I get a
- 31:02small amount of current coming through.
- 31:04And you could do it binary style. You
- 31:06could go one at one at a time.
- 31:08But then you can also do um
- 31:11do them together. So, here this is like
- 31:13a full one, I get -8, and then I can do
- 31:15a next one, get 12. And so, now this
- 31:18summation of this current coming through
- 31:20here
- 31:21is what's happening. So, it's really
- 31:23each one of these paths, I don't know if
- 31:25you can see it. Yeah, I can see these
- 31:26current kind of creeping through. So,
- 31:28that's uh the flow you see is
- 31:30proportional to how much current there
- 31:32is.
- 31:33And um
- 31:35you can see this one is
- 31:36approximately twice as much as this, and
- 31:38onward and upward. And so, this is the
- 31:40way that I can eliminate the number of
- 31:42switches and have slightly less
- 31:44resistors to get a analog uh voltage
- 31:47output.
- 31:52Yeah.
- 31:54Sure.
- 32:03Yeah, you just put some voltage up here,
- 32:05you mean?
- 32:06Yeah, you just put some voltage.
- 32:13Sorry. This This one?
- 32:21Yeah, I think that is saying Wait,
- 32:23that's a good question. So, where So, IR
- 32:26is
- 32:29How does IR get in here? So, this is the
- 32:31quarter, half,
- 32:32uh eighth.
- 32:36I think IR is this value Oh, no, this is
- 32:38just a constant, I think, that is in
- 32:40that formula. I'd have to look through
- 32:41that.
- 32:42Did that answer your question? Not
- 32:43really.
- 32:46Yeah, I mean, it's just the voltage that
- 32:48would be coming through
- 32:51So, what IR So, how do you How is IR
- 32:53defined in this equation? I I can't
- 32:54really see.
- 33:00Yeah, but there's like this constant
- 33:01offset. I'm just trying to figure out
- 33:03IRS. This is a good point. Let me Maybe
- 33:06this diagram doesn't match this math.
- 33:08Maybe that's the problem. Maybe in this
- 33:09particular diagram there is this that is
- 33:12not here. You could have a line that
- 33:14comes directly to a switch and it's not
- 33:16divided.
- 33:18Um
- 33:19So, yeah, maybe that's wrong. Okay, I'll
- 33:21look at that. That's good good question.
- 33:23Yep.
- 33:24Oh.
- 33:27All right, so why don't you take a
- 33:28minute and talk amongst yourselves.
- 33:30What's the advantage or disadvantage of
- 33:32this one compared to the other op amps
- 33:34or sorry, DACs that you've seen?
- 34:43>> Mr. Harris
- 35:07>> All right, what do you think? What are
- 35:08some advantages or disadvantages of this
- 35:11particular topology?
- 35:18Yeah.
- 35:27Uh
- 35:28so, it's expensive to do this because of
- 35:29the size of the resistors, you said?
- 35:34Yeah. Yeah.
- 35:35Yeah.
- 35:36Um is it worse in terms of resistors
- 35:39than it than the for the number of bits
- 35:41than the ladder that we saw last time?
- 35:46I think it's slightly better. It's not a
- 35:48magically better. Slightly better.
- 35:52Okay.
- 35:54What are some
- 35:55um advantages or disadvantages? Anything
- 35:58else?
- 36:00Yeah.
- 36:07Yeah.
- 36:11Yeah, and it's always in comparison to
- 36:13other things. So, like all of them you
- 36:15need to add more resistors, right? So,
- 36:16like but there is uh inherent issues
- 36:19with uh some topologies, right? That you
- 36:21to get to higher and higher DACs is
- 36:22going to take uh be challenging.
- 36:25Um and it's also the same for um higher
- 36:28bits for ADCs.
- 36:29What's some What's an advantage of this
- 36:31one?
- 36:36Yeah.
- 36:37>> We were saying that the growth is kind
- 36:39of exponential, though.
- 36:41For every stage of the ladder that you
- 36:43add, like you double the number of bits
- 36:46that you can represent. Like with one
- 36:49more switch, that's one more bit, which
- 36:51means that you can
- 36:52double the information.
- 36:55So, I think that, you know, in
- 36:57comparison to just the
- 36:58resistive ladders I talked about before,
- 37:00this is a lot
- 37:02clearer. We're going to have a much
- 37:03higher performance.
- 37:04>> Right. So, that is the advantage. The
- 37:06the penalty is that there's some
- 37:08issues here with you might have less
- 37:11linearity because now you have to have
- 37:13resistors of different sizes.
- 37:15Um
- 37:16one of the advantages here is still
- 37:18pretty fast.
- 37:20Um we didn't There All the topologies
- 37:22are actually going to be uh relatively
- 37:24fast, but there's not it's not like the
- 37:26you need a lot of acquisition time like
- 37:28you needed with the SAR ADC where you
- 37:30had to like search for something. That's
- 37:32not usually how DACs work.
- 37:35Okay.
- 37:39Uh
- 37:40okay. And then uh the next one is the
- 37:42binary weight uh uh resistor D uh DAC.
- 37:47So, this is very similar to the one we
- 37:48just saw. So, I think the topologies are
- 37:51kind of confusing.
- 37:52Um so, here, let's see here. So, the
- 37:55voltage was here and then you went
- 37:56through a resistor network and then you
- 37:58had switches. Not drawn exactly the
- 38:00same. Here, you have switches, then a
- 38:02resistor network, and then you have your
- 38:04output stage. So, slightly switched
- 38:06things around. Here, the trick though is
- 38:09I have resistors of different values.
- 38:11Every resistor is a different value.
- 38:13Now, it's nice that they're uh you know,
- 38:15multiples of two of each other. That
- 38:17makes the layout easier and you can
- 38:19imagine for for reasons of binary that
- 38:21that's good. Um but, that does mean that
- 38:25um
- 38:26a small error may not be
- 38:29uh
- 38:30will be passed on to multiple things,
- 38:32right? So, let's say the R over 2
- 38:34resistor is slightly smaller,
- 38:36disproportionate
- 38:37uh than the rest of them. That means
- 38:39that and we're going to reuse that for
- 38:41every one of the smallest bits. So, you
- 38:42now you're going to get more error as
- 38:44you um in every one of your codes or
- 38:47every fourth code I guess because that
- 38:50thing is going to be maybe slightly
- 38:51different slightly weird.
- 38:53So that that is one of the challenges.
- 38:54It's more less tolerant to manufacturing
- 38:57defects, but it's much smaller which is
- 39:00the benefit.
- 39:01So let's see.
- 39:06And you can imagine this not too
- 39:08surprising again. This is just
- 39:10making different ways to pull current
- 39:12through this node and we just generated
- 39:14different ways of making current come
- 39:16through these resistors. And so here I
- 39:19have my switch. Hey, why are you doing
- 39:20that?
- 39:22And I'm just basically switching on and
- 39:23off these resistors, but because they're
- 39:25all a different proportion of current
- 39:27coming through them.
- 39:29I get the benefit here of being able to
- 39:31create binary values and or use turn
- 39:34them on simultaneously so I can put a
- 39:36binary code in here to turn these things
- 39:38off and on.
- 39:40>> [clears throat]
- 39:41>> Okay.
- 39:44What questions do you have?
- 39:53And here we just
- 39:54it doesn't matter if this is inverted or
- 39:57this is positive like there's lots of
- 39:58ways to make the chip in this particular
- 39:59one I just said the input was a negative
- 40:01reference voltage which it produces a
- 40:03negative or positive output voltage. So
- 40:05take 30 seconds and kind of talk about
- 40:08what's the advantages and disadvantages
- 40:09of this one.
- 40:35>> [snorts]
- 40:50>> Today is the
- 41:06>> [clears throat]
- 41:14>> All right, so we already know this one's
- 41:15going to be fast. They're all fast. More
- 41:18or less. I mean, we'll talk about in
- 41:19real world ones their settling time and
- 41:22your back on your device has speed
- 41:25limitations. So, as we go to the extreme
- 41:27of speed
- 41:28different issues come up. Um but not
- 41:31from the first order. So, this is just
- 41:33as fast as the rest of them cuz you take
- 41:35a switch in one time second or one
- 41:38clock cycle and then you get the value.
- 41:40But, what are some advantages or
- 41:42disadvantages?
- 41:53Yeah.
- 41:54>> One thing that we're talking about is
- 41:55that it might be easier to order a lot
- 41:57of resistors in bulk, which would occur
- 41:59in the UGB that we saw
- 42:01>> Mhm.
- 42:02>> like, you know, for each stage you have
- 42:04like a different resistor value. With
- 42:07each stage you just buy one of the same
- 42:08resistor.
- 42:10That was one of the ideas.
- 42:12>> That's a That's a interesting point of
- 42:14view. Um and we just to be clear, you
- 42:16should never build one of these by hand.
- 42:18That would be an insane process.
- 42:20Um
- 42:22And maybe there's I could maybe that if
- 42:24you want to make a really simple one,
- 42:25there could be a value in making one on
- 42:26a PCB. But, these should all be done in
- 42:28silicon. Um but, your idea of like, I'm
- 42:32going to buy in bulk still applies in
- 42:33the sense that it's much easier to make
- 42:35one resistor value over and over and
- 42:37over again to make n resistor values.
- 42:40Um but, as a side note, when you are
- 42:43buying components one day out there and
- 42:44you're buying for your board,
- 42:46uh
- 42:47your manufacturer's going to specify a
- 42:49tolerance range and you'll find that
- 42:52within one batch the tolerance range is
- 42:54usually smaller than across batches. So,
- 42:58if you're trying to make sure that you
- 42:59have matched resistors from you have n n
- 43:02instances of your product and you want
- 43:03to make sure that they're as close to
- 43:04the same getting the same batch
- 43:06resistors actually usually does help.
- 43:08All right, but that's a side note.
- 43:11All right, any uh so let's see a maybe
- 43:14disadvantage?
- 43:16Um what's the advantage?
- 43:19Yeah.
- 43:20>> The
- 43:21op amp is charging a lot more like the
- 43:23analog resistor.
- 43:28>> Hmm, that's a good question.
- 43:30Uh I would say it's probably more than
- 43:34uh the resistors, yeah.
- 43:36There's uh inside there's depends on the
- 43:39op amp topology, but there's a lot more
- 43:40paths to the ground. They can be made
- 43:42very low power. You trade off speed and
- 43:45the resistance you don't have to go like
- 43:47full volts across these things. You
- 43:49could do a smaller value, but maybe I'd
- 43:50say I don't know for any one resistor
- 43:52I'd say that the op amp consumes more
- 43:54power.
- 43:57But that's also like
- 43:58just a ballpark number, right? I can't
- 44:00There's no hard rule of thumb. You'd
- 44:02have to actually do the layout analysis.
- 44:06All right, I don't think I think we said
- 44:08it in different ways, but um
- 44:10linearity and manufacturability of this
- 44:13is hard, but you need less resistors.
- 44:14This is the one where you need the least
- 44:16amount of resistors of any of them.
- 44:18So, that's the advantage here. This can
- 44:19be small. This is one that's typically
- 44:21used in silicon
- 44:22um like on a a microcontroller. They're
- 44:24trying to optimize for size. You're not
- 44:27buying uh the DAC a microcontroller just
- 44:30for how good and linear the DAC is
- 44:32typically, right? You're going you want
- 44:35the flexibility. You want to have a
- 44:37design that could have a DAC or not have
- 44:38a DAC. Um
- 44:41if you really cared about really precise
- 44:43audio output or
- 44:45analog output, you might buy a dedicated
- 44:47chip just for that and you can buy
- 44:49uh you know, analog codecs that will
- 44:52some of you have talked about them.
- 44:53They're like a protocol called I2S,
- 44:56which is equivalent to I2C, in which you
- 45:00will stream digital values to your DAC,
- 45:03and it will do all the generation of
- 45:05analog for you. And you don't have to
- 45:09mess with a lot of that stuff. So,
- 45:10there's dedicated chips that will do a
- 45:12better job than your
- 45:13device.
- 45:15In fact, there's a whole hobby market
- 45:16about like where are the really good
- 45:17DACs to get for your audio amplifiers
- 45:20for your headphones.
- 45:22Okay.
- 45:26So, there's trade-offs there.
- 45:30And then, of course, we have all sorts
- 45:33of quantization error, just like we had
- 45:34with ADCs and analog in general. These
- 45:38all have obey the same quantization
- 45:41limitations, right? So, you're always
- 45:43going to have a half-bit LSB. You wanted
- 45:46a particular output analog voltage, but
- 45:48you can only get discrete steps.
- 45:51Often times, that would mean
- 45:54um
- 45:55you're going to do a lot of steps, so
- 45:56you don't really care. But if you wanted
- 45:57really pure sine waves, you might have
- 45:59to put an output filter on that. And
- 46:01that output filter will remove those
- 46:03high-frequency steps, but you're then
- 46:07limited to you can't have a frequency
- 46:08that's higher than the output filter.
- 46:10So, if your application is allows for
- 46:14fixed output frequency or limited range
- 46:18of output frequencies, then putting a
- 46:19filter on the output is nice. You can
- 46:20smooth out that stair step. Um but if
- 46:23not, then, you know, you're just going
- 46:25to have to deal with that noise and and
- 46:27think about like how does that affect
- 46:28your design. Um
- 46:32You could imagine that there are
- 46:34RF transmitters that actually go at
- 46:36gigahertz that are trying to do direct
- 46:38digital synthesis. Maybe megahertz is
- 46:40more of an accurate statement, but
- 46:41you're trying to do direct digital
- 46:42synthesis. So, those edges would also be
- 46:46spurious noise that goes out on the RF
- 46:48channel. You don't want that.
- 46:50So, but there's all these other ways to
- 46:52mitigate trying to get rid of those uh
- 46:55Some
- 46:56uh sensors or some control loops are
- 46:59done in analog, so maybe you have some
- 47:00analog components and then your digital
- 47:03uh world is trying to inject into the
- 47:05analog control loop. Well, then you
- 47:06might have to worry about those uh stair
- 47:08steps as well.
- 47:11All right. So, why don't we think
- 47:12through a little bit? I think we did
- 47:14most of these things already. I don't
- 47:16have a worksheet for you. I'm sure
- 47:17you're tired of them by now.
- 47:19Um but we can just mentally think
- 47:21through uh resolution. Uh just think
- 47:24through, talk to yourselves, what do you
- 47:25think uh for the top one, the low-pass
- 47:28filter PWM, voltage divider, uh R-2R
- 47:31ladder, or the binary one? Which What is
- 47:33the um
- 47:34given the same area, which ones have the
- 47:37best resolution? Uh so, take a second
- 47:39and uh we'll we'll come back.
- 48:34What do you think? Which one's the has
- 48:35the highest resolution of the group?
- 48:43Should we vote?
- 48:47How about this? Uh this will be one.
- 48:49This is two. This is three. This is
- 48:52four.
- 48:53So, raise your hand and indicate with
- 48:55your fingers which one you think is
- 48:56which. Which one has the highest
- 48:58resolution given the same area.
- 49:01Okay, I got one.
- 49:04Four.
- 49:05Yeah, I can't see that far. I'm getting
- 49:07old. I got lots of fours. I got a few
- 49:09ones, maybe a three. Okay. Let's see
- 49:11what I Let's see what I thought last
- 49:12year when I made this slide.
- 49:14Um
- 49:16I said that I think for the voltage
- 49:17dividers, this makes sense because uh
- 49:20sorry, for the this the last three, the
- 49:22binary weight one, that one is trading
- 49:25uh
- 49:26re- you're making resistors of different
- 49:28sizes to encode currents.
- 49:30And uh that one has the least number of
- 49:34resistors for the end number of bits.
- 49:36So, like the binary weight is the best
- 49:39in terms of resolution per area. This
- 49:41one I said this one's kind of like out
- 49:43there. It's kind of hard to say uh
- 49:45because also it's very noisy. Uh so, it
- 49:47has like a this trade-off between those
- 49:49other ones. These ones will actually
- 49:50keep that voltage stable, while this one
- 49:52will inherently wiggle. And then maybe
- 49:54this one isn't really that applicable
- 49:56for silicon, although certainly you can
- 49:58make it. So, um
- 50:00I don't know. May I don't know why
- 50:01exactly I said maybe, but I don't think
- 50:03it's a fair comparison cuz they have
- 50:04these other trade-offs.
- 50:06Um
- 50:08And then yeah, because I think that
- 50:09these, given the same voltage range and
- 50:11a reasonable bit size, you can get much
- 50:13finer, like little little step sizes.
- 50:15Well, this will always have this RC
- 50:17charge time. So,
- 50:18uh on average it might be low, but I
- 50:20think in general like you just can't
- 50:22rely on it that much. Does anybody have
- 50:24a different opinion?
- 50:26Does anybody understand why I'm saying
- 50:27like this has so much variance ba-
- 50:29baited into it that it's like you could
- 50:31imagine this one for the same voltage
- 50:33range could have like
- 50:35uh you know, the last four sniffing
- 50:37least significant bits could just be
- 50:39last four bits could just be the rise
- 50:40and fall time of this one. So, it kind
- 50:42of not fair.
- 50:44All right, let's do Well, we already
- 50:46talked about speed.
- 50:47So, I'll just give that one away.
- 50:50But um my argument for speed is that
- 50:53these are all high. They're all less
- 50:55than a clock cycle over there, except
- 50:56for this one. This one's like extremely
- 50:58slow. So, if this one is
- 51:01uh you know, whatever your clock is X,
- 51:03right? Uh you know, 100 MHz, well,
- 51:05that's too high, but let's say MHz for
- 51:07those. Those are all going to be
- 51:09be done in the one clock cycle. Well,
- 51:10this one for that same clock cycle, now
- 51:13you have to run a timer, and then you
- 51:14have to break that into a PWM, and then
- 51:17you have to go and slowly change that
- 51:19duty cycle. So, this is, you know,
- 51:21hundreds, if not thousands of times
- 51:23slower than these guys, but you're
- 51:26probably not choosing this one for
- 51:28speed, you're choosing this one because
- 51:30you're like, oh, I just need some analog
- 51:32output, and I only have a digital pins,
- 51:34right? That's why you're choosing this
- 51:36one. Uh so, it's kind of in a different
- 51:37class.
- 51:39What about linearity?
- 51:41Why don't you take, and this means like
- 51:43that has consistent bit sizes uh across
- 51:46different error types. Um so, why don't
- 51:49you take, you know, 30 seconds and
- 51:51discuss what do you think the linearity
- 51:53uh is, and then we'll do the voting
- 51:54again of which one is the has the best
- 51:57linearity.
- 52:08>> [snorts]
- 52:41>> All right, what do we think? We're going
- 52:42to vote. This will be one, uh two,
- 52:44three, and four over there. Uh who
- 52:47thinks, uh I don't know. What do you
- 52:49think? Which one is the most linear of
- 52:51all these?
- 52:53Two, two.
- 52:55Two, I got a
- 52:56four, maybe. All right, these people,
- 52:58they're not voting. One person over here
- 52:59they have no have no idea. They over
- 53:01here, we have a couple people voting.
- 53:02Okay, two. Why? Why two? Anybody want to
- 53:05I see your fingers were up. Why two?
- 53:19Yeah, I think the the voltage divider
- 53:21one
- 53:22um if any one resistor is bad, it only
- 53:24affects one bit. So, that's right. And
- 53:26they're all exactly the same size. So,
- 53:28the the likelihood of getting them all
- 53:30to be very similar is is good. The other
- 53:33ones uh they're different sizes and if
- 53:35any one of them is wrong it it hit
- 53:38affects uh all those uh bits that are
- 53:41associated with that uh resistance. So,
- 53:43uh yeah, that's that's essentially the
- 53:45reason why. So, let's see what did I
- 53:47put? I said low. Well, linearity of this
- 53:49one is horrible
- 53:51in the sense that it's just time varying
- 53:53on its own.
- 53:54Um and then these are you know, the
- 53:56proportionality here ratios of linear to
- 53:59non-linear.
- 54:00Okay?
- 54:02How about I guess power? I'll just do
- 54:04power. It's kind of hard to say because
- 54:06you
- 54:07power is based on so many other factors.
- 54:09So, I would just say here uh the
- 54:13low-pass filter is just a digital IO
- 54:15pin, right? It can't like its power is
- 54:18uh uh
- 54:19you know, an output gate. Uh so, that's
- 54:21really low. Uh the other other of them
- 54:24have to have an op amp and some number
- 54:25of resistors and we could argue that
- 54:27some of those resistors are like uh
- 54:29maybe they're slightly different because
- 54:31there's less uh loss between some of
- 54:33those resistors especially with like the
- 54:34binary weight. It's more efficient. Uh
- 54:37and it's not some of those um resistors
- 54:40aren't even turned on where all the
- 54:41resistors here are dissipating power in
- 54:43the voltage divider. But then it really
- 54:45comes down to like topology and you have
- 54:47to do a detailed analysis. So, we can at
- 54:48least say they're all like medium or at
- 54:50least all the same in this one and um
- 54:53is uh relatively low uh
- 54:56on the side.
- 54:58Okay.
- 54:59And then um
- 55:01I guess I shouldn't have combined these
- 55:02but this is kind of a uh number of um Um
- 55:05number of resistors per switch. Um and
- 55:08so uh uh this is kind of getting at
- 55:10complexity. So, why don't you take uh 30
- 55:13seconds and say which one is going to
- 55:15have the What did I What How do I say
- 55:17this? Which one has the least number of
- 55:20resistor and switches uh in it?
- 55:23Uh aside from this one. How about you
- 55:25just look at those ones?
- 55:26Um
- 55:27cuz this has no no switches.
- 55:30So, take 30 seconds, try and figure out,
- 55:31then we'll vote of these three
- 55:33uh which one has the small lowest number
- 55:35of resistors and uh switches.
- 56:00>> [snorts]
- 56:24>> All right, so we'll vote. This will
- 56:26still be one just out of convention and
- 56:27two and three and four over here, but
- 56:30we're only going to really consider two
- 56:31and through uh four. So, which one has
- 56:34the least number of uh resistors and
- 56:37switches?
- 56:39Four.
- 56:41Four. Yep, it's four. And you can go
- 56:43through and calculate for n n bits how
- 56:46many resistors and switches are. And
- 56:48really uh this is proportional to area.
- 56:51Switches aren't
- 56:53a large area, I think of, compared to uh
- 56:56the resistors, but it still leads to
- 56:58complexity. And so, here's really the
- 57:00trade-off is trying to reduce uh the
- 57:02resistor count.
- 57:03Um
- 57:04but again, this one doesn't quite follow
- 57:06this trend. It's a different topology.
- 57:09Okay.
- 57:10Any
- 57:11questions on the pros and cons of
- 57:13different DACs?
- 57:16Yeah.
- 57:17>> What's the problem with audio playback?
- 57:19Like if you want to like a super
- 57:20accurate one, you would like not use
- 57:22these.
- 57:22Separate like structures.
- 57:25>> Um you would probably not want to use if
- 57:28you're really an audio file and you have
- 57:30better ears than me.
- 57:32Right? And you just could hear all the
- 57:34notes in these this music, you're
- 57:35probably not going to use the DAC that's
- 57:37on the XMC.
- 57:39Right? You're not going to use the one
- 57:40on your microcontroller. They have made
- 57:42special modules that will be audio DACs
- 57:45for audio and they haven't been
- 57:47optimized for like your DAC goes goes up
- 57:50to 5 MHz. Well, you don't need that for
- 57:52audio. You only need it to go up like 40
- 57:54kHz, right? Um and some uh and then
- 57:57they'll be like 24-bit. Now, I can't
- 58:00hear the difference between 16-bit audio
- 58:02and 24-bit audio and most of us are
- 58:04listening to audio that's been
- 58:05compressed anyways. So,
- 58:07those bits aren't even available for us
- 58:09anymore. Um but there's special
- 58:11hardware. And then they also will add
- 58:13in, you know, uh special smoothing
- 58:15functions like uh our like um
- 58:18LC filters and all these other things to
- 58:20make it just right. So, if you're going
- 58:22to do audio, you want to do it just
- 58:23right, buy the correct module.
- 58:27Any other questions?
- 58:29All right. So, I think the real takeaway
- 58:31is from the ADCs and DACs is not that I
- 58:34expect you to be able to calculate your
- 58:36way through any of those voltage
- 58:38dividers and switches. It's much more if
- 58:41you're in industry and somebody's
- 58:42saying, I need to go and buy I need a
- 58:45fast high-speed ADC, which one should I
- 58:48buy? That at least you can come back and
- 58:50remember, oh, that's probably going to
- 58:51be a flash and I hope they don't ask for
- 58:53too many bits or else we're in trouble.
- 58:55Right? That's like that's the sort of
- 58:56tradeoff I'm looking for.
- 58:58Um or if you're doing um you know, a
- 59:00DAC, why why are the what if I'm looking
- 59:04at a a really low-cost thing, why is it
- 59:06that I might have to worry about
- 59:07linearity? If I'm especially if I'm
- 59:09doing controls and analog controls,
- 59:11mixed digital analog controls,
- 59:13maybe you really don't want to use that
- 59:14binary weight or you're just like it's
- 59:16free and I'll have to find some way to
- 59:18compensate for some of those errors.
- 59:22Okay.
- 59:24Let's see.
- 59:25And then so on I don't know why it's all
- 59:29out of order
- 59:30but on your particular devices you
- 59:34I think most of you had lab this week
- 59:36but um
- 59:37it's a audio
- 59:39like DAC
- 59:41and so you'll have you have two DACs on
- 59:44your device.
- 59:46It's interesting you can go to full
- 59:47resolution at
- 59:492 MHz but then
- 59:51there's reasons here while if you want
- 59:52to go to faster 5 MHz you have to reduce
- 59:54your resolution. So there's this speed
- 59:56trade-off
- 59:58that happened. Now the SAR has that
- 1:00:00built in fundamentally built into it.
- 1:00:02This is much more about the secondary
- 1:00:04effects of like
- 1:00:06how the settling time works and how the
- 1:00:08analog outputs of these things work
- 1:00:10rather than a fundamental of the flash
- 1:00:12or the sorry the DAC type but there is a
- 1:00:15resolution speed trade-off here as well.
- 1:00:17This DAC
- 1:00:19well as most DACs that you would
- 1:00:22ever use does have an output buffer and
- 1:00:24they specifically say it's rated for 5
- 1:00:26kiloohms
- 1:00:2725 picofarads
- 1:00:29and that's just like a pretty reasonable
- 1:00:31thing right? They're saying okay we can
- 1:00:33drive a power source that's more for
- 1:00:35signal level and the capacitance is
- 1:00:37always is important that they mention
- 1:00:40that because
- 1:00:41capacitance lives parasitically
- 1:00:43everywhere and
- 1:00:4550 picofarads is actually kind of a lot
- 1:00:48of
- 1:00:48capacitance so they've kind of optimized
- 1:00:50for most analog signals that you would
- 1:00:52come up against
- 1:00:53but if you make control circuits things
- 1:00:57can become unstable if you have too much
- 1:00:59capacitance or at least at the minimum
- 1:01:01it's going to take too long to drive
- 1:01:03that thing and this will start slowing
- 1:01:05you down. Now this is only 5 kilohertz
- 1:01:08or kiloohms so you can't go and drive
- 1:01:10reasonably drive that 8 ohm speaker Um,
- 1:01:13why you need to have something in
- 1:01:15between So, uh, if you're going to if
- 1:01:17that's part of your lab or your final
- 1:01:19project, you're going to drive a speaker
- 1:01:20and you're going to do it with a DAC,
- 1:01:21that's cool. Um,
- 1:01:24that gives you lots of flexibility in
- 1:01:25how you control sound, but you're going
- 1:01:27to need an output stage that's really
- 1:01:29designed to drive speakers. And because
- 1:01:32speakers are so low voltage and need
- 1:01:34high current, um, or so so low
- 1:01:37resistance and need high current,
- 1:01:38there's usually output devices
- 1:01:40specifically made to drive speakers. So,
- 1:01:42you want something that's a speaker
- 1:01:43driver. Uh, cuz it's such a common thing
- 1:01:45and it's a kind of a unique operating
- 1:01:47point. So, for this, you drive this
- 1:01:49into, uh, you know, an audio speaker
- 1:01:52driver, some module that does that. You
- 1:01:54plug it is powered externally and then
- 1:01:56that plugs it you plug your speaker
- 1:01:58directly into that module and then you
- 1:01:59can have uh, nice sounding audio.
- 1:02:02And I think we talked about this most
- 1:02:03project groups. Just reminder that the,
- 1:02:06uh, expo's going to be loud. So, if you
- 1:02:08have something that you want us to hear,
- 1:02:12and you remember I can't hear anything.
- 1:02:14So, now you're going to have to have
- 1:02:15that extra loud for the, uh, expo if you
- 1:02:17want us to do it. Um, an easy way to do
- 1:02:19that is just put PC speakers. Bring some
- 1:02:21PC speakers, turn them up. We'll be able
- 1:02:23to hear it.
- 1:02:24Um, okay.
- 1:02:28Um, we'll do quickly talk about some
- 1:02:30error types in DACs and ADCs. So, we
- 1:02:32already know about quantization error.
- 1:02:34We showed a slide on it before. We
- 1:02:35talked about quantization error uh, back
- 1:02:38when James was here uh, talking about
- 1:02:40uh, analog signals in general. And so,
- 1:02:43we still have those same error types.
- 1:02:46>> [clears throat]
- 1:02:46>> Um, the offset error here, this is um,
- 1:02:50basically you have this ladder that's
- 1:02:52going up and if everything's just
- 1:02:53shifted along some analog voltage,
- 1:02:56that's actually not too bad. That might
- 1:02:58mean that like the tail resistor
- 1:03:00on your ladder was not quite right.
- 1:03:03Maybe it's malformed. Or maybe there's
- 1:03:05some, you know, analog offset. This
- 1:03:08error is common, but it's also
- 1:03:10recoverable cuz all you have to do is
- 1:03:12calibrate your device. And then you're
- 1:03:14going to have a nice stairstep effect.
- 1:03:15So, this one is uh relatively easy to
- 1:03:18deal with.
- 1:03:21Um and this is also why they have the
- 1:03:24the they often ship It's not even by
- 1:03:26error, but to get the most effect out of
- 1:03:29your SAR set, they often shift uh the
- 1:03:31bottom and the top by 1/2 LSB.
- 1:03:34Um the one that's a little bit harder to
- 1:03:36deal with is full scale
- 1:03:38uh error, and this is kind of like gain.
- 1:03:40So, this is where the stair step is, you
- 1:03:42know, you wanted it to be a digital
- 1:03:44value to be a particular analog value,
- 1:03:46but it's just uh diverging. Maybe it's
- 1:03:48diverging on the bottom on the low
- 1:03:50voltage side or the high voltage side,
- 1:03:51but there's this constant diverging of
- 1:03:53it. And so, full scale error uh is not
- 1:03:56also not that bad. This is calibratable,
- 1:03:58right? You can go and at factory time
- 1:04:01sometimes they'll do it. Sometimes
- 1:04:02they'll have a subset of points that are
- 1:04:05calibrated, and then you can interpolate
- 1:04:07between those points. And how they do
- 1:04:08that is at the factory, they'll have a
- 1:04:10known voltage uh input or they'll
- 1:04:13command a digital output and measure the
- 1:04:14output voltage, and then they'll have a
- 1:04:16lookup table. They'll show you those
- 1:04:17offset values. Um
- 1:04:20and then it's probably not practical for
- 1:04:22them to do all the voltages, but they'll
- 1:04:24do some.
- 1:04:25Um
- 1:04:27and so, like uh it's not obvious, but
- 1:04:30uh the amount of time it takes to test
- 1:04:32your chip
- 1:04:33and actually make sure that it is uh
- 1:04:36fully functional. So, that's like
- 1:04:37checking all the D flip-flops and that
- 1:04:39the
- 1:04:40thing can boot and all those sort of
- 1:04:41things and check all the analog
- 1:04:42peripherals is actually a real
- 1:04:44bottleneck for most um microcontrollers
- 1:04:47and um high-end processors. So, they're
- 1:04:50not going to do the full um
- 1:04:52calibration for you.
- 1:04:54But that one you could calibrate uh if
- 1:04:56you if you had to as part of some
- 1:04:58startup sequence uh some way on a on a
- 1:05:00product. It's not impossible. Or if you
- 1:05:02had a very special like one-off system,
- 1:05:04you could just do the full lookup table.
- 1:05:08The errors that are much worse are the
- 1:05:11kind of the ones we talked about that
- 1:05:12are more susceptible with a weighted
- 1:05:13binary
- 1:05:14uh value uh DACs where the non- the size
- 1:05:18of the bits vary as a function of the
- 1:05:20code. Now, these are much harder to deal
- 1:05:23with um because it would take a whole
- 1:05:25bunch of mapping of every single thing
- 1:05:27to figure this out. Um so, there's these
- 1:05:30uh type of errors and typically the
- 1:05:33manufacturer's going to
- 1:05:34uh
- 1:05:35uh specify that uh what the worst-case
- 1:05:39differential non-linear error error is
- 1:05:40going to be. So, they're going to say
- 1:05:41like how much error do they expect in
- 1:05:44their ladder under normal operating
- 1:05:46conditions.
- 1:05:47And so, that would be added into your
- 1:05:50quantization uncertainty as well. And
- 1:05:52I don't know if James said this, but I
- 1:05:53typically think of a DAC or an ADC as I
- 1:05:55just throw away the last bit anyways,
- 1:05:57maybe the last two bits just because you
- 1:05:59have noise, you have system noise,
- 1:06:02um you know, you put a constant voltage
- 1:06:04in and you look at your ADC reading and
- 1:06:05you can just watch the thing wiggle
- 1:06:07around.
- 1:06:08You can track down all that noise, but
- 1:06:10that's effectively your your system
- 1:06:12noise and you can't get around that. So,
- 1:06:14uh you just expect that uh the signals
- 1:06:16aren't going to be perfect.
- 1:06:18Um these are like other examples of
- 1:06:20differential non-linearity.
- 1:06:22Um some of these are, you know, okay.
- 1:06:24There's little offset errors, maybe you
- 1:06:26skipped uh an analog step, uh just not
- 1:06:29reliable. And then, these are like the
- 1:06:31really bad ones where somehow you
- 1:06:33actually had a uh digital value was
- 1:06:36represented twice or more than once.
- 1:06:37It's not a linear step because of some
- 1:06:39process error. Maybe one of those uh
- 1:06:41resistor values got so far out of whack
- 1:06:44that it caused that sort of
- 1:06:45non-linearity. And
- 1:06:48you know, is that a problem for you? I
- 1:06:49have no idea, right? That's really up to
- 1:06:51your design. But imagine if you had a
- 1:06:53control loop which you were expecting
- 1:06:55that as you increase digital values, the
- 1:06:58analog values also uh increased and you
- 1:07:00had something that was tracking that.
- 1:07:02Well, in this case, you might get stuck
- 1:07:03in this uh local minimum uh not even
- 1:07:06realize why. It's rare, but you you
- 1:07:08should think about it if you're trying
- 1:07:09to do uh controls with analog uh
- 1:07:12signals.
- 1:07:13Um
- 1:07:15And this is just another the integral
- 1:07:17error as to uh make a a measurement over
- 1:07:20all the values compared to um
- 1:07:23the
- 1:07:25ideal versus the what was actually
- 1:07:27there. You can
- 1:07:29figure out the area under that curve and
- 1:07:31then you can integrate over it and
- 1:07:32figure out
- 1:07:33how much error is accumulated. So just
- 1:07:35another measurement. And maybe you know,
- 1:07:38maybe not the manufacturers of a
- 1:07:39microcontroller, but the manufacturers
- 1:07:40of an of a DAC or an ADC would should
- 1:07:43quantify that especially if you're in
- 1:07:45that like really nice audio place space
- 1:07:49or some other spaces where trying to
- 1:07:50sell you a really nice error
- 1:07:53DAC or ADC.
- 1:07:55Um let's see.
- 1:07:57Yeah.
- 1:07:59When this will come out,
- 1:08:01there are if you're going to take the
- 1:08:02FFT of something, right? This is a
- 1:08:04common thing. You have some signal. Now
- 1:08:06you're trying to do signal processing on
- 1:08:07it. You're analyzing some circuit coming
- 1:08:10in you're like, well, what's the most
- 1:08:11dominant frequency? Maybe that dominant
- 1:08:13frequency is human speed or something.
- 1:08:15There could be some radio signal or some
- 1:08:18Doppler shift.
- 1:08:20But you'll find is those errors will
- 1:08:21cause spurious signals. You This is your
- 1:08:24fundamental frequency. This is what's
- 1:08:25coming in. This fundamental frequency
- 1:08:27doesn't have these side lobes, but
- 1:08:29because of your ADC
- 1:08:31or DAC errors, these things start
- 1:08:34creeping into your signal processing
- 1:08:37pipeline where you're saying, oh wait, I
- 1:08:38get a lot of error over here. My signal
- 1:08:40coming in has all these spurious things.
- 1:08:43That doesn't meet the FCC spec. Well, it
- 1:08:45may be that your DAC is just
- 1:08:46interpreting that cuz it has some or
- 1:08:48your ADC cuz you have some
- 1:08:49non-linearities.
- 1:08:51So there's kind of like these follow-on
- 1:08:52effects that I'm just kind of giving you
- 1:08:53a heads up about.
- 1:08:55Um okay. So we're going to
- 1:08:59I don't really get to the eight to the
- 1:09:00DAC so everything I wanted to today, but
- 1:09:03we'll recap quickly.
- 1:09:04Um so we've
- 1:09:06reviewed voltage dividers and voltage
- 1:09:08ladders, three types of DACs.
- 1:09:10You can consider
- 1:09:13low-pass filter to be separated from the
- 1:09:15binary way and the R2R. They are
- 1:09:18different.
- 1:09:19Um
- 1:09:20maybe I wrote that wrong, but and then
- 1:09:22we talked about a bunch of errors in
- 1:09:24ADCs. I think the real rule of thumb is
- 1:09:26you have to figure out when you're
- 1:09:28working your system, how much do you
- 1:09:30trust those lower significant bits? Is
- 1:09:32it one bit you already know you can't
- 1:09:34trust it? Is it Is it two bits that you
- 1:09:36can't trust or three bits? You have to
- 1:09:37kind of figure out in a practical
- 1:09:39system, like what is that noise floor
- 1:09:41and can you trust those lower bits?
- 1:09:43All right. We'll end there and we'll
- 1:09:45pick up next week.
About this transcript
This page contains the full transcript of EECS 373 - Fall 2026 - Lecture 15: "DACs" by Interactive Sensing and Computing Lab , generated from the public captions YouTube serves with the video. The transcript has 11,232 words across 1,793 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.