Placeholder Image

字幕列表 影片播放

  • So in previous videos we've looked at the or gate, which, if you remember in this case we have two inputs of what input or the other or both are on.

  • Then the output is on.

  • Otherwise the output is off this video.

  • I want to start thinking about scenarios where we have a gate where the output is connected, back to the input or or some Siri's of gates, where the output is connected, back to the input.

  • And so you might think, Well, maybe we can just come up with the truth table like this.

  • Or the input could be there a zero or a one if it's a zero than the output ought to be something.

  • And if the one of the output might be something different, But we'll see is that is that it's a lot not quite as simple as that eso to build a little bit of intuition for what's going on here.

  • I think it's easiest to gotta build a circuit and kind of see what happens.

  • So this is that circuit.

  • It's got a chip business a 74 l s 32 chip, which has four or gates on it.

  • Ah, and this is the pin out for it.

  • And you can see with the four gates you've got a B.

  • And why are the input a input be?

  • And why is the output so that the 1st 3 pins and this chip is upside down.

  • So it's these 1st 3 pins here and what we've got.

  • Just like the diagram here is input A is connected to the switch.

  • Input be is connected via this little blue wire to the output, and then we also have an led connected to the output, and you might be wondering if we need a resistor for this led.

  • But if if we look again at the data sheets for the 74 l s 32 there's already on the output.

  • There's already a resistor here connected through this transistor.

  • And so when this is switched on that the gates on, we already have this 120 ohm resistor built into the into the chip Here in this in this case, that's gonna limit current, So we should be okay with that Led.

  • The input is connected to the switch which, uh, it's actually connected across this resistor to ground and then when we push the button, the button will will connect us to this five old source here.

  • So if we're not pushing the button, it's in putting a zero.

  • If we push the button, it's in putting a woman.

  • This is a momentary switch.

  • So let's, uh, the power up and see what happens.

  • So power up and you could see the output is off.

  • And so that kind of makes sense.

  • Maybe the imports start as zeros, and so zero and zero should give us give us a zero output.

  • And, of course, if that's a zero, then that's gonna feed it another zero back into this.

  • Be so it just stays.

  • Everything's a zero.

  • Does that make sense?

  • Now let's see what happens if we change the input to a one by pushing the button.

  • So if you push the button, the inputs, the ones with one and a zero, we get one as the output and we see the output comes on.

  • But actually this output is now coming back into this input, so B is a one as well now.

  • So, actually, we've got we're pushing the buttons.

  • We gotta one coming in a We got a one in being into the output is still one.

  • But now, if I let go of the button A is now zero B is still one, and so the output is still one.

  • And so this this stays on, even though I've now let go of the button.

  • And in fact, if I keep pushing the button, there's really nothing I can do to get this to turn off.

  • Once this input turns on, even if it turns off later, the output stays on, it latches on.

  • Essentially, it's really the only way to reset.

  • This is to disconnect power from the entire circuit, and then, you know, we could reconnect it.

  • And then, of course, it starts out zero again.

  • But if at any point after this thing is powered up, that input ever goes to one, even if it's just momentary.

  • If I just hit it really quickly that I'll put latches on and remembers that that input was at one point a one, so that's pretty interesting.

  • And you can imagine why we can't just come up with a simple truth table like this like we might like to.

  • But what would be even more interesting is if we had some way to turn it off again, some other way to reset this other than having to disconnect power from the entire circuit because that might not be too practical.

  • So what I want to do is look at another circuit that actually does work that way.

  • And this is this is that other circuit?

  • And this might look a little confusing at first, you know, but we'll walk through it.

  • One thing you'll notice is different.

  • We're using, nor Gates instead of or Gates.

  • So it's the same as in or gate, but the output is inverted.

  • We'll talk a little bit more in a minute about that, Uh, and again, I think you know a good way to build some intuition for for this is to actually build the circuit.

  • And so I've done that here.

  • Uh, this This chip now is a quad, nor gate.

  • It's a 74 l s zero to chip, which has four.

  • Nor Gates.

  • Of course.

  • We're just using two of them and to kind of walk through what's going on in here.

  • The bottom pin here is this bottom input, and then the next pan up is this input here and you can see the yellow wire is connecting it to the output of the top congregate.

  • The third pin is the output of the bottom nor gate here.

  • Ah, and you can see that's connected to a lady so we can see what the output is.

  • And you also see this little yellow wires connecting it to the input of the top nor gate.

  • The other input of the top nor gate is connected to this blue wire to the switch here so we can set the input there on.

  • And then finally, the output of the top litigators we saw.

  • We've got hooked to a led here, and it's also going back down to input on the bottom or gate.

  • And again these switches air hooked up so that they're normally a zero.

  • And when we're pushing them, they're one.

  • So let's ah, you know, before we think to too much about this, let's let's just sort of power this up and see what happens.

  • I was like to kind of build the thing and see what happens.

  • Good.

  • Plug it in and the top led comes on, so this nor gate on the top is switched on.

  • So this is basically what is happening here.

  • So I've kind of drawn exactly what states different things.

  • Aaron, to kind of make this a little bit easier to understand.

  • Um, and also as a reminder, got the truth table for a nor gate.

  • So again, if either input one input or the other or both are on, then it's off.

  • Otherwise, it's also sort of the opposite output oven or gate.

  • So in this case, the top or gates is on, and so we see the led there on.

  • That implies that this input down here must also be on.

  • And so if we just kind of reason through this, hopefully it'll make sense.

  • So the bottom nor gate.

  • We've got a one in a zero.

  • And, of course, this one.

  • For some reason, this topic lady came on.

  • We'll talk about why a little bit later, but for now, we'll just sort of take it on faith that it's on because we can see that it's hon on The bottom is zero, cause we're not we're not pushing this button, so that's a zero.

  • So one and a zero means that the output is a zero and it makes sense that we see the bottom led is off.

  • And so then that's being fed back into the top.

  • Nor gate.

  • And of course, we know we're not pushing the top switch either.

  • So it zero and zero going in here, which means that the top nor gate should be on, and that's what we see.

  • So this hopefully makes some sense.

  • So now what happens if we start changing these inputs?

  • So the bottom input, it's fairly straightforward.

  • If we turn the bottom input on, then this gate will be.

  • The input will be one and one and we could see the output.

  • Then it's still zero.

  • So this doesn't change, which means this top.

  • Nothing else changes.

  • So if we change this bottom, if we can put a one, if we push this button, um, nothing should happen.

  • And in fact, nothing happens.

  • We can push this button as much as we want.

  • Nothing's changing because we're just going from 10 toe 11 You could see 1011 The op.

  • What stays the same here doesn't change this.

  • Nothing changes.

  • Now the top one is a little bit more interesting.

  • So if we push the top button, we're basically changing this year to a one says I just redrawing the circuit here, Um, and I'm changing just this top input to a one.

  • If we do that, the top gate now has inputs of one and zero and so one and zero it ought to change.

  • It ought to turn off an output zero here.

  • What does that that puts us here?

  • So 10 zero's That makes sense.

  • But now that changes the input of the bottom gay.

  • And so now the bottom gate is getting a zero and zero coming in, well, zero and zero, we're coming in.

  • The bottom gate ought to be out putting a one.

  • So then it's going to switch on.

  • And when it switches on, that changes the input on the top gate again.

  • So now the top gate is getting a one in a one.

  • Well, in that case, a one in a one is still a zero, so the top gate doesn't switch.

  • It's already off, and so now the circuit is stabilized in this configuration.

  • But what you see happens is, before we had the top led on or the top gate on.

  • And at the end of this whole sequence of events, the bottom gate is on the top.

  • Gate is off.

  • Let's give it a try.

  • Push the, uh, button here on top.

  • Indeed.

  • We see the top goes off the bottom comes on tour now in this state and really it it did actually flip through all three of these states.

  • Thatjust happened very quickly.

  • I mean, on the order of nanoseconds.

  • Really to get to this state here.

  • Well, now, if we release the top button and this goes to a zero that puts us in this state here and a zero on a one input on the top gate is still gonna output 00 No one is still zero.

  • And so nothing changes.

  • And so now, with both inputs off, we've swapped which of the gates is on.

  • So this is essentially a mirror image of where we started.

  • We started with the top gate on the bottom.

  • Get off!

  • Now we have the bottom gate.

  • Excuse me?

  • The top gate off in the bottom.

  • Get on.

  • And since this is the mirror image of this, you know, now pushing the top button doesn't have any effect.

  • Where's before?

  • Remember, we're approaching the bottom button.

  • It didn't have any effect, but pushing the bottom button is basically going to run through this same sequence of events, but sort of in a mere image and flip from the bottom to the top.

  • And now the bottles have in effect.

  • So you can see by pushing these buttons, we can kind of flip it between one state and the other.

  • And then once it's in that state, it stays in that state until we until we push the button again, we're going to push the other button, I should say.

  • And this is a fairly common circuit and it has a name.

  • It's called.

  • Uh, it's called a S R latch and S R stands for set reset because the latch can essentially be set or reset.

  • And so these inputs are labeled, you know, typically labeled are s.

  • And then the outputs are labeled Q and inverse, Cute or not cute.

  • And the way to sort of think about this is that if you want to set the Q output, then you input a one on the on the S input or the set import.

  • So this sets it in the sense that the output cue is on.

  • And then this resets it in the sense that the opera Q is off and then in verse.

  • Q is just always the opposite of whatever Q.

  • Is.

  • And so sometimes you might see this, uh, this s our latch in circuit diagrams just as a box.

  • We'll draw it like this, and it'll have these inputs and they'll be labeled R and S and the tell You'll know it said as our latch.

  • And it'll have the outputs Q and not Q and then usually have a little bubble here to show that that's an inverted output.

  • And so, if you see this in a circuit diagram, you could basically think of it as this as this circuit or something that works equivalently in the sense that if you press the if you're if you input a one on the on the set input, then the Cuba will latch.

  • Hi, and if you put a one on the reset input, then the queue will latch low, and then the knock, you will sort of do the opposite, and you might be wondering, you know what happens if you input a one on both the set and reset at the same time.

  • And in that case, the outputs are both, you know, both Cuban knock you go.

  • Go low.

  • And, you know, sometimes you might see this referred to as an invalid state.

  • Because you you you know, if you're sort of using this as a set reset latch, you should only be setting it or resetting it at any point.

  • Time shouldn't be doing both, so sometimes you might see that as an invalid state.

  • The other question you might have is you know, when we first when we first power this up, you know, it started with this top gay on on the bottom gate off.

  • And you might be wondering why You know why?

  • Why did it prefer the top gay?

  • This thing is, the circuit is fairly symmetrical, and really it's It's just kind of almost random or or arbitrary which one which one turns on first?

  • Because when it first starts up, all of these inputs or zeroes And so if both inputs are zeros, both gates want to turn on, and in fact, both gates might turn on, but what'll happen is one of them will turn on maybe a little bit faster, and this signal will get to the other gate.

  • And this other gate will now have this one input into one and a zero will turn one of the gates often.

  • So it's really just a question of which one turns on first.

  • It's, you know, usually, you know, probably the order of a few nanoseconds or one is just a little bit faster than the other on, so it just serve arbitrarily.

  • One of them is gonna turn on first.

  • And so if you're using the circuit in an air of using this, you know this s are latching a circuit.

  • You're gonna want to make sure you you have some way of resetting it or setting it or getting into some known state before you rely on its output.

  • I suppose so.

  • Because the S R latch has this property that you can set and reset it, and it remembers the state that it's in.

So in previous videos we've looked at the or gate, which, if you remember in this case we have two inputs of what input or the other or both are on.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

SR鎖存器 (SR latch)

  • 2 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字