< Return to Video

digital circuits a brief intro

  • 0:00 - 0:04
    >> This is Dr. Cynthia Furse at the University of Utah.
  • 0:04 - 0:08
    Today I'd like to talk about a very brief introduction to digital circuits.
  • 0:08 - 0:10
    First, we are going to talk about analog and
  • 0:10 - 0:13
    digital numbers and how these numbers are used for math.
  • 0:13 - 0:16
    Then we'll talk about how computers use binary numbers and
  • 0:16 - 0:18
    the digital logic gates that would be inside
  • 0:18 - 0:22
    the computer and then finally how to hook up these digital circuits.
  • 0:22 - 0:24
    Digital is basically a fixed value.
  • 0:24 - 0:26
    It can take on one or a few values.
  • 0:26 - 0:28
    It's something you can count.
  • 0:28 - 0:31
    Digital is like the digits on your hand.
  • 0:31 - 0:32
    Analog values vary.
  • 0:32 - 0:34
    They can take on any value.
  • 0:34 - 0:35
    They're something you can measure,
  • 0:35 - 0:38
    such as the distance between your hands.
  • 0:38 - 0:41
    Let's think of a fuel gauge for instance.
  • 0:41 - 0:44
    The analog gauge, the circle across the top,
  • 0:44 - 0:45
    tells you how much fuel you have.
  • 0:45 - 0:49
    You have a full tank or a half a tank or a little more than a half a tank of gas.
  • 0:49 - 0:52
    But when you're just about ready to run out,
  • 0:52 - 0:55
    the digital light turns on to tell you that you either
  • 0:55 - 0:58
    don't have enough when the light is on or that you do when the light is off.
  • 0:58 - 1:02
    There are two choices: You either have enough fuel or you don't.
  • 1:02 - 1:05
    Analog versus digital clocks both tell us time.
  • 1:05 - 1:09
    The analog clock tells us what time it is in a continuous fashion.
  • 1:09 - 1:13
    For example, here it's just a little before 12:40.
  • 1:13 - 1:16
    The digital clock tells us what hour and minute it is.
  • 1:16 - 1:19
    That's a countable number of hours and minutes.
  • 1:19 - 1:24
    One of my favorite applications of analog and digital is in audio recording.
  • 1:24 - 1:27
    Dr. Tom Stockham was a professor at the University of Utah.
  • 1:27 - 1:31
    He was a big fan of opera particularly, Enrico Caruso,
  • 1:31 - 1:33
    and he had a number of opera recordings that were done at the turn of
  • 1:33 - 1:37
    the century when the recording instruments weren't very good.
  • 1:37 - 1:39
    He wanted to be able to remove the old distortion from
  • 1:39 - 1:44
    these recordings so that he could hear this marvelous opera singer in better precision.
  • 1:44 - 1:46
    So, he took the analog recordings,
  • 1:46 - 1:47
    the tapes that you see here,
  • 1:47 - 1:49
    and converted them to digital.
  • 1:49 - 1:53
    He's considered the father of modern digital recording or the CD,
  • 1:53 - 1:55
    and he really did that to remove the distortion.
  • 1:55 - 1:59
    There are many other reasons you might watch a record things in digital as well,
  • 1:59 - 2:05
    but the original application was to remove the distortion from opera recordings.
  • 2:05 - 2:08
    Analog versus digital is very important in
  • 2:08 - 2:10
    the types of measurement equipment we use also,
  • 2:10 - 2:12
    such as the volt meter shown here.
  • 2:12 - 2:16
    An analog voltmeter tells you what voltage it is in a continuous fashion.
  • 2:16 - 2:20
    The digital voltmeter is what you're familiar with on the myDAQ that
  • 2:20 - 2:24
    tells you the voltage to within a certain countable number of digits.
  • 2:24 - 2:26
    There also are vault testers,
  • 2:26 - 2:29
    such as the craftsman design shown here that tell
  • 2:29 - 2:33
    you if the voltage is on or off that would be true digital.
  • 2:33 - 2:36
    When we talk about voltages,
  • 2:36 - 2:38
    an analog voltage can have any value,
  • 2:38 - 2:41
    such as the voltage going into a light bulb from a dimmer switch.
  • 2:41 - 2:45
    The light will turn on at any little tiny amount of value.
  • 2:45 - 2:47
    It's basically potentiometer that
  • 2:47 - 2:50
    controls the amount of voltage that's getting to the light.
  • 2:50 - 2:53
    A digital voltage is a very limited set of voltages,
  • 2:53 - 2:55
    more typical of your traditional switch.
  • 2:55 - 2:57
    The light is either on,
  • 2:57 - 3:00
    1, or it's off, 0.
  • 3:00 - 3:03
    An analog voltage can have any value,
  • 3:03 - 3:05
    such as this swirl that's shown here.
  • 3:05 - 3:08
    A digital voltage has a limited set of values,
  • 3:08 - 3:12
    a limited set of steps such as this stair step voltage shown here.
  • 3:12 - 3:16
    Digital voltages are represented with binary numbers.
  • 3:16 - 3:19
    The analog voltage, this dashed line,
  • 3:19 - 3:21
    you can see is a continuous solid line.
  • 3:21 - 3:24
    If we wanted to say that full-scale is eight and we
  • 3:24 - 3:26
    wanted to divide that into eight individual sets,
  • 3:26 - 3:30
    that would be one way that we could represent digital values.
  • 3:30 - 3:33
    So our value is either less than one-eighth,
  • 3:33 - 3:36
    it's 0, or it's one-eighth,
  • 3:36 - 3:39
    two-eighths, three-eighths, four-eighths and so on.
  • 3:39 - 3:41
    Here's the digital code
  • 3:44 - 3:50
    that could be used to represent the digital representation of the analog value.
  • 3:50 - 3:53
    We use analog to digital conversion to convert
  • 3:53 - 3:56
    between the analog value and the stair step digital value,
  • 3:56 - 3:59
    and we use digital to analog value to convert back.
  • 3:59 - 4:03
    The error at each of these cases is called quantization error.
  • 4:03 - 4:06
    Let's talk about counting with binary numbers.
  • 4:06 - 4:11
    I'm going to use three bits of binary number here to represent a 0.
  • 4:11 - 4:13
    If all of my lights are off,
  • 4:13 - 4:14
    my value will be 0.
  • 4:14 - 4:16
    If my first light is on,
  • 4:16 - 4:17
    that will be a 1.
  • 4:17 - 4:20
    If my second light is on and my first light is off, that's a 2.
  • 4:20 - 4:22
    Here we have two lights that are on,
  • 4:22 - 4:24
    that's a 3 and so on.
  • 4:24 - 4:26
    The reason I have to do this is because
  • 4:26 - 4:29
    the computer can only represent things that are either on or off,
  • 4:29 - 4:34
    and this allows me to count from 0-7 in a binary sequence.
  • 4:34 - 4:39
    We talk about bits and bytes and sure that you've heard about these in normal use.
  • 4:39 - 4:44
    So, a bit is each one of these individual things with a light could be on or off.
  • 4:44 - 4:46
    I've shown eight bits here.
  • 4:46 - 4:50
    Eight bits total up to one byte.
  • 4:50 - 4:53
    Computers represent numbers or sets of bits eight,
  • 4:53 - 4:54
    16 or 32 bit,
  • 4:54 - 4:56
    for example, and an exponent.
  • 4:56 - 4:58
    So, if we wanted to count to 2,000,
  • 4:58 - 5:01
    we would say that's 2 times 10 to the third.
  • 5:01 - 5:03
    We'd represent that as 2,
  • 5:03 - 5:06
    there's one light on and one light off,
  • 5:06 - 5:09
    times 10 to the third. There's the 3.
  • 5:09 - 5:13
    Computers represent letters with a code called ASCII.
  • 5:13 - 5:19
    We use a single byte to represent A as 0100001.
  • 5:19 - 5:22
    We also say this is a 4 1.
  • 5:22 - 5:25
    So, A is equal to 41.
  • 5:25 - 5:27
    B is 4 2.
  • 5:27 - 5:31
    C is 4 3 and so on.
  • 5:31 - 5:34
    Small a is still going to have the 1 on the end,
  • 5:34 - 5:35
    but instead of having a 4,
  • 5:35 - 5:38
    it's going to have 6 etc.
  • 5:38 - 5:40
    So, just for fun,
  • 5:40 - 5:44
    why don't you stop this recording and see if you can write your name in ASCII code.
  • 5:45 - 5:48
    Computers represent pictures with pixels.
  • 5:48 - 5:50
    You've seen this in your digital camera or your printer,
  • 5:50 - 5:54
    how many dots per inch you might use for your printer or your scanner.
  • 5:54 - 5:58
    The digital values could either be on and off or in this case I'm
  • 5:58 - 6:02
    showing you grayscale for the letter a and then an analog value,.
  • 6:02 - 6:03
    is it truly analog?
  • 6:03 - 6:08
    No. It's probably actually just a higher number of pixels so you don't see the edges.
  • 6:08 - 6:13
    Computer represents color as combinations of red,
  • 6:13 - 6:15
    green and blue called RGB.
  • 6:15 - 6:17
    You can see the red corner,
  • 6:17 - 6:19
    green corner and blue corner of this curve,
  • 6:19 - 6:21
    and as you add different combinations,
  • 6:21 - 6:24
    you can actually get any color i the color system.
  • 6:24 - 6:30
    Computer logic is going to use on and off, switches on and off.
  • 6:30 - 6:34
    Computer circuits on and off representing 1 and 0,
  • 6:34 - 6:37
    and these represent yes and no or true and false values.
  • 6:37 - 6:41
    They're typically 5 and 0 volts.
  • 6:41 - 6:43
    Let's go through an example.
  • 6:43 - 6:46
    Let's suppose, we wanted to build a battery voltage sensing system,
  • 6:46 - 6:50
    and a battery is considered low when its voltage is under 1.3.
  • 6:50 - 6:52
    Let's say I've got two batteries.
  • 6:52 - 6:54
    So, for example, I want to know,
  • 6:54 - 6:56
    is this one battery charged?
  • 6:56 - 6:58
    In ECE-speak, that is,
  • 6:58 - 7:01
    is the battery voltage above 1.3 volts?
  • 7:01 - 7:04
    So, what I'm going to do is convert this value to digital,
  • 7:04 - 7:07
    a value of zero or five volts.
  • 7:07 - 7:10
    We know one way to do that and that's with an op-amp circuit.
  • 7:10 - 7:13
    I could put the battery into the positive terminal and
  • 7:13 - 7:16
    the comparison voltage 1.3 volts into the negative terminal,
  • 7:16 - 7:21
    and then if I used Vcc at five volts and zero volts here at my two rails,
  • 7:21 - 7:26
    I know that my output would be a times vb minus 1.3.
  • 7:26 - 7:30
    But it would whale out at either zero or five volts.
  • 7:30 - 7:33
    That might be my digital 1 or my digital 0.
  • 7:33 - 7:35
    If this happened to be equal to 0,
  • 7:35 - 7:37
    my V0 would be 0.
  • 7:37 - 7:40
    If the Vp was greater than Vn,
  • 7:40 - 7:41
    my value would be 1.
  • 7:41 - 7:46
    The battery is charged or if it's less then my battery would be 0,
  • 7:46 - 7:49
    my battery is not charged.
  • 7:49 - 7:52
    Now, let's see how that would play into logic gates.
  • 7:52 - 7:55
    There are several types of circuits that are
  • 7:55 - 7:58
    specifically meant to work on zero to five volts,
  • 7:58 - 8:01
    and they are different types of gates.
  • 8:01 - 8:03
    One type of gate here,
  • 8:03 - 8:05
    for example, if I put in a 1,
  • 8:05 - 8:07
    a five volt or a 0,
  • 8:07 - 8:10
    a zero volt, this is what would happen.
  • 8:10 - 8:12
    Let me bring in the input from
  • 8:12 - 8:15
    one battery tester and the input from the other battery tester.
  • 8:15 - 8:17
    If they were both 0,
  • 8:17 - 8:19
    that means that both batteries are uncharged,
  • 8:19 - 8:21
    I would get a 0.
  • 8:21 - 8:24
    If one battery is uncharged and the other battery is charged,
  • 8:24 - 8:27
    note, both batteries aren't charged, will still be a 0.
  • 8:27 - 8:30
    If one battery is charged and the other battery is not, nope,
  • 8:30 - 8:31
    they're still not both charged,
  • 8:31 - 8:33
    but if they are both charged,
  • 8:33 - 8:34
    I will get an output, a 1.
  • 8:34 - 8:36
    If I measured that with a voltmeter,
  • 8:36 - 8:37
    what would I see?
  • 8:37 - 8:40
    I would see a five volts on the output circuit.
  • 8:40 - 8:42
    This is called an AND gate.
  • 8:42 - 8:47
    It tests to see if the two inputs are both 1.
  • 8:47 - 8:52
    An OR gate is going to test to see if one or the other input is charged.
  • 8:52 - 8:54
    So, I might be able to ask the question,
  • 8:54 - 8:56
    is at least one of my batteries charged?
  • 8:56 - 9:00
    So, then I would test to see is at least one of my batteries charged.
  • 9:00 - 9:02
    So, here I have 0 and 0.
  • 9:02 - 9:04
    No. Both batteries are uncharged in this case.
  • 9:04 - 9:06
    So, I get a 0 output.
  • 9:06 - 9:08
    Here, I have an uncharged and a charged.
  • 9:08 - 9:10
    Yeah. One of my battery is charged.
  • 9:10 - 9:11
    Here, the other battery is charged,
  • 9:11 - 9:15
    and here both batteries are charged. That's an OR gate.
  • 9:15 - 9:17
    Now, I could ask the question,
  • 9:17 - 9:19
    does at least one of my batteries need to be charged?
  • 9:19 - 9:23
    I could bring in the voltage from either of my battery testing circuits,
  • 9:23 - 9:25
    and I will see if I have 0 and 0.
  • 9:25 - 9:27
    They both need to be charged.
  • 9:27 - 9:28
    Yeah. Need charging there.
  • 9:28 - 9:30
    This one needs to be charged, this one doesn't.
  • 9:30 - 9:32
    But, yes, I still need to get out my charger.
  • 9:32 - 9:34
    This one's charged, that one's not,
  • 9:34 - 9:36
    get out your charger again.
  • 9:36 - 9:37
    Charged and charged.
  • 9:37 - 9:39
    No. I don't need my charger.
  • 9:39 - 9:40
    This is called a NAND gate,
  • 9:40 - 9:42
    N for NOT AND.
  • 9:42 - 9:45
    Here are some other circuits that you could do.
  • 9:45 - 9:48
    A NOT gate just inverts your circuit.
  • 9:48 - 9:49
    If it comes in as a 0,
  • 9:49 - 9:50
    it'll change it to a 1.
  • 9:50 - 9:53
    If it comes in a 1, it'll change it to a 0.
  • 9:53 - 9:55
    Here's an exclusive or.
  • 9:55 - 9:58
    You're actually going to use this in your next lab. This is how it works.
  • 9:58 - 10:01
    If they are both 0, then the output is 0.
  • 10:01 - 10:04
    If it is 0 and 1, the output is 1.
  • 10:04 - 10:05
    1 and 0, the output is 1.
  • 10:05 - 10:07
    Or 1 and 1, the output is 0.
  • 10:07 - 10:15
    This circuit is telling you if there's a difference between your two testers.
  • 10:16 - 10:19
    Now, let's talk about building with logic gates.
  • 10:19 - 10:24
    Remember when you use the op-amp you had to be able to put a power supply voltage on it,
  • 10:24 - 10:25
    you have to hear also.
  • 10:25 - 10:29
    Normally Vss will be five volts and Vdd will be ground.
  • 10:29 - 10:31
    You have this little chip right here,
  • 10:31 - 10:34
    and let's suppose we want to hook up an AND gate where we have
  • 10:34 - 10:37
    an input A and an input B and an output.
  • 10:37 - 10:39
    Right here is the input A,
  • 10:39 - 10:41
    the input B and the output.
  • 10:41 - 10:44
    The chip, this is the part that goes on your breadboard,
  • 10:44 - 10:47
    will typically have four AND gates,
  • 10:47 - 10:50
    each of them with separate input and outputs as shown.
  • 10:50 - 10:54
    So, that's a really fast introduction to digital circuits.
  • 10:54 - 10:57
    We compared analog and digital ideas,
  • 10:57 - 11:01
    as well as talked a little bit about digital numbers and their binary math,
  • 11:01 - 11:05
    how computers use these numbers and these types of logic gates, NOT,
  • 11:05 - 11:08
    OR, XOR, AND and NAND,
  • 11:08 - 11:11
    and then just briefly how to hook them up.
  • 11:11 - 11:13
    Thank you very much for joining me,
  • 11:13 - 11:19
    and this video is brought to you from Tombstone Rock near Moab, Utah.
Title:
digital circuits a brief intro
Description:

This is a very brief introduction to digital circuits and how they are used in engineering. For www.ece.utah.edu/~ece1250 at the University of Utah

more » « less
Video Language:
English
Duration:
11:21

English subtitles

Revisions