AOI to NAND Conversion
Programming Languages
So in the past few days, you've been learning about a technique called AOI which stands for and or inverter and or inverter has been away that we have implemented circuits that make decisions. Today, you're going to be learning about a different way to build circuits. And that's something called a nand gate. So somewhat of a contraction. What we mean by this is not in so basically the demand gate, which you're going to be learning about in this activity is the exact opposite of the endgame. So what you're going to be learning about in this activity is how a man gate works. And the cool thing about the nand gate is that in one gate, you can have all of these functions. And then gate can act as an and gate and or gate and an inverter. We'll show you how this activity. The whole point of this is to reduce the amount of circuitry that's needed. With a line, you have three types of gates, and or inverter, nand, you only have one. So that reduces the complexity. It reduces the amount of hardware. It reduces the amount of cost. So that's why we use game Gates. So without further ado, let's go ahead and talk about this activity. So here's an Iggy. You see if you take a look. This thing has the same body as regular old a game, which you see right here. The only difference that we have is the bubble. Okay? So if you may remember from way that when we do the inverter, that's an inverter. No? A inverter has the bubble. So the bubble is like the universal indicator that something has been inverted. So basically a nand gate is nothing more than an and gate. It has an inverter all built into it. So, and then gate basically works off of de Morgan's. So if you take a look, this may engage combines X and Y and invert so when you break the line change the sign, this is what we would get from it. So if you check this out, it's truth table is the exact opposite of a regular old and gate. So if you looked at a regular and gate, it would behave like this. Remember that the reason why an Andy is called an in game because it is only high when X and Y are high. That is when a nand gate I'm sorry, that is when a regular and gate has output of one. When both X and Y are high, with the nand gate, the output is high, except when both X and Y are high. So again, just act up opposites of each other. And nand gate is nothing more than an and gate that we've put in very wrong. So here's our here's a situation. So you can be running it out in activity is whenever you see an and gate, we're going to be replacing it with this combination of neon Gates. Here we see an organ we're going to replace it with this combination of nand Gates. And whenever you see an inverter, we're going to replace it with this combination of me and gate. So taking a look at this, this is perhaps one of the most important slides in the course. Right here. Because it has the conversion process for AOI demand. So here's basically the process. First, implement an AOI because it's the language that we know. We've had a lot of experience doing AOI. So start with that. Then what we do is we look at this slide and we replace every gate with its equivalent. Then we redraw the circuit. One thing that you're going to get is you're going to get something called a double inversion. We'll talk about that briefly. And then the last step is to redraw final flick it. So what we're going to do is we're going to, of course, do an example so that you all can see how the process works. So here's our logic expression that we're going to implement. Z equals B and not C or a and C okay? So this is where with the sheet of paper, you're going to go ahead and follow along and complete the example. So like we said first, we're going to start with AOI. So this ought to be relatively easy. So right here, I'm going to take a regular and gate and I want to build this part of the logic expression first. So there's B and then I have to go through here. And I have to invert C so then right here, I have B and not C and then the other thing that I have to do right here is I need another and gate. I need a and I need C right there like that. So now I have a and C so what I do is I bring these together. Put them together with it. But now I have the C or a and C so there's my AY implementation right there. So now let's go ahead and we're going to convert it to the end. So I'm going to go ahead and bring in our friend slide number 7. So what we're going to do is we're going to start off we're going to start off with the inverter right here, okay? So this inverter is supposed to be replaced with this. So I'm going to give myself an a B, see right here, a, a, C all right. So I'm going to go in here. I'm going to take this and I'm going to replace it with that. So here comes C and then I draw exactly what I see right here. Take that, replace it with that. Boom. Okay. Check that off. Now I need this part. So I'm going to take this. So these two and Gates, okay? I'm going to play some with this. What you see right here, okay? So I draw that once. And twice. Okay. So again, I've taken this and I replaced it with that. And I took that and I replaced it with that. Notice, again, these are both and Gates. Okay? So I draw the same setup of Gates. Remember, this says, whenever I have an and gate like this, I replace it with this. It's just direct substitution to swapping if you will. Okay? So now what I do, the first one says a and C, okay? So this one right here is going to go a this one is going to come down here. To see. In the next one says, B and not C so this one is going to come over to B now I got to be careful here because this other one is supposed to be not C so I got to come down here and come around and go after because remember, this thing is functioning as an inverter. So if I want not C, it has to pass through here before it comes in. Over here, it's C but afterward, it becomes not C it's been inverted. All right, and then the last thing that I need to do. Is this or gate right here, okay? So according to my table, whenever I have an or gate, I take this and I replace it with this setup of Gates. Okay? So the first thing I do before I'm going to connect anything up is I'm going to go in here and I'm going to draw it. Okay? So let me draw it first. Okay, so if you take a look one, two, three, one, two, three. Okay, so now what I'm going to do is I'm going to connect that up like that. And then there is my output Z right there. Remember how step four said we have to eliminate double inversions. Detail of this, whenever you have in the endgame, that is set up like this, okay? That's a double that's an inversion. So if you look right here, so I travel along the same wire. And you see right here, inverter, inverter, see, you might remember from Boolean algebra, something like this. If I take something and it invert it twice, the inversions cancel out. And I'm left with my original item. So I have inverter number one, in inverter number two. So since I had to double inversion out there they go. Okay? And then you look, I have the same thing right here. So, goodbye. So now my last step is to redraw the circuit without those gates in it. So I have a, B, C remember that C got inverted. So I'm going to go in here and I'm going to draw that. And then so I got this gate that one is that one is that one. All right? So now I need these two. Okay, so this one says a and C okay? Here's a. C in this one says B not C, B. Not C, okay? Now, so I got that one. I got that one. I got that one. So you notice these four right here. They're gone. I do not redraw them. So the only thing that's left is this. So I take these two and combine them into this. And that's it. I am done. All right. So some of you are going to try to drastically overthink this. Okay? You know how to do AOI at this point. Always start with that first. Start with a line. And then again, don't overthink it. For every see it and gate, draw this instead. Wherever you see an or gate, draw this instead. Where we've seen inverter, draw this instead. So the last thing I want to do before I close this out is I'm going to prove to you all that, in fact, this is. In fact a worthwhile process to go through. So check this out. So right here, this was the original, this is the original, the N not C or a and C implemented via AOI. Over here, we have the same thing implemented in men. So you may look at this thing. If you look right here, one, two, three, four Gates. One, two, three, four Gates. Well, it's the same number of gates. So why is this a savings? Well, these ones. We'll be taking a look. There aren't chips out there. They're like a mishmash of different types of gates. They all only come with one type of gate on them. So we're here, just because you have this one gate, you've got to have a chip. So that's one chip. These two, you have to have a separate chip because remember this is an inverter. These are ant. So there is no gate that has both of these on it. So you have to have a separate chip for this. And this is an old game. So you need a separate chip for that. So just to implement this circuit, you have to have three separate chips. Now, if you look at this, the inverter chip has 6 gates on it, and these have four piece. So if you look, that's a tiny loop of 14 gates. When this circuit, there's only four. So I wasted ten gigs. All right? So if you look over here, well, then we have one type of IC. If you look, these are all man Gates. They're all the same. So what we've got going on here is that there are four of these on a single chip. If you notice, we have four here. So we used exactly one chip. Nothing went to waste. So that's the reason why AOI sorry, why nand Gates and learning them is so important. It greatly reduces the cost and makes it so that you don't have to stock as many parts. Please attempt your activity at this time and thank you.