Placeholder Image

字幕列表 影片播放

  • So the last video we started building this 16 bite memory, which is able to store 16 bites.

  • We've got four address lines here to select which of the 16 bites were reading or writing, too.

  • We've got eight data lines for inputting the data that we're gonna right into the memory location that selected with the address line.

  • And we've got our eight outputs that air buffered through this eight bit tristate buffer so we can output to a bus in this video.

  • What I want to do is, um, you started connect the address lines here to our address register.

  • And since the memory addresses just four bits, we can we can use the 74 l s 1 73 that we've used in the past, which is a four bit register.

  • So I'm gonna start by just getting another bread board and connecting it up here like that.

  • I'm also going to remove this this top one and connect the clock module that we built in some of the earlier videos.

  • And it's not that the clock module is directly related to the memory at all.

  • But just the final layout of the computer, we're gonna have the clock module just above the ram.

  • And now that gives us room in here that we can go ahead and put together a memory address register, which is gonna connect into our memory address lines here.

  • So I'm gonna get these out of the way for now.

  • Just move them all down here.

  • Just give ourselves a little bit more room.

  • So the memory address registered, we're gonna use the 74 l s 1 73 that we've that we've used many times before for registers and a look that up over here that's gonna be connected to the bus because a Darius points, we're gonna have memory address appear on the bus, and we want to bring that in and store that in the memory address register, which will then be connected to our memory to tell it what address too, to address.

  • And and then once that addresses set there, then we'll either output contents from the bus or we might input a new value from the bus into the memory.

  • But while we're inputting around putting for the memory, we need to store the address to which we're storing or reading from in this in the center's register s so we could just, you know, it seems like it be simple enough to just take these address lines and hook them up to this register.

  • And then whatever stored in that register will be the address that you were pointing to in our in our memory here.

  • But we don't want to just do that.

  • We also want to be able to program the computer.

  • And when we programmed the computer, we basically want to just switch the memory into a totally different mode where were able to set the address and set the data by hand with with, like, dip switches like this.

  • So we want to have some switches here that allow us to set what address were pointing to.

  • And then we'll have another set of dips, which is where we can set the data that we want to write into that memory location.

  • Eso We can program the computer by hand, and then we want to be able to switch out of programming mode and use this register.

  • So we basically want to we want these address lines to either be hooked up to the register or so that the memory can be addressed by data coming in from the bus or an address coming in from the bus or we want to be able to set the address with the switches and we want to be able to switch between those two things you can imagine.

  • We've got four bits over here of address and we've got four bits over here of address said on the switch is how do we switch between those?

  • Well, this is this is a fairly straightforward circuit that you can we kind of reason through that allows us to select between two different values.

  • So, for example, and this is just one bit so, for example, the first bit of our address that's stored in our register might be a and the first bit of our address on the switches might be bi on.

  • And then we can select which of those we want to use using the select signal.

  • And you can kind of see how that works.

  • Where if select is high than this, input to the end gate will be a one, um, which means that if this other inputs the end gate is a one than the outputs of one If this input zero than the output zero s o.

  • If we're If select is a one than this, a signal is just basically gonna pass through the end gate.

  • And because this is inverted, this and gate will definitely always be a zero because we'll have a zero coming in here on, and then the or gay will just be whatever is coming in a If select goes low than this, And gate is basically always gonna be off because we have a zero coming in here.

  • Um, and we'll have a one coming in here so this and it will pass through the B and then, of course, the or gate.

  • It'll be a zero or whatever be is and said the output will just be whatever b is.

  • So by setting the select higher low, we're selecting whether we want A or B to appear on this output.

  • Conveniently, there is a chip that does exactly this.

  • It's the 74 l s 1 57 which is a quad to line toe one line data selector.

  • So we're selecting between, you know, from two vines toe one line, which is which is kind of what we just described, and you can see here on the data sheet.

  • It has essentially four copies of that of that circuit, so you can see the two and gates in the or gate, which is what we were just looking at here, the two and gates in the or gate and then the inverter down here for select.

  • That's inverting, depending on which, whether they were they were selecting a the four A's or the four bees so single select that selects between all four A's or all four B's.

  • Um, this also, you can see there's 1/3 input on all of these and gates that goes to the strobe, which is basically just kind of a master enable.

  • So as long as this strobe is low than this third input, all these and Gates will be a one, and essentially that enables the whole chip.

  • So we'll just hide this low for for our purposes and and then it'll it'll essentially just behave like like this circuit that I just showed you.

  • So if you look at the pin out for the 74 less 1 57 you can see.

  • Of course, we have our select input selecting a or B And then you see there's an A B in an output A B in an output, uh, A B and output A B and output.

  • So it's basically four of these that are all tied to a single select.

  • And then, of course, we have our ground in our power and then the strobe line, which I say we'll tie low to just to enable the thing.

  • So this 74 less 1 57 will basically allow us to select, you know, toggle between.

  • Do we want to use the switches to set the address of our memory?

  • Or do we want to use the memory register to set the address of our memory?

  • So it didn't add the 74 l s 1 57 here we can connect the power.

  • Ah, and ground.

  • Here's who couldn't connect the power for that guy.

  • And then remember this pin 15 is this strobe which we just want to set low to enable this chip So we'll just set that low.

  • And then what?

  • We're here.

  • It can also connect the power for our address.

  • Registered 74 less 1 73 power and ground pull these ladies out of here excusing those for testing.

  • Yes, we got that powered up.

  • And then the 74 less 1 73 This is what it looks like.

  • And remember again, you know, it's got four D flip flops that air.

  • They're storing our four bits in a register, and we have our output control, which, if one and pins one and two are low, that our output has enabled, and we always want that to be the case.

  • So Well, go ahead and tie pins one and two low so that our output is always enabled.

  • And then we also have our our data enable pins nine and 10.

  • And that controls whether the input which is gonna come from the bus is being clocked in on the clock pulse.

  • So this is gonna be a control signal t to tell it to store whatever's on the bus in this register.

  • So that's pins nine and 10.

  • So hook pins nine and 10 together.

  • And then that's just a control signal that will need to set either high or low to control.

  • Whether we're storing a new value in here, then pin seven is our clock so we could hook that up to our clock up here, which we've now got nearby.

  • It's now these four pins here.

  • 11 12 13 and 14 are the inputs for a registered to those will be connected off to our bus at some point on and then our outputs our pens 345 and six.

  • So we can connect the outputs to one of the two inputs of the one of the 741 57 because it has these A and B inputs for the 44 bits that it has.

  • Um, so let's go ahead and connect the four bits of the register to the through the four B inputs and then we'll connect our dip switches to the inputs.

  • Okay, so now the outputs of our memory address registered or going into one of the inputs of our 1 57 74 1 57 selector so we'll be able to select either this or the dip switches.

  • So now, to hook up the dip switches to the other input of the 74 less 1 57 but I want to do is take advantage of the way that the inputs on these chips work, which is for most of these T TL chips that were using.

  • The inputs are tied high.

  • There's a resistor inside these these chips that connects the input two plus five volts.

  • So if we don't connect the switches to hear it all than a inputs on on, this will all be ones by default.

  • And if we then connect some of the inputs to ground than those inputs that we connect, the ground will be zeros and the rest of the inputs that aren't connected will be ones.

  • So what we can do is we can connect this to the switches and then the switches.

  • We can use thio selectively connect a pin to ground or not.

  • So, for example, for the first bit here, pin to is the A input pin three is the be input and pin for is the output.

  • So for the B input, we already have that connected up to our register for the input.

  • I can connect that to the first switch here on our dip switch.

  • And if it's off like this, then it's not connected in This is gonna be a one.

  • If I turn it on then it will complete the circuit over to this side.

  • And if I connect that side to ground, then turning this on will connect this to zero, and so on a zero and then off will be a one because it's not connected.

  • And I could do the same thing for the second bit.

  • Just connect the second switch to the input of our second selector here, and connect the other side of this switch again to ground.

  • And so if the switches off, then this input is defaults to a one.

  • If the switches on, then it connects it to ground.

  • And it takes this down to a zero same thing for the third bit.

  • In this case, the input is up here on the top side of the chip.

  • So I could just kind of run through the switch the other way and connect the ground down here.

  • And so then again, if this which is on, then it connects the ground to that pen.

  • If it's off, then it doesn't.

  • And so then it defaults to a one.

  • And then finally, for the last bit, I could do the same thing and connect to ground here.

  • One thing that's a little bit confusing about this is that when the switches are in the down position here when they're off, then basically we're inputting all ones.

  • And if they're up like this, they're all up there on That means that where we're connecting all of these inputs to ground.

  • And so we're inputting all zeros.

  • So it might be a little bit confusing because usually you would think down would be zero and up would be, ah one.

  • Unfortunately, there's ah pretty easy solution to that which is turn the switch around so that when the switch is down, it's on, and when it's up, it's off.

  • So now we have the 74 Ellis 1 57 which can select between either the dip switch input or the address register input.

  • But we need to have some way of telling it which one we want.

  • So gonna add a switch here that we can toggle between the dip switches and their address register.

  • And this is a double throw switch so we can connect the center pin here to ground, um, and then depending on whether which position the switches and whether we had pushed in or or pushed out.

  • It'll connect that ground to either the left pin or the right pin and says something I want to do just to make this a little bit.

  • I don't know.

  • Maybe a little nicer to use is have some indicator l ladies to tell us which position the switches in.

  • You can look at the switch and see, but I like having these indicators so we can tell if the computer which mode the computer is in because we definitely want to be able to tell pretty easily whether the computers and programming mode which will be the red led on or in running mode, which means that the green led is on so little do is connect the switch up here to both of these ladies.

  • So one side of the switch to the red led and the other side of the switch to the green led, and then the other side of the led will hook up to our five volts through these current limiting resistors.

  • And we need currently many resistors here because we're connecting when whichever position the switches and we're gonna be connecting directly from five volts through the led to ground And so, without a current limiting resistor will be pushing tons of current through the led will burn it out.

  • We don't need those in these cases because thes chips have resistors, essentially resistors on the collector side of the outputs.

  • So it's already going to limit the current that it can drive.

  • But in this case, we do need them.

  • And so if I go ahead and kicked up some power here just to kind of show you what we've what we've got so far, let me, uh, just hook up, connect my power all the way through here and then hook up power to this whole board.

  • Of course, we've got a clock going and something in our memory.

  • But what you'll see now is depending on how we toggle the switch.

  • It's elects either green or red, basically, um, but the other thing that happens is what this is really doing is selecting which of these two things is grounded.

  • And so in this case, the red led here is grounded In this case, the green led is grounded to complete the circuit from the five volts through the resistor here on.

  • So what we can do is we can connect.

  • You know the red led side here to pin one of the 74 Ellis 1 57 And pin one is the select pin which selects which of the two inputs we're gonna use.

  • And so if we're on the red led, essentially pin one, then goes low and we're, uh, see, which one are we selecting?

  • Self select is low.

  • Then it looks like we're selecting the A input s o if we're on the red led.

  • So if pin one is low, that were selecting A which is our dip switches So red led on means that we're using our dip switches, which means we're in programming mode because we're using a dip, switches to program the computer.

  • And then if we switch modes here, then this is no longer connected, and soap in one will default to being high, in which case it's gonna use input.

  • Two Herbie Rather and put B, which is our register over here.

  • And so we're gonna be using the address.

  • Register courses will make a lot more sense if we hook up the outputs of the study for Ellis 1 40 sevens.

  • We actually see what's going on.

  • Okay, so there's our outputs.

  • And now if we start here in run mode, it's gonna you know their output here will be whatever we've got in the register, which appears to be all zeros.

  • Either that or it's not working right.

  • And if we switch to program mood, then the output here should reflect whatever our dip switches shows.

  • 0011 makes sense.

  • We turn those off, it's all zeros, and you can see it's it's just, you know, whatever we put in our dip switches here is what we're getting out here.

  • And then we switch her back to run mode to see we get all zeros, and that's presumably what is stored in this register.

  • And we could try to get something else in this register.

  • I think if we set the input signal, uh, low here, we should see Well, I would expect it to read in all ones because none of these inputs are connected.

  • Um oh, but are reset signal is also not connected, so this is constantly being reset.

  • So, um, pen 15 is the clear signal.

  • So we want to keep that high.

  • Actually, I think we want to keep it low, right?

  • Okay, that might make more sense.

  • Yeah, we wantto We want our clear signal to be low so that we're not constantly clearing this, right, Because it would it would be defaulting to be high.

  • Um, and then if we bring our data enable low than it should read in whatever is on the bus here, which is which is gonna default all ones.

  • But we could try cooking a couple of these bits.

  • Let's just hook up to bits here to ground, um, and then set our our input signal low.

  • Okay.

  • And then on the next block cycle, I read that in, um and so that's what's in this register.

  • Now it looks like we can We can input a value into this register, and it shows up here if we're in run mode, and that if we switch over to programme mode, then we get whatever we said on the switches snow we need to do is just hook up our outputs here.

  • Which which right now we're just going to these ladies and actually hook them into the memory address.

  • Input of our our actual memory.

  • Okay, so now we've got our outputs hooked up to our address line inputs of our memory.

  • So it's gonna empower this back up again and so you could see it came up soaring programme mode.

  • So the 0101 that we have in our dip switches is what we're seeing here and we're seeing something random in memory, so I wouldn't really know what that is.

  • But if we change the address, we should see different things and there we go.

  • So if we go to address zero, we see that we got address one.

  • We see something different address too.

  • Something different address, three something different.

  • So there's something different in each address.

  • I mean, I guess we don't know for sure if we're addressing it, right, But I I mean, it seems reasonable that if we're going to different addresses here, we're getting different things.

  • And if we switch out of programme mode to run mode Ah, we see this goes back to zero and we see that we get this Whatever random thing was in address zero.

  • So it looks like we're able to switch between run and program mode and in run mode, we're gonna be using whatever is in our memory address registered and actually we can try toe put that value back in here if we switch this over there yet and we could see when that changes.

  • We got to a different address here.

  • If we go back to programme mode, Um, we're the same address that hears.

  • We see the same thing here.

  • If we change address.

  • Yeah, it looks like it looks like we're able now to change our address either in programming mode with our dip switches or we gotta run mode.

  • It's looking at whatever is in our memory address registered here, which we can set by, um, putting some value on these four pins here, which which will be connected to the bus and then we'll have a control signal to read from the bus.

  • So great.

  • Now, in the next video, we will try to do the same thing for our for our data lines because again when we're in program, But we want to be able to use the dip switch to set our eight data line so we can set an address.

  • We could set data, and then we can write that data into the memory and then we can switch back to run mode and instead of using the temperatures that will use whatever is on the bus, So in the next video, we'll basically do the same thing that we just did, but for data lines, and that should wrap up everything we need for our memory section.

So the last video we started building this 16 bite memory, which is able to store 16 bites.

字幕與單字

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

A2 初級

RAM模塊構建--第二部分 (RAM module build - part 2)

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