Placeholder Image

字幕表 動画を再生する

  • So in the last video, we took a look at the S R latch, which is the slash that has two inputs a set in put in a reset input.

  • And if we input a one on the set in put it sets the latch and the cue output goes high.

  • And then if we input a one on the reset, it resets.

  • The latch on the Q output goes low.

  • In this video, I want to look at trying to build a latch that has a single input.

  • So instead of having one input to reset it in another input to set it having a single input, that when it's zero, it resets it.

  • And when that input is a one, it sets it.

  • So you might think, Well, that's easy.

  • We can just put an inverter here, and so if our input is a one, then it sets it.

  • And, of course, our inputs inverted to the reset zero.

  • And if our input zero, then it's not setting it.

  • But if we invert that zero, we get a one up here and it resets it.

  • Let's try and build this and see what happens.

  • So here is the circuit, and basically it's the same as before.

  • So we've got the two nor gates here, connected just like this.

  • And then the set input is connected here, to this button to our single input.

  • And then the button is also connected through an inverter to the reset.

  • And so this is the re set up here and it goes through an inverter.

  • And to invert, I'm using this nor gate to this.

  • This chip has four, nor gates on it.

  • And so, rather than having another chip that has an inverter on it, you can actually use a nor gate as an inverter.

  • Because if you look at the truth table for the nor gate, you see, if both inputs are zero, then it outputs a one of both inputs or one hit output zero.

  • So if you ty both of the inputs together, you can turn a nor gate into an inverter.

  • So this is just kind of a little shortcut, since I've already got the nor gates on this chip and I'm not using all four of them s o.

  • This switch is going into both inputs.

  • Little jumper here connects both inputs and then the output of this nor gate that's now an inverter is going into the reset.

  • So let's see what happens.

  • Okay, well, the input is off and the latches reset to the Q A zero.

  • The knock you is his one, and if we turn the input on the Q goes high it so it sets it, Um, and the knock you is low.

  • The problem is, it's not actually latching anything anymore.

  • It's not, uh, it's not serving as a memory or or storing anything.

  • It's just whatever the input is, then Cue is the same thing, and not Q is the opposite of the input.

  • It is not super useful.

  • So we need to do is find a way to tell the last part of this when it should latch the input and when it should just ignore the input.

  • And so way to do that is to have an enable option essentially or enable input.

  • And this is an example here of adding and enable to the S R.

  • Latch.

  • So this is rs are latch that we're that we're familiar with, um, and instead of just having the reset and the set inputs directly going to the latch we have them going through these and gates.

  • And so in order for this and gate to output something both inputs have to be on.

  • So this has to be this and this had to be on in order to get an output here.

  • And so by using these and gates, this gives us an enable input.

  • And so, as long as the enable input is off or zero, both of these outputs thes and gates are gonna be here to, regardless of what the reset or set ISS.

  • So that's basically gives us a way to kind of turn on the latch and turn it off.

  • So let's build this and just to kind of get a better intuition of what's going on.

  • So this is that s r latch with enable.

  • And so what's going on here?

  • It's a bit more complex, but down here is our nor Gates, just like we've been seeing before.

  • Ah, and the outputs are connected.

  • The inputs, that's what these yellow wires are these cross wires here and then the inputs, the reset and the set or these blue wires.

  • But instead of going directly to switch, is there now going to n.

  • Gates, and this is a 74 08 quad and gate chip.

  • And ah, we're using two of the N Gates on this chip.

  • And so one of the and gates outputs is going to reset.

  • The other is going to set.

  • The inputs are going are coming from either the reset button, which is this across this green wire or the set button, which is which is this button across the other green wire and then the enable is this button up here is connected to both?

  • Uh oh, our input of both and Gates.

  • So this is this is basically a S r latch with enable, So it's just like the S r latch, but we now have this enable thing.

  • So let's take a look at how this works to be powered up.

  • Looks like it started up in the in the set state cause Q is is high.

  • But just like the regular S r latch, it's just gonna kind of randomly pick one state.

  • Um, and if we try to reset it or set it, you can see that pushing these has no effect.

  • And that's because it's not enabled what we have to do is enable it by pushing the enable option here.

  • And now that it's enabled the set and the reset, we'll work just like before we can set it and reset it.

  • And so if we reset it and then let go of the enable Now the set and reset don't do anything.

  • We turn on the enable we can set it.

  • And then if we turn off the enable, it stays set.

  • And now the satin reset.

  • Don't do anything.

  • So we have This s our laps that we can set in reset on Lee when the enable is on.

  • And so now that we have this enable option, let's see, let's try and put that inverter back in and see what we can.

  • D'oh!

  • So here's Here's the same thing.

  • We've got the set and reset here, going through the gates, we have our enable and now we're hooking this inverter up.

  • And so we have a single input coming in here and we can either set it by setting this high, which will set the latch.

  • Or we can reset it by setting it low, which will then set the reset high in the set low but it'll only change when we've enabled it.

  • So if we look at that circuit, we've got our nor Gates.

  • Just as before.

  • We've got them hooked up with the two inputs.

  • And so this is the reset in the set inputs over here are these blue are the blue wires and then they go into the air they come from, I should say the and gates and we're using to end gates here is well and then the inputs for the end gate.

  • One of them is the enable and that's this top button here.

  • And so you can see these two yellow wires are going to an input on each of the two end gates and then the input, which I've labeled as D for data.

  • I guess the input is this the second switch here, which you concede there's a green wire that's going into the input of the sort of the bottom and gate, which is the set.

  • And there's another green wire that goes back over here and again.

  • We're using one of the nor Gates has, ah, as an inverter.

  • And so it's going into two inputs of that nor gate, and then the output of that nor gates of the inverted.

  • Ah, the inverted signal from that, nor gate is then coming back into the top end gate.

  • So if we powered up and take a look, it powers up.

  • It looks like it's set at the moment.

  • I've also added an led here, So the input you can you can see whether I'm pushing the button here and so you can see the input is changing this.

  • This input is changing, and now the outputs not changing on that's because the latch is not enabled if we enable it by pushing the top button.

  • You can see now that when the input changes, the output changes to follow it.

  • But if I if I turn off the enable, it latches in the in in this case resets state, and then if I turn on enable than I said it, and then I turn off, enable it now latches enabled.

  • And so this is usually called a D latch because it will latch a single bit of data because we're you know, we can use this as part of ah to build a memory or register or something in a computer to store one bit of data, and if you see there's there's a block symbol for it as well, which has has this blocking.

  • It has the D input, the enable input and then the Q output, as well as the knock you out put, which is just always gonna be the opposite of Q.

  • In fact, normally, if we were using this to store a bit of data, we we would probably just ignore this.

  • Q.

  • And so, in fact, we could do that, and we just pull the led up and that'll weaken, basically ignore it.

  • And so you can see what's stored in this D latch right now is a one.

  • And so then, if I enable it, and then I changed that to something else, maybe a change it to a zero.

  • Now what's stored in the D latches?

  • A zero and again I can enable it, and it follows whatever the input is.

So in the last video, we took a look at the S R latch, which is the slash that has two inputs a set in put in a reset input.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

A2 初級

Dラッチ (D latch)

  • 4 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語