 This is a 54HC00 Quad NAND chip. It's CMOS, and in fact here's the number right on the die. Yeah, this is a die photograph, so I thought that I would maybe reverse engineer it from the die. So right away we can see that we have a whole bunch of pins around the outside, or actually pads, and these are the bond wires that go to the pins that would be on the package. And over here I just have the pin out for reference. So usually the thing that I look for is pin 1, which usually has a different shape from other pins. And we can see that this pin definitely has a different shape, and that's probably pin 1. But then I also look for power pins, and power pins are usually connected to large metal nets. So here's one for example, and this pin over here looks like another one. So from that I basically just sort of guess at what the pin out should be by saying this is 1, 2, 3, 4, 5, 6, 7. This would be ground, which does make sense. And then of course 8, 9, 10, 11, 12, 13, 14, which would make this VCC, and that certainly makes sense. So the pins that I thought were power pins are definitely power pins, and the pins that I thought was pin 1 is definitely pin 1. So I'm just going to go ahead and label those. So let's go ahead and give me a pin 1, and maybe make that a lot bigger, maybe even a lot bigger than that. So we're going to change this to, well first of all let me change the font. I like using Deja Vu Sam's. And also I'm going to increase this to maybe 200. Sure, that looks fine. Okay, so there's my pin 1. Okay, so now that I have labeled all the pins and I've labeled the power pins as well, the next thing that I want to do is maybe just choose one quarter of this chip, because of course there are 4 gates and they're all going to be identical. So I'm just going to work with, let's say, pins 1, 2, and 3. So according to the pin out, this is an input, this is an input, and this is an output. So I'm just going to label those. Okay, now that I've labeled the inputs and outputs, let's take a closer look at the chip. So what we can do is maybe work from the output backwards. Now this is a little hard to see, but this is a gate over here. So this is a gate, and I'm just going to draw the outline out, and then basically color it in green, I guess. Gonna be colored green. So we can see that we have here some sort of an oval thing. These are actually contacts between the metal, which is this yellow part, and the gate. So let me just change my paint, and I'm now just going to roughly draw in these contacts. So I know that's where it is. Okay, so now I can simply hide the gate so that I can see the metal, which is here. So let's go ahead and draw out the metal to there. Okay, so let's zoom out a little bit. Alright, so that is that piece of metal. So it connects up to this gate up here, and it's going to connect to something else down below. So let's take a look at which of these is a power connection. So I think that we've got this big chunk of metal right in the middle that goes to ground. So what I'm going to do is I'm going to take this label and just put it right over here. So now I know that this is ground. So what I'm going to do is I'm going to put in some more contacts. So here are some more contacts. Now what I'm going to do is I'm going to draw out a blue region, which is the part of the diffusion that's connected to ground. So it's basically here, and it ends right about over here. And it may be hard to see the lines, but they're there. So that is the part that's connected to ground. So there are typically a bunch of these. Okay, so we have this other section, which has some contacts here. That's the other end of the transistor. This is basically a power transistor because there are many sections and they're all connected together. And we can see that that actually goes out to the pin. Let me go ahead and draw the metal out for that. Okay, so that is the pin side of it. And now I need to draw the diffusion on the other side of this transistor. So let's make that, I'm going to reserve red for diffusion that's connected to VCC. I've already used green, so I guess I'll use what, this kind of a brown color. Actually, what I like to do is color the gates kind of a pinkish color, kind of like that. So, okay, so now I can use green as, and of course I've got these labels all wrong. So maybe I should just say that this is just diffusion and this is VCC connected diffusion. And blue is ground connected diffusion and this is actually gate. So I'm going to go into the diffusion layer and draw the diffusion. So it looks like, let's see, where does this end? It ends right about here. Now a lot of this may not make any sense to you because there are a lot of sort of hidden lines in here. And if I were to take the metal layer out, you would be able to definitely see the diffusion areas and why I'm stopping at this level or why I'm stopping over here and over here. Because I've seen this before, so I sort of know where these things are supposed to begin and end. Okay, so the green part is one electrode and you can see now, I hope clearly, that they're connected to pin three right over here. So that's the green part is connected to the output and the blue part is the other side of the transistor. That's connected to ground and then we have this gate in the middle. So if you can imagine, let me just pull up a sketch pad. So what we're seeing really is VCC or VDD up top and we're seeing one electrode here and then this goes to pin three. That's the output and this is the transistor and it's an NMOS actually. And I've got that backwards of course. So what we're seeing is this. So there's ground. We've got one end of the transistor here. We've got the other end of the transistor up here and this is an NMOS. And what we're going to see on the other side, this is just your standard output. I guess we can call this VSS but in the diagram they call it VCC even though it's not really the collector voltage. So and we're probably going to end up seeing these gates connected. So basically what this is, if this is pulled high then that turns on this bottom transistor which connects the output to ground and if the gate is pulled low then that turns on the top transistor because it's PMOS and that connects the output to VCC. So basically this is kind of a power inverter that we're seeing in the chip. So this is the side that's connected to ground so that's that bottom side. And this side over here is the part that's connected to VCC. Okay so in the middle section over here appears to be a bunch of other transistors. So let me start tracing out those gates. I may as well draw these other contacts here. Let's see, this part over here is VCC so I'm just going to draw those contacts. Yeah that's all on this side. So let me go ahead and draw out the VCC part. We've got another part over there. And let's see what else have we got. Let me just go ahead and draw out the other part of the diffusion which would be here. Okay so that appears to be one transistor here so it is also connected to VCC. So that kind of implies that it's a PMOS because usually that's the only place that you're going to see that. The gate, let's see, well let's actually continue our sketch and draw this out. So the green part of the diffusion is connected to this long metal thing that goes up to the gate of the output stage. So this is going to be the electrode of a PMOS. So let's go ahead and draw that out. So we know that this is going to be the electrode of a PMOS with the other part connected to VCC. So it basically looks like that. That's the transistor that we just drew. We can see that its gate is connected to the gate of another transistor down here. I'll draw the contacts out for that. We've got a bunch here, a bunch here, a bunch here. And let me draw out their diffusion. Okay so that is a transistor that is connected to ground. We can see that the gates are connected so it looks like this. And these gates are connected as well. So what have we got here? We've got another inverter. That's all that is. Okay so that's what this bottom section is. Okay, let's see where this gate goes. So here is this metal part over here. And I will draw out some contacts up here. So here are the contacts that feed that inverter. Let's see, there appears to be one here as well and here. So clearly it looks like there's probably going to be another bunch of transistors here that feed into this gate to the inverter. So here is a convenient transistor that's connected to VCC. So we know again that that is going to be a PMOS. But we can see that these two gates are actually not connected to each other. So let me go ahead and draw out those gates so you can see that. So here we have one gate. So let me draw the contacts for that gate. It's here. And let me draw the VCC diffusion. Okay, let's see. So let's draw the so-called floating diffusion. Okay, so let's maybe start labeling some of these transistors. So I'm going to go up here and I'm going to label this transistor Q1. This transistor down here is going to be Q2. And we're going to get say this transistor here is going to be Q3. And this transistor here is Q4. So Q1 and Q3 are on the bottom. So let's go to the sketch and say Q1 and Q3 are here. This is Q2 and this is Q4. Okay, so now we have another transistor over here. This one is Q5. We'll call that Q5. And there's another one that's going to be up here and we'll call that Q6. And it looks like there's another transistor here. We'll call that Q7. And I'm going to reserve judgment on that. So let me just delete that. Okay, so the gate between Q3 and Q4 is connected to an electrode on Q5, which is also connected to VCC. So let's draw that out. So it looks like it's connected to an electrode. The other side is connected to VCC. And it's a PMOS and that's Q5 like that. Now, so the question is, what is its gate connected to? Well, first of all, we can see that, let's see, there's ground here. Okay, so now I'm going to have to get a little bit more fine in my distinctions here. Let me draw this gate over here. Now, this gate appears to be connected only to this one contact right over here. That's pink and let me draw that contact. And the metal for that seems to go up to here, which is also connected to this gate over here. Let me draw out this part of the diffusion, which is ground connected. So I'm just going to go ahead and draw that out. I think it kind of sort of looks like this roughly. So that's the one side of the transistor. There's the gate and the other side of the transistor looks like it's just floating. So it's not connected to any power supply. Looks like also this part over here is not connected to any power supply. So this gate right over here, I'm going to call that the gate for Q6. And I'm going to make the font fairly small. So that's Q6 right over here. So basically a single gate is kind of forming a transistor. Because when you have diffusion separated by a gate, that's a transistor. This Q6 connects this floating diffusion to ground. Now we don't know how it's connected in relation to Q5 yet. It doesn't seem to be connected. Let's go ahead and let's draw Q6. So we've got a gate, a gate out, which is pink. So it looks like this. It's a little hard to see where this gate is going. But it kind of looks like this. So we've got Q5 down below, Q6 up above. And we can see that, oh well, Q6. Let's make that Q7. So it looks like the gate of Q7 is connected to the gate of Q6. And Q6 is a transistor between VCC and the diffusion, which is also connected to Q5. So let's draw that out. So it looks like, let's see, this. So we've got another transistor here, VCC. So this is Q6. And now I need to just look at the gates again. So, okay, so the gate of Q6 connects to the gate of Q7, which goes to ground. The gate of Q6 goes to the gate of Q7, which goes to ground like that. Okay, so we still need to figure out where that gate comes from, where does the gate from Q5 come from, and where does the other electrode of Q7 go. So the other electrode of Q7 is just floating. And there is also, this is the next transistor. So it is connected to the gate between Q3 and Q4. So we get something like, oh, and the gates are connected to Q5. So we've got a transistor on top of Q7, gate connected to Q5. So sometimes what I like to do in situations like this is label the nodes. So for example, let's go and label this node over here. I don't know, I'll just call it N1. Let me make it a little smaller because I have the suspicion that I'm going to need a little bit smaller font. Okay, that's good enough. So I'm just going to call that N1. Okay, so N1, you can sort of follow the metal and the contacts are over here. So the contacts are also over here. This is the gate between Q4 and Q3. And you can follow the metal up here and it looks like this part is also N1 and that part is also N1. So I could also label those N1, but hopefully I'll be able to find that. So let's also label this gate that's on Q5. So I'm going to label that with node 2, 2. And there's this other gate up here from Q6. So I'm going to label that node 3. Let's see, there is some ground here. We do know that this is a gate and it must separate two bits of diffusion. So there is actually a bit of diffusion in here, which I don't have. So I'm going to put that in in a moment. But in the meantime, let me also label this gate over here. This gate is actually N2, right? Because you can see that there's a contact. The metal goes down here and it connects to N2. So that's what that is. And in fact, if you look at N3, there's the contact over here. The metal goes down here and it connects to the gate on Q7. So that's also N3. So by labeling the nodes, I can just draw out the transistors and then connect them using these nodes. So there is this bit of diffusion right over here that we're going to have to label. So let me go ahead and label that with N4. And let me maybe make that a little smaller so that I can fit it in there. Maybe that will work. So there's N4. The diffusion that's above Q8, we already know, is N1. So now there's just this diffusion between what looks like N2 and N3. So let's see if I can put some diffusion there. So there's some diffusion over there and it doesn't look like it's connected to anything. It's just floating there so I'll just call it N5. We've got the gate. That's node 3. We've got ground. We've got node 3. There's another bit of diffusion over here which I need to put in. Put that in right there, say. And we'll just call that N6. And then there's the gate which we know is connected to N2. Then there's this floating diffusion which we know already is N1. And then there's some more floating diffusion over here that's not connected to a power supply. We'll just call that N7. Okay, and I think that pretty much labels all the nodes. So all these big bits of diffusion in Q5 and Q6 are all connected either to VCC or to node 1. So now what we can do is just go and draw out these transistors and see where they end up. Okay, so with all of the nodes mapped out I didn't actually bother to label any of these individual transistors where these gates up top are. But this is what I came up with. So we've got Q5 and Q6, the PMOSs, they're just large transistors and they're at the top. But basically all of that stuff with all of the nodes really comes down to two transistors. Each transistor is a parallel of four transistors. These nodes N4, N5, N6, and N7 are actually not connected. And I guess that doesn't really matter if they're connected or not because they're just transistors that kind of sort of do the same thing. So I think in effect these nodes are always going to be at the same voltage potential. So really what we have are two PMOS transistors up here, whoops, I should use my eraser, up here. And they're connected down here and here are their gates and they're connected to VCC at the top. And at the bottom we have two of these just like that. So let me just go ahead and erase this entire section over here because we know now that we've got essentially, you know, virtually two transistors at the bottom instead of all these, you know, eight transistors. Okay, and that actually, you know, just goes over to our two inverters over here on the output. Okay, so how does this work? Well, if we just take the top part and we call this A and we call this B, then so with PMOS, so if the gate is below the top electrode minus the threshold, then that turns the transistor on. So in other words, if A is zero or B is zero, that connects the output, which I'll call C to plus VCC. So if A or B are zero, then C is one. Well, I can just, you know, use De Morgan's rule over here and, okay, I'll do this. So I'll knot this part of the equation twice. Now one of the knots can drop down like this. This is just, you know, symbolic, right? So I'm just doing some symbolic manipulation and that's a NAND. Okay, but the only thing is, is that if both of these transistors are off, right, then C is just left floating, right? Because there's no resistor. Now normally, when you have a PMOS circuit or an NMOS circuit, you would have effectively a resistor that's formed from PMOS or NMOS. However, in CMOS, you have complementary logic. So we have to look at the bottom part, which is this, okay, and we have A and B, ground C. So again, an NMOS transistor is going to be turned on if its gate is above one threshold above the lowest electrode. So how can C be connected by these transistors to ground? Well, the only way is if both A are high and B are high, and that way C is low, or 1, 1, 0. So in other words, not C is equal to AB, or if I put the not on the other side, C equals not AB, which is a NAND gate. So in other words, these transistor circuits form the exact same logical equations, but using complementary MOS. And that's what CMOS is all about. And that's what this circuit over here is. So in fact, these gates are connected over here, and these gates are connected over here, and there you go. There's A and there's B. So this is the actual logical portion over here, which I will just draw out like that. So what's left? Well, we can see that this gate to Q5, let's see, gate to Q5 connects out through some stuff to A1. So let me just make sure that I've got that right. So the gate to Q5, well it's just going to be one of these things, right? So one of these pins is A1, and the other one is going to be B1, and there is B1. And they both seem to go through this weird circuit over here, and I'm honestly not quite sure what this is all about. I do suspect that this is just some sort of protective device, so there's probably a reverse bias diode in here. So here's the pin right over here, it goes through this large thing, which may or may not be a very small resistor, I don't know. This square over here may or may not be a reverse bias diode. I'm not entirely certain, and I'm not really certain what all this is about, and maybe somebody can tell me what it's all about. But I suspect that what's going on is just something like this. So there's A1, and here's B1, and the pin out here. That's exactly what is being shown, minus the protective diodes. So that's kind of a successful reverse engineer of this circuit, minus this weird signal thing, signal conditioning, signal protection kind of dealio. Again, I don't really know what's going on here. It's interesting because there's this ring over here, which is connected to ground. And then there's this other ring over here, which is connected to VCC. So there's ground on this ring, and then actually this other ring is not connected to anything, and then there's this VCC connected part on the outside. So I don't really know what that is. But anyway, if anyone has any idea, leave it in the comments. So I guess that's about it. That is a simple CMOS reverse engineering. So I may make another video about maybe a more complex chip, because this was actually fairly odd because all of the transistors are quite large and paralleled up together. And usually with more complex circuits, you've got the input side, you've got transistors on the input and transistors on the output. And those are the large parallel transistors, but the transistors in the middle are usually just single gate, they're not paralleled with anything. So maybe I'll look at a more complex chip, but I guess that's about it. So until next time, see ya.