Placeholder Image

字幕表 動画を再生する

  • So if we want to build some kind of output display for a computer, we can use a register just like we've built in the past, where we can push a value into that register and then have some way of displaying the contents of the register.

  • And this would be the output of the computer.

  • It's on this case.

  • You can see we have a nice binary output for for the computer, but would be much nicer is if when we put contents into that register instead of getting a binary output, we get a nice decimal output like this, which is much more user friendly.

  • Let's take a look at how these display modules work so you can see there's some pins on the back.

  • And then, of course, our display here.

  • And here's the data sheet that comes with it, or I guess, just sort of the packaging, and it comes in a couple different kinds.

  • The one that I have is blue, and it says common in owed.

  • What that means is that there's a bunch of ladies inside this package for each of these different segments and all of the anode they're tied together, says the positive side of the of each of these ladies are tied together and on pins three and eight.

  • So spins three natures.

  • The middle pins on both sides.

  • This is pin three and then this is pin eight here in the middle on the other side.

  • And then the rest of the pins just control the different segments.

  • We could hook this up on our bread board, and I'm gonna connect the anode.

  • This is the common anode, which is either pin three or pin eight to our five whole supply.

  • So this is Penn ate up here.

  • We're gonna connect that with a 100 ohm resistor.

  • And that's because this is the blue one.

  • So it's gotta three volt forward voltage.

  • Which means that the resistor needs to drop two volts is three plus two is five on.

  • I'm guessing it doesn't actually tell me the current draw on this thing, but I'm guessing 20 millions would be good.

  • So 100 ohm resistor should should work fine.

  • I'll connect power noses, this five volts, and if we connect ground any of these other pins, we should see stuff light up.

  • So this is that first segment second segment third segment for 1/5 sixth and this is the middle segment.

  • And then down here is also the decimal point.

  • And so you can see the inputs to this thing.

  • Don't really let us input numbers per se.

  • You know, we're not we're not.

  • There's not a binary input that just then displays a number.

  • We have to display numbers sort of on our own by lighting up just the right segments.

  • So if we want to light up the number one, we have to connect those two segments.

  • If we want to dio the number two, then we have to find all all the right segments for number two.

  • So it's those two.

  • It's it's probably this one and then this one down here and then finally this bottom one.

  • And that's how you get the number two is we have to have to manually know exactly which segments delight up to get each number.

  • But of course we have a binary number that we want to display.

  • So how do we How do we convert that?

  • So a good approach when you don't know how to solve a problem is to try to simplify the problem on Dhe try to solve that simpler problem.

  • So in this case, let's let's try to solve this problem, for we only have four bits.

  • So instead of thinking about eight bits and how we display that with three digits, let's think about how we display four bits.

  • Eso these air.

  • This is essentially what we want to display for each of these bits, you know, zero through nine, and then when we get above 9 to 10 instead of trying to display, that is two digits weaken.

  • Display.

  • Those as letters on this would basically just give us a hex decimal display.

  • So instead of 10 11 12 and so forth, we have a, B, C, D, E and F and half represents 15.

  • So this gives us ah different different display for each of the 16 values that you can have with four digits of binary.

  • So these are all the different numbers, or I guess, digits or things we want to display.

  • Um, and we can create a truth table that looks at each of those cases and to simplify things even further.

  • What we can do is actually just look at a single segment in each of these and try to solve each segment by itself.

  • It's instead of looking at the whole number, let's just look at one segment.

  • In fact, we'll start with this segment on the top here, and what you'll notice is that for any of these segments we can control whether it's on or off by setting the pin for that segment to either five volts, which case it's off or ground which case it's on.

  • And and that's because these are these common anode.

  • Um, if I had the common cathode one that it would be the other way around on, you could use the same sort of logic.

  • But since these are the ones I have, we'll do it this way.

  • And so basically, if this input is is ground or a zero, a logic zero, then that segment is on.

  • If that pain is a logic one or five volts, then that segments off because you've got five volts on both sides of that led, and so there's no current flowing.

  • So with that in mind, we can come up with a truth table for that segment.

  • This is the A segment.

  • Each of these segments kind of by convention, has a letter associated with it.

  • So a is this top one.

  • So if we look at just that segment, we can see well for zero, it's on.

  • So that would be zero, right?

  • Because we want that segment to be on, which means we want the input for it to be at ground or zero, and that turns it on for one.

  • It's off So that the one for two, it's on that zero for three.

  • It's on that zero for four.

  • It's off for five.

  • It's on for six.

  • It's on for seven.

  • It's on for eight.

  • It's on for nine.

  • It's on for a it's on for B.

  • It's off the one for C.

  • It's on for D.

  • It's off.

  • And then for E and F, it's on.

  • And so what we've got here is a truth table that says, if you have these inputs, we want that output.

  • If you have these imports, we want that output.

  • And so now the question becomes, what can we build a circuit that satisfies this truth table, some kind of logic circuit, And if we could do that, then that gives us the logic required to tell us when we should turn on that top segment and then we could do the same thing for the rest of the segments.

  • So here's the circuit that I came up with.

  • The satisfies this truth table.

  • And so what you can see is we've got the imports d zero d one d to Andy three, which correspond, or for a bit binary number that's coming in.

  • And then we have those.

  • Those four imports is desire ready 12 and three and then I'm also inverted all of them.

  • So we also have the compliment of D zero d one d to Andy three over here.

  • And then what I'm doing is using a combination of and Gates and or Gates to decide whether this final output should be a one or a zero.

  • And the way that I did this is by looking down this column here at our outputs and looking at, Well, when do we want our output to be one?

  • And it turns out there's only four times that we actually want our output to be one.

  • We wanted to be one here, here, here and here.

  • And so if you look at just one of those cases when the outputs are one, the inputs are one are 0001 And so that's actually what thes three n gates do here.

  • You can always think of these.

  • Three n Gates is as a four input and gate.

  • I'm just using to input and gates for because it's what I have.

  • But what you see is I'm taking I'm handing together D zero.

  • So when d zero is one like this when d one d to Andy three are all zeros because if they're zeroes than the compliment of them will be ones.

  • And then all four of these inputs will be one.

  • And if all four of those inputs Air One than both of these outputs, where one and this output is one, and then that output there get sword together with the rest of the stuff, um, and and will eventually turn the final output on this A which of course, means that that input will be a one and the segment will be off just like it should be for the number one that top segments not on in number one.

  • Same thing for for here this is ah, the number four.

  • You see Number four.

  • It's also off.

  • So the number four D two is high, but D zero D one and three are low.

  • Take a CD to when that's the one.

  • But when d zero d one and d three when their compliments are one.

  • So when they're zero, then we end all that together and that also goes into this or gate.

  • And so if any of these conditions applies, then we turn that on same thing down here.

  • And this is for 11 or or be because B.

  • We also don't have that top segment on.

  • And so, for B D.

  • Zero d one and d three are ones.

  • Andy to is a zero.

  • So he's already won an D three when those air all one And when the compliment of de Tu Isa one.

  • So, in other words, it Wendy to zero.

  • If all of that is true, then we also turn on our output.

  • And then finally, for D the letter D, which is here that top segments also not on.

  • So for D, we have desire is the one the 10 d to Andy three or ones, and that's what's going on down here.

  • And actually, I took a little bit of a shortcut and saved ourselves an and gate because for D zero to be on and the one to be off, we've already got that up here so I could just pull that down on and save saving and gate.

  • But then, of course, and together the case where d two and D three are both ones.

  • And so if all that's true, then we also turned on any of these four conditions where this output should be one we or those together in the output is one.

  • Otherwise, if for in any other state, this output will be zero and so this circuit gives us everything we need in order to determine whether you know this one top segment, this segment here should be honor off, given a four bit input.

  • And so you can imagine if we do the same thing for each of these seven segments and build a similar circuit.

  • But, of course, come up with the truth table for each of those different segments and build seven essentially building seven of these circuits.

  • We could we would end up with a circuit that fully fully implements this decoding.

  • And if you're thinking that sounds like an awful lot of work, you're you're right.

  • It is an awful lot of work, and I'll show you in the next video a much, much quicker way or a much easier way, I guess, of doing this.

  • But just to demonstrate the point, I'll go ahead and fill out the rest of the truth table here.

  • And so if I haven't made any mistakes, this is the full truth table for a decoder that decodes four bits of binary to one of these Hexi decimal digits.

  • And I guess I can just spot checking a few things.

  • It looks like eight.

  • So 10008 and all of those air zeros.

  • Which makes sense because for eight, all of the all of the segments are on eso.

  • At least I didn't make a mistake there, but assuming it didn't make any mistakes here, this is the truth table that will get us a circuit that does this and I realize is a little bit messy.

  • But this is the circuit that I came up with, and you can see it's very similar to the circuit that we saw before, which has the D zero through D three and then the inverted Deezer through D three.

  • And then we're looking at at combinations of those.

  • It's the same thing.

  • In fact, this top part here is identical to what we did for Segment A.

  • And then there's additional site parts for Segment B, C, D, E and F G.

  • But again I was able to save some gates because in some cases some of these things were used previously, and I could I could save some gates but even said very complex circular, at least very large circuit in terms of number of gates.

  • And I imagine there's probably some people watching this that can look at this and find ways to simplify it a little bit and remove some of these gates.

  • But still, it's going to be fairly, fairly complex.

  • And so, just to demonstrate that, of course, I built the thing and this is what it looks like.

  • And you could see it is an awful lot going on here, and it's because we've got no.

  • 123456789 10 11 12 13 14 15 16 17 or Gates and those 17 or gates are are implemented on these.

  • 12345 74 l s 30 twos.

  • And then there's cash.

  • 123456789 10 11 12 13 14 15 16 17 18 1920 2122 23 24 to 5 or 6 to 7 28 29 30 31 32 33 And Gates And those 33 gates are on these 74 l s.

  • Zero eights, which each have four.

  • And Gates.

  • There's 123456789 of those now and then, Of course, we've got these four inverters, which on the 74 l s is there a four.

  • And so this year should represent this circuit.

  • Unless I made some mistakes somewhere.

  • But I have tested it and it works.

  • So you can see we plug it in, we get zero because our input down here is zero.

  • But we can cycle through and see.

  • One, 23 45 six, seven Hate nine.

  • Hey, be see D E and F, and so you can see the circuit works fine.

  • But boy, It's really complicated.

  • And you can imagine that a circuit this complex just to do four bits essentially implementing this truth table.

  • Ah, you can imagine that if we had eight bits of input and instead of one digit about what we had three digits of output, which is what you need in order to display the numbers zero through 2 55 which is what you get with eight bits of input.

  • You have eight bits of input and 21 bits of output for the seven segments times three displays and the circuit would get significantly more complicated on, So we don't really want to build something quite that complicated.

  • So in the next video, I'm gonna show you a way to use E prom's to replace any combination all logic circuit.

  • And this is a combination of logic circuit because basically it has.

  • For each input, there is a single output, and it doesn't depend on state or anything.

  • So this is kind of two kinds of logic circuits.

  • There's combination of logic, which is like this.

  • So for whatever can put, we give it, we get a particular output as the output is just a function of the inputs.

  • Ah, and then there's, Ah, sequential logic, which is things like latches and flip flops, encounters and some of some of the other things we've seen where the current state of it depends on what happened previously, and there's usually a clock involved, and that's sequential logic.

  • But for something like this, which is purely combination of logic, there's a simpler and more flexible way to build pretty much any combination of logic circuit using any problems.

  • And so we'll explore that and look at building our output register in the next videos.

So if we want to build some kind of output display for a computer, we can use a register just like we've built in the past, where we can push a value into that register and then have some way of displaying the contents of the register.

字幕と単語

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

A2 初級

7セグメント16進デコーダの設計 (Designing a 7-segment hex decoder)

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