Placeholder Image

字幕表 動画を再生する

  • Is it a good idea to build an entire computer from scratch on bread boards like this?

  • Well, might seem like a strange question for someone who's basically made an entire YouTube channel out of doing precisely that.

  • And I sell kits with all the parts so you can do it yourself.

  • So obviously, I'm a pretty big fan of building computers on bread boards, and the big reason I really like it is that it forces you to think through how everything works.

  • You know, they felt like something was missing with these projects, where you get a premade circuit board and you just saw her a bunch of components to it.

  • And don't get me wrong.

  • It's great if you want to learn how to Sauder, But once you know that, I just don't see how attaching a bunch of components to a circuit board teaches you much about electronics.

  • In fact, the typical experiences that you saw her, the whole thing together plug it in, and it it just works the first time.

  • There's nothing to troubleshoot.

  • There's no need to understand how it works, and so you don't this.

  • On the other hand, you know it really forces you to think about each individual connection to each pin.

  • And as you build each section testing, you know each as you go, there's a very good chance things aren't going to work perfectly the first time.

  • And that's a good thing.

  • You know.

  • It forces you to think about why, and it helps you build a deeper intuition for how it all works.

  • And so that's what I really like about doing big projects like this on bread boards.

  • But aside from being a lot more work, which which I think is a good thing, there are definitely some caveats to be aware of when building complex projects like this on bread boards.

  • First, not all bread boards are the same.

  • There's a big difference in quality between the cheap $2 bread boards you can get and a higher quality, you know, eight or $9 bread board.

  • And it's true they look pretty similar.

  • But let's take a look inside.

  • Each row on the bread board is connected with a metal strip that grabs the wires that are inserted, and if I dig under the backing here, um, I can remove that metal piece so we could take a closer look at it.

  • And here it is, what it looks like, have we take a closer look?

  • You can see the wires air inserted like this here and make contact with metal here and in a good quality bread board.

  • These this metal, it's nice and flexible, and you can see even if you, Anna, insert the wired kind of weird angle like this.

  • It it flexes like that, um, and then pops back nicely.

  • You can also see it's nicely shaped so that when you insert the wire from the top, which is which is what you'd be doing, Um, you know, it kind of finds its way in there nicely.

  • So aah!

  • These make very good contact with wire spring back, So they last a long time on everything else.

  • Now let's take a look at the cheaper bread boards.

  • Construction on the cheaper bread board is pretty much the same, so it's actually pretty hard to tell the quality just by looking at a bread board.

  • Which is unfortunate because it means it's easy to pay for a high quality bread board and end up receiving one.

  • That's lower quality, and I may not even be the fault of the person selling it to you, since they may just not realise that there's such a big difference.

  • But anyway, here's the same piece from the cheap bread board.

  • So let's take a look at the difference, and you can see it's the same basic shape.

  • But right away you can see there's a huge difference here.

  • You know, the metal is just not, um, not a springy, and so it doesn't snap back together.

  • And so it may not make great contact with the wires you can see here, and it actually gets worse over time.

  • If you Ah, you insert something big, you can actually bend this out of shape.

  • And I mean, that's maybe a little bit extreme for what you might stick into a bread board.

  • But once that's bent out of shape, you know nothing.

  • You know you're not gonna make great contact there.

  • Um, and so the quality of this bread board in the quality of the connections you're going to get is much worse.

  • There's a big quality difference, and you can even see the, you know, just the shape of the of the top.

  • There where the wire goes in is very different, um, and much less consistent on the lower quality one.

  • So the quality the Bridgeport matters, you can run into a lot of problems building a more complex project like a computer on these cheaper bread boards, because you just can't be assured that all the wires are making good contact.

  • And you can check out my website for more information on what bread boards I recommend.

  • And, of course, if you get any of my kids, they're all gonna come with these high quality bread boards.

  • But okay, even with the best bread boards, there's still a lot of limitations to building a complex design, like a computer on bread boards, versus a custom printed circuit board.

  • Or even these, you know, Stoddard prototyping boards.

  • And that's because the physical properties of the conductors in a circuit, whether that's the traces on the printed circuit board or the wires and bread boards in something like this, you know, those conductors and everything have physical properties that affect the circuit.

  • For example, it's easy to look at two wires like this, you know, Let's say these two wires here and think well Okay.

  • You know, this wire connects this point here to this point here.

  • This wire connects this point here to this point up here, and maybe they don't really have anything to do with each other.

  • And that's not entirely true.

  • You know, anytime you have two pieces of metal close together like you have these two wires that are close together.

  • Maybe you actually have a capacitor.

  • And that's why the schematic symbol for a capacitor is two plates next to each other, but not touching.

  • And the way a capacitor works is you have a difference in electrical potential on either side.

  • And a charge builds up between these two plates and another way of saying that you have a difference.

  • Electrical potential between two points is saying that you have a voltage across those points.

  • That's you know, that's what voltage is.

  • It's always, you know, sort of a voltage measured between two points.

  • And it's just the difference in electrical potential between those points.

  • But with a capacitor in here.

  • If you try to change that voltage, um, the capacity rubble will actually try to prevent that.

  • Yes, if you try to increase the voltage Bye bye.

  • You know, adding more charge to one side, the capacitors actually gonna absorb that charge and charge up a bit before the voltage between these points actually changes.

  • And then if you try to decrease the voltage hereby, by pulling some of that charge away, the capacitor will discharge as much as it can to keep the voltage from dropping.

  • And, you know, sometimes you want that.

  • So, for example, in the power rails usually don't want the voltage to fluctuate, right?

  • We have five volts coming in.

  • And you know, we want five volts everywhere on our power rails to be actually five volts.

  • We don't want a dropping and things like that.

  • So if a if a chip is switching circuit on and off, and it has to draw more current to do that, we don't want the voltage on that power rail to drop.

  • And so it's actually a good practice to add some capacitors just across the power rail like this.

  • So actually, at a couple of 0.1 micro fared capacitors here across the power rails to help stabilize the five volts that are on this power rails and really the best practice here is to have one of these capacitors for every chip that's on in your circuit.

  • So, for example, we could have a capacitor here directly from five volts to ground across this power rail four for this chip here like this.

  • And that means that if this chip has has any change in the amount of current it needs to draw from the from its power rails, it's always going to see a consistent five volts or as close a cz close as we can get to that.

  • And the closer you can put the capacitor to the power inputs for any particular chip, the more the better stabilized the power's gonna be for for that ship.

  • And that's I guess one of the other maybe drawbacks of bread boards is that it's, you know, kind of hard or at least inconvenient.

  • To get these capacitors directly across the power rails of a chip like this, you've got to kind of put it across, and some of these chips, they're the powers were just kind of in an inconvenient place.

  • But I think you know, for what we're doing, it's probably good enough just to have a couple capacitors here these will still help stabilize the power rails without really getting in the way too much.

  • That's fine.

  • You know, we can add capacitors here if we want to stabilize the voltage and keep the voltage from changing like we do on our power rails.

  • But elsewhere, you know, we have signals that need to change voltage rapidly.

  • You know, any of these signals need needs to change full to drafted Lee because they're carrying signals on DDE that has to change.

  • And so the stray capacitance that inherently exists in the bread board we're even a printed circuit board can cause problems.

  • And, you know, since one factor that determines how much charge capacitor can hold is this is actually the physical area of the conductive plates.

  • In that capacitor, you're more likely to have a lot more capacitance in a bread board circuit just because you've got a lot more metal in here, you know, in the bread board and in all these wires, then you might have in other types of circuits.

  • Now, another related phenomenon is induct in CE, and if you've learned a little bit of physics, you might know that any time you have a current flowing through a wire like this.

  • There's a magnetic field that has generated around that wire.

  • Course, if you have a lot of wire, uh, especially wound up like this, you can use that magnetic field to do work.

  • And that's how the motor works.

  • And that actually works in reverse as well.

  • Right now, I'm using current to generate a magnetic field that's pushing against this fix magnet here.

  • But any motor is also a generator, and that's because a changing magnetic field around the wire will induce a voltage in the wire.

  • So when I spin this, the magnetic field from the permanent magnet changes relative to the wire and induces a voltage in the wire.

  • So what does this mean for a bread board computer?

  • Well, you know, if you've got a wire with the current going through it, you're gonna have a magnetic field around that wire.

  • And if the current flowing through the wire changes, then the magnetic field is gonna change.

  • So So if we go from a smaller current to a larger current, we're gonna go from a smaller man magnetic field to a larger magnetic field.

  • Remember, if you have a changing magnetic field around the wire than the voltage that'll induce a voltage in the wire.

  • And it just so happens that the voltage that's induced will oppose the change in current and say, you've got capacitance, which opposes a change in voltage and induct in CE, which opposes a change in current.

  • And both effects are relatively small.

  • Unless that voltage your current is changing very rapidly.

  • Well, how rapidly you know if we take the 65 02 computer that we're building?

  • I've said that I plan to run this at one megahertz.

  • So are we gonna have any issues with one megahertz signals?

  • That's potentially alternating between zero and five volts a 1,000,000 times per second.

  • You know, that could be a problem.

  • Well, we can run a little experiment.

  • I've got a bread board here with a bunch of connections, and I can feed a signal in on one side, and you can see I'm measuring that signal as well.

  • If we look in the telescope, you can see there's this 100 kilohertz sine wave that we're measuring going in, and so that goes in on this side, and then it goes through a whole bunch of connections and we can measure it coming out over here.

  • I also have a resistor here to kind of isolate the input and output measurements.

  • And aside from that induced current that we're gonna be looking at that I mentioned, I don't expect any current flowing through that resistor.

  • So Holmes Law says no current flowing through it means no change in voltage.

  • So we should measure the same voltage going in here and coming out over here.

  • So here's the signal going in.

  • It's a one kilohertz sine wave and we're measuring that over on the left here.

  • But we can also measure the output on the right.

  • And so if I overlay that you can see it's pretty much the same thing.

  • And you know, that's not too much of a surprise, since we basically just have a wire going through the bread board.

  • But if we increase the frequency and can dial this up, so that was 100 kilohertz.

  • So if we keep going up when goto 1 May one megahertz zoom in here and it still looks like pretty much the same signal going in and out.

  • But if we keep going higher and higher frequencies zoom in here, actually, start to see something happening here.

  • You see the output, which is the yellow actually, the yellows, the input C C, C C the green, which is the output is actually shifting a little bit from the yellow.

  • So there's there's a phase shift happening there, which is kind of interesting.

  • And that is perhaps because that induct ins's and capacitance that I talked about is gonna resist.

  • A change in voltage is gonna resist a change in current.

  • And so it made delay on and actually caused that phase shift.

  • So we're starting to see that.

  • And if we go higher and higher frequencies, you'll see, not only does the phase shift increase, but you also see the green, which is the output is actually decreasing.

  • So it's starting to attenuate.

  • And so if we go higher and higher frequencies and that's about as high as we can go up to 20 megahertz is is high, as I could go with this.

  • But you can start to see that the green signal, which is our output, is being attenuated.

  • It's being phase shifted and it's being attenuated and actually what I could do is I can automatically sweep through all of the frequencies here.

  • So do Ah do a Let's see frequency response, analysis and run analysis.

  • And what this will do is actually sweep through all the frequencies from 100 hurts all the way up to 20 megahertz, which is as fast as this will go.

  • And what you're seeing is it's plotting the phase shift, which is, I believe, the red lines so you could see that staying pretty close to zero and then it's also plotting the gain or, in our case, attenuation, which is the blue line.

  • And that's also staying pretty close to zero.

  • And here we are, at 100 kilohertz and still pretty close to zero.

  • As we approach one megahertz, you see, the phase shift is starting to change, and that's you know what we saw when we're looking at it ourselves.

  • And then as we get, um, you know, looks kind of five megahertz or beyond.

  • We're starting to see The blue line is also dipping by a few decibels.

  • Is that showing that it higher and higher frequencies?

  • We're starting to lose some of our signal integrity.

  • Something else is kind of interesting if we go back and just look at the way forms here, remember that the attenuation in phase shift that we're seeing is a result of both capacitance between conductors here as well as induct in CE, which is actually a magnetic field that's generated around these conductors.

  • So if we actually change sort of the physical shape, here are properties or, you know, sort of relationships between the different wires, you can see just as I poke it this that the phase shift and the attenuation that we're seeing is changing a bit as well.

  • And you know, this is a 20 megahertz, but I I think that's pretty interesting to see that she conceded higher frequencies.

  • We are starting to see some signal integrity issues.

  • But you know, we want to run our computer at one megahertz here and one megahertz looks like, you know, no problem, right?

  • Were you know, still zero attenuation are ah, phase shift here hasn't shifted by very much at all.

  • One megahertz and even the attenuation that we do see is exaggerated quite a bit Because of that resistor, I added to make this more of a worst case demonstration.

  • So even in this pretty messy scenario that we've got here, things look pretty clean upto one megahertz.

  • So we ought to be fine, right?

  • Well, it's not so simple.

  • That o'clock for the computer is one megahertz, but it's not a sine wave like we've been looking at.

  • It's a square wave, you know, just toggles from 0 to 5 volts.

  • But in reality, any signal, including a square wave, is actually made up of sine waves.

  • So here's a one megahertz sine wave and I'm generating with this first formula here, which has a frequency of one million and so you can see the period.

  • Here is one times 10 to the minus six there, one microsecond.

  • So So that's one megahertz.

  • But of course it's a sine wave.

  • We're looking for a square wave.

  • Well, we could get closer to a square wave by adding another sign wave to it.

  • So here is a three megahertz sine wave, and I've made it 1/3 of the amplitude.

  • And if I add these two together so f of X and G of X, if I add those together, we get this, which is a little bit more square shaped.

  • But if I add to that H of X, which is a five megahertz square wave 1 50 amplitude so we add h of X, you can see it gets a little more square shaped and we can keep going.

  • I can add this next sine wave, which is seven megahertz and, he conceded, gets even more square shaped.

  • You know, the slopes are a little bit steeper here.

  • The tops are a little bit flatter.

  • And in fact, to get a true square wave, we could add up all of the odd numbered multiples of the fundamental frequency, which in this case is one megahertz.

  • And if we add all of those up all the way to infinity, that would give us a true square wave.

  • So let's take a look at this other set up here that I've got.

  • I've actually got a formula here that represents the sum of odd numbered multiples of a one megahertz sine wave.

  • And get this to K minus.

  • One factor in here is well, is the dividing by two K minus one.

  • So if Kay goes, you know 12345 then two K minus one is going to go 13579 So that gets all of the odd multiples.

  • And then we're summing up all of those four K going from one all the way up to in which right now and is also one.

  • So right now we're only getting the first term, which is why we just see that one megahertz sign wave.

  • Then I've got some other stuff in here just to kind of scale this up.

  • And ah, we're adding 2.5 here just so that this this wave overall goes from around zero at the bottom to serve around five at the top just to kind of give us something like that 0 to 5 volt square wave that we're looking for.

  • But now this makes it easy for us to add more terms because I could just change that end.

  • And so this is where we were before, with n equal to four with four terms.

  • But we can keep going, and the more and more terms that I add, the more and more it looks like a square wave.

  • But also the more terms that we add the Maur, the higher the frequency So this looks like a nice, sharp square wave, But the frequency you know, their maximum frequency that I'm using to get that is over 100 megahertz.

  • So, you know, in reality, because high frequencies like 150 megahertz are gonna be very susceptible to small amounts of capacitance and small amounts of induct in CE like we've got in in a bread board circuit.

  • We're definitely not gonna see, you know, perfect square waves with perfectly steep slopes like this or anything like that in real life.

  • The question is, is that a big deal?

  • Well, my last video, we looked at this timing diagram for the 65 02 CPU, and we figured out that we weren't gonna have any problems come complying with all of the constraints that are set out in here.

  • But there's one natural timing requirement that I kind of glossed over that actually turns out to be one of the hardest constraints to meet.

  • And that's, you know, this time here, this t F, which is the fall time and t r, which is the rise time of the clock.

  • So what is that requirement?

  • Full time and rise time Well, we flip over here, we can see full time rise.

  • Time is a maximum of five nanoseconds.