Tác giả giữ toàn bộ bản quyền (All Rights Reserved) — không phải giấy phép mở. Bạn vẫn xem và học miễn phí trên OpenER; muốn tái sử dụng cần xin phép tác giả.
DAN GARCIA
And welcome back. In this last series of lectures, we're going to talk about combinational logic blocks. Again, this is under the umbrella of synchronous digital systems.
Combinational logic block say, let's see if we can build larger blocks out of combinational logic elements that are powerful and really useful for our data path.
So we're going to start with data multiplexors and what they mean.
A data multiplexor is very much like a flag person, whose job it is to take n lanes of — I drew this here — n lanes of a highway from this area of "the 101" and maybe n lanes of highway from "the 5 — " I'm doing Southern California vernacular — and there's only one bridge.
And all of 101 and route 5 have to take one bridge. And this signal line is going to tell you which of those drives.
When the signal line is 0, then A drives the bridge. When this thing line is 1, then B drives the bridge. And C is either 1 or 0, never both.
So that's the idea of a mux. So the way we can think about it, that was an n-bit input mux, so the n channel input mux with one signal line.
You can think of this as being n instances of a 1-bit-wide mux. So let's actually talk about a 1-bit-wide mux and how to build that.
And then maybe you can learn how to build the larger one I showed you in the previous slide of the n-bit-wide mux. So how many rows in this truth table?
Pause for a second and see if you can figure out the answer. And I'll tell you in two seconds. All right. Welcome back.
The number of rows, how many inputs do I have? I'm counting 1, 2, 3. That's three inputs. Three bits is eight rows.
Here's my eight rows, which basically says the following. It says — well, let's look at this. Well, I've got — when s is 0, s is 0, what is c?
Let's look at it. C is essentially whatever a is. Look at that. That's exactly the same as the output.
When s is 1, C is whatever b is. Really useful, right, see how this is the same thing. So that's pretty cool. So that's a way to think about this.
But let's say we don't see it that way. Let's try to lower this down to the simplest logic that'll actually make this work.
We're going to try to eventually try to make the simplest form of logic, fewest gates to implement our 1-bit-wide mux. Well, canonical form says, sum of products. So let's do this.
Every row — let's review. Every row that's a 1, we say, what term is it? That's a 1 when it's not s and a and not b. There's that first term.
And you do this for all four terms to give you four terms. Then you put your — dip your hands into your Boolean massage lotion and start working that equation, work that equation.
All right, here we go. Well, I can already pull the s out — sorry, the not s, pull that guy out. Maybe I use my pen to do that for me.
So what's the law that allows me to go from in here, this term to that term? Distribution.
I call it reverse, because you're reverse distributing out there, but it's a lot of distribution, same thing here, same idea here. And how about this? How about this inner term?
How do you go from there to there? It's the same thing. I'm just reverse distributing out a and b out of that term. Well, how about this one?
What's this one? Remember, this law? What's this? B or not B?
Yeah, the law of complementarity. So that tells me that that's 1. How do you go from here to here? That's the identity property.
You guys should remember that. Hopefully you remember that from algebra. Yielding this really simple not sa or s and b. Now let's think about that.
Not s, then you're a. Or when s is high, it's b. It's almost like you're learning from — it's almost like you could go straight from here to this.
What's the output c? Well, if not s — meaning s is 0, meaning not s, then it's a. Or when s is 1, it's b.
So actually you almost don't need any of this stuff. You could go straight from here to here.
And in fact, as we go to the next one, you're kind of — I was talking my way through this already.
You could almost go straight from here really to this one, which is when s is 0, it's a, s is 1, it's b, to here to there.
So actually, there is a shortcut really this way to that way. So think about that. So s is 0, it's a. S is 1, it's b.
And that's the same thing — think about that. If you don't see that one-to-one connection between these two things, take some time to think about that before you move on.
Kind of neat, right? That's kind of cool. All right. So how do we build a 1-bit-wide mux?
None of this is new. This is all review. Not s and a or s and b? There it is.
Piece of cake. Pretty simple. Not s and a or s and b. You've seen that before.
Nothing really special there Now I got to throw a little curve ball. I'm going to spit on this ball and throw a curve ball now. How about a 4-to-1 mux?
Huh? How do you do a 4-to-1 mux? Let's think about this. Well, now my signal line has two bits because I've got to choose from among four inputs.
I didn't tell you this is a 4-to-1 one-bit mux. Each of these guys are 1-bit-wide. Well, what do I have? Well, look at this.
I've indicated here — and do this yourself. Indicate, if you ever write a mux, what the value of the signal is for each of these guys.
You notice I did it in the last one as well. I wrote a 0 and 1 there. Same thing here so it's unambiguous who wins. When s is 11, it's going to be d.
So as s has the numbers value 0 through 3, you know who's going to win. And here's a little table here.
Now e, the output, is going to be a, b, c, or d, depending on whether s has a value of 0, 1, 2, or 3, respectively. So that's nothing special.
How do you build this one? First of all, let's ask ourselves, how many rows of the truth table? Pause.
You thought about it, right? Okay. Well, I count six input lines. I count four guys there total, and two here.
That's six lines. 2 to the 6 is 64. So I count 64 — boy, really?
I got a truth table that's 64 long, and like six inputs over there, and then one — I mean, really? That's a lot of numbers.
64 times seven numbers, that's like six input lines and one output at seven for everyone? 7 times 64, I don't want to do that. Sorry. I ain't doing it.
Is there another way to do it? So anyway, here is — okay, by the way, I'll just give you a freebie. I could do that, or I could go straight to the answer.
What's the answer? You saw that before. Before it was not s and a or s and b. Can you go straight to the answer here?
Yes. And bam, check this out.
This is saying e, the output, is not s and not s1 and not s0 and a, or not s1 and s0 and b, et cetera.
Isn't that cool?
So kind of the aha we got from the last slide yields us — lets us save our time rather than having to make any truth table and have to do any Boolean algebra massaging.
Put that Boolean algebra lotion away. I'm ready to go straight from the idea of a mux to its equivalent, not necessarily a canonical form, but pretty tight form to describe a 4-to-1 one-output mux.
That's pretty cool. So think about ways you can use shortcuts rather than having to go, well, I know how to do truth tables. I guess I got to slog through that one.
It's like in a game, I just got to grind through to get those points. Stop grinding. Just go straight to the output if you can. If there's a shortcut, jump right to it.
IKEA is great. They have this special path where you can go straight to the register rather than have to wind you all the way. Do the IKEA trip.
Do the kind of optimization like that. And if you wanted to see this, here's the equivalent. Look at this. Here's a value — basically, look at this.
This is the connection straight from here to that. So I can go from here to that, or I can go here to this to there.
I can go straight from here to there because I know how to do this now. I'm fluent now enough with this. So think about how to go straight to the answer.
It's pretty cool. Now, how do I wire this up, though? As I said, I could either think about it that way to wire it up.
I can think about making the product of — I'd say the sum of those four terms.
Or is there a way to think about — another way to think about how — I mean, when I have, I don't know, let's say, four basketball teams, and I have one national championship, how do I do that?
How do I get those four basketball teams to have a final winner? Do I do this with a mux and a table? No, they play against each other.
You have these two teams play, and then there's a winner from the Western region. And these two play, and then there's a winner from the Eastern region. They play in the championship game, right?
Hopefully Cow comes up the winner on top. So hierarchically — that's the aha. The aha is this recursive or hierarchical way that you can wire them. Can you see it?
Can you already see it? Isn't that cool? So you can think of s0 and s1 as wiring together three 2 — three of these 2-to-1 muxes.
And there's my 4-to-1 mux. By the way, if I draw a box out here, look, folks, that's my 4-to-1 mux. But inside of it, are three 2-to-1 muxes.
Isn't that cool? I think this is really neat. So then we're going to see this — there's a lot of ahas here.
And the aha here is you can make use of other blocks rather than going, well, I got to make 64 rows and do some algebra to build it.
You could do that, or you could just wire this together and obviate the need for touching a truth table at all. No truth tabling, just wire them like this.
What's great about this, if you play with this, is you've got — here's my s0, s1. Watch. When s — when these guys are s0 is 0-0 who's going to win?
That's try it. It should be a. Well, s0 says, well, that's going to come through. A is going to be in that line.
And this one says c's on that. Line and s1 determines who wins of that tournament. Well, if that's 0, then a gets to win. So when it's 0-0 it's a, et cetera.
Let's just see, how about 1-1? Let's just do a 1-1 test. 1-1, 1-1, so that means d wins. So d is here.
And b wins. That's a whole different tournament, a whole different final game. And then s1 is 1, so d comes through. So when it's 1-1, it's d.
Isn't that neat? So this is a powerful idea that says, one, we don't have to go through the pedantic slogging through, grinding our way through to make a 64-row truth table.
I can say, wait, I could actually build this block out of smaller blocks I know about.
And as you get more and more fluent in digital logic, and computational circuits, and Boolean algebra, you can realize you don't have to always go back to the beginning to build your truth tables and do — I mean, that was crazy.
That's crazy. So we like the idea of being smart about things sometimes and cascading things in this way, which is really, really nice.
It turns out that — I mean, when a is going to be chosen, there's still work done over here, but it's hardware. These things are always moving and always doing it.
They just don't get chosen. It's like the person doesn't get chosen to win. I mean, that's how it is. A is going to come through.
This is 0, and that's a 0. A is going to go in. I don't even care. It's doing work, but they never get to see — they never see the light of day.
It's almost like whoever doesn't win the presidency, did all that work, and it didn't matter anyway. You weren't chosen. Same idea, right?
A lot of people put work into it, and then at the end of the day, nobody won. By the way, vote.
I don't care what year this is, what year this video gets played, make sure you vote. Make sure you put in your — you apply your democratic rights.
Please make use of that and vote. Have your representation known, very important. All right. We'll see you at the next lecture.
Đăng nhập để đánh giá học liệu này.
Đăng nhập để bình luận — chưa ai bình luận về học liệu này.
Không có khóa học liên quan.