2-Basic Digital Logic - LAB

Embed Size (px)

Citation preview

  • 8/10/2019 2-Basic Digital Logic - LAB

    1/25

    Basic Digital Logic(Lab Session)

    Ferdinand M Fernando

    Asst. Professor I

    2

    Basic Digital Logic

    Review

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    2/25

    3

    Review

    Digital Electronics makes use of 2states:

    Logic High, or 1

    Logic Low, or 0

    Logic Circuit F. M. Fernando URSM-College of Engineering

    4

    Review

    There are 3 basic digital gates:

    AND

    OR

    NOT

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    3/25

    5

    Review

    AND, where ALL inputs must be 1for the output to be 1

    OR, where ANY of the inputs can be 1for the output to be 1

    NOT (or the Inverter) where theoutput is the opposite(compliment) of the input.

    Logic Circuit F. M. Fernando URSM-College of Engineering

    6

    Review Questions

    What is the outcome of the following:

    1

    1

    0

    1

    0

    1

    1

    Logic Circuit F. M. Fernando URSM-College of Engineering

    11

    0 0

  • 8/10/2019 2-Basic Digital Logic - LAB

    4/25

    7

    Standard Logic Symbols Basedon ANSI/IEEE Std. 91-1984

    Logic Circuit F. M. Fernando URSM-College of Engineering

    The Inverter

    The inverter (NOT circuit) performsthe operation called inversionorcomplementation.

    Standard logic symbols:

    1

    1

    input output input output

    Logic Circuit F. M. Fernando URSM-College of Engineering 8

  • 8/10/2019 2-Basic Digital Logic - LAB

    5/25

    Inverter Truth Table & LogicExpression

    Input Output

    LOW (0) HIGH (1)

    HIGH (1) LOW (0)

    A X = A

    0 1

    1 0

    Logic Circuit F. M. Fernando URSM-College of Engineering 9

    The AND Gate & ItsOperation

    The AND gate is composed of two ormore inputs and a single output.

    For a 2-input AND gate: Output X is HIGH only when inputs A

    and B are HIGH

    X is LOW when either A or B is LOW, orwhen both A and B are LOW.

    &A

    BX

    A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering 10

  • 8/10/2019 2-Basic Digital Logic - LAB

    6/25

    AND Gate Truth Table

    The total number of possible combinations ofbinary inputs to a gate is determined by:

    N = 2n

    Therefore: 2 bits (n=2) = 4 combinations 3 bits = 8 combinations 4 bits = 16 combinations

    INPUTS OUTPUT

    A B X

    0 0 0

    0 1 0

    1 0 0

    1 1 1

    A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering 11

    AND Gate LogicExpressions

    Use either:

    X = A B,or

    X = AB

    If there are more than 2 inputs, do as

    below:

    A

    BX

    X= ABC

    X= ABCD

    ABC

    ABCD

    Logic Circuit F. M. Fernando URSM-College of Engineering 12

  • 8/10/2019 2-Basic Digital Logic - LAB

    7/25

    The OR Gate

    Like AND gate, an OR gate has twoor more inputs and one output.

    For a 2-input OR gate: output X is HIGH when either input A or

    input B is HIGH, or when both A and Bare HIGH.

    X is LOW only when both A and B areLOW.

    A

    BX

    1A

    B

    X

    Logic Circuit F. M. Fernando URSM-College of Engineering 13

    OR Gate Truth Table

    INPUTS OUTPUT

    A B X

    0 0 0

    0 1 1

    1 0 1

    1 1 1

    A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering 14

  • 8/10/2019 2-Basic Digital Logic - LAB

    8/25

    OR Gate Logic Expressions

    Use the operator + for OR operation

    X = A + B

    If there are more than 2 inputs, do asbelow:

    X= A+B+C

    X= A+B+C+D

    ABC

    ABCD

    Logic Circuit F. M. Fernando URSM-College of Engineering 15

    Basic Digital Logic

    Basic Combinational Logic,NAND and NOR gates

    (Lab Session)

    Logic Circuit F. M. Fernando URSM-College of Engineering 16

  • 8/10/2019 2-Basic Digital Logic - LAB

    9/25

    Combinational Logic

    A circuit that utilizes more that 1logic function has CombinationalLogic.

    As an example, if a circuit has anAND gate connected to an Inverter

    gate, this circuit has combinationallogic.

    Logic Circuit F. M. Fernando URSM-College of Engineering 17

    18

    Combinational logic

    How would your describe the outputof this combinational logic circuit?

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    10/25

    1

    19

    NAND Gate

    The NAND gate is the combinationof an NOT gate with an AND gate.

    The Bubble in front of the gate is an inverter.

    Logic Circuit F. M. Fernando URSM-College of Engineering

    The NAND Gate

    NAND = NOT-AND

    For a 2-input NAND gate:

    Output X is LOW only when inputs Aand B are HIGH

    X is HIGH when either A or B is LOW, orwhen both A and B are LOW

    &A

    BX

    A

    BX

    A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering 20

  • 8/10/2019 2-Basic Digital Logic - LAB

    11/25

    1

    NAND Gate Truth Table & LogicExpression

    INPUTS OUTPUT

    A B X

    0 0 1

    0 1 1

    1 0 1

    1 1 0

    A

    B X

    The Boolean expression for theoutput of a 2-input NAND gate is

    X = AB

    Logic Circuit F. M. Fernando URSM-College of Engineering21

    Negative-OR Equivalent of aNAND

    For a 2-input NAND gate performinga negative-OR operation

    Output X is HIGH when either input A orinput B is LOW or when both A and B

    are LOW

    NAND Negative-OR

    Logic Circuit F. M. Fernando URSM-College of Engineering22

  • 8/10/2019 2-Basic Digital Logic - LAB

    12/25

    1

    23

    Combinational logic

    How would your describe the outputof this combinational logic circuit?

    Logic Circuit F. M. Fernando URSM-College of Engineering

    24

    NOR gate

    The NOR gate is the combination ofthe NOT gate with the OR gate.

    The Bubble in front of the gate is an inverter.

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    13/25

    1

    25

    NAND and NOR gates

    The NAND and NOR gates are verypopular as they can be connected inmore ways that the simple AND andOR gates.

    Logic Circuit F. M. Fernando URSM-College of Engineering

    The NOR Gate

    NOR = NOT-OR

    For a 2-input NOR gate: Output X is LOW when either input A or

    input B is HIGH, or when both A and Bare HIGH

    X is HIGH only when both A and B areLOW

    A

    BX

    A

    BX

    1A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering26

  • 8/10/2019 2-Basic Digital Logic - LAB

    14/25

    1

    NOR Gate Truth Table & LogicExpression

    INPUTS OUTPUT

    A B X

    0 0 1

    0 1 0

    1 0 0

    1 1 0

    The Boolean expression for theoutput of a 2-input NOR gate is

    X = A+B

    A

    B X

    Logic Circuit F. M. Fernando URSM-College of Engineering27

    Negative-AND Equivalent of aNOR

    For a 2-input NOR gate performing anegative-AND operation

    Output X is HIGH only when both inputsA and B are LOW

    NOR Negative-AND

    Logic Circuit F. M. Fernando URSM-College of Engineering28

  • 8/10/2019 2-Basic Digital Logic - LAB

    15/25

    1

    The XOR and XNOR Gates

    Exclusive-OR and Exclusive-NORgates are formed by a combinationof other gates already discussed.

    Because of their fundamentalimportance in many applications,these gates are often treated asbasic logic elements with their ownunique symbols.

    Logic Circuit F. M. Fernando URSM-College of Engineering29

    The XOR Gate

    For a 2-input exclusive-OR gate: Output X is HIGH when input A is LOW

    and input B is HIGH, or when input A isHIGH and input B is LOW

    X is LOW when A and B are both HIGHand both LOW

    = 1A

    B

    X

    A

    BX

    Logic Circuit F. M. Fernando URSM-College of Engineering30

  • 8/10/2019 2-Basic Digital Logic - LAB

    16/25

    1

    XOR Gate Truth Table & LogicExpression

    INPUTS OUTPUT

    A B X

    0 0 0

    0 1 1

    1 0 1

    1 1 0

    The Boolean expression for theoutput of a 2-input XOR gate is

    X = A+B

    A

    B X

    Logic Circuit F. M. Fernando URSM-College of Engineering31

    The XNOR Gate

    For a 2-input exclusive-NOR gate: Output X is LOW when input A is LOW

    and input B is HIGH, or when input A isHIGH and input B is LOW

    X is HIGH when A and B are both HIGHand both LOW

    = 1A

    B

    X

    A

    B

    X

    Logic Circuit F. M. Fernando URSM-College of Engineering32

  • 8/10/2019 2-Basic Digital Logic - LAB

    17/25

    1

    XNOR Gate Truth Table & LogicExpression

    INPUTS OUTPUT

    A B X

    0 0 1

    0 1 0

    1 0 0

    1 1 1

    The Boolean expression for theoutput of a 2-input XNOR gate is

    X = A+B

    A

    B X

    Logic Circuit F. M. Fernando URSM-College of Engineering33

    34

    Exercise (a bit challenging)

    Logic Circuit F. M. Fernando URSM-College of Engineering

    Turn the NAND and NOR gates into

    inverter (NOT) gates. Include a

    switch for the input.

  • 8/10/2019 2-Basic Digital Logic - LAB

    18/25

    1

    35

    Basic Digital Logic

    Chips and Gates

    (Lab Session)

    Logic Circuit F. M. Fernando URSM-College of Engineering

    36

    Basic Digital Chips

    Digital Electronics devices areusually in a chip format.

    The chip is identified with a partnumber or a model number.

    A standard series starts withnumbers 74, 4, or 14. 7404 is an inverter

    7408 is an AND

    7432 is an OR

    7400 is a NAND

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    19/25

    1

    7400 Series TTLIntegrated Circuit

    7400 - NAND (four gates per chip)

    7402 - NOR (four gates per chip)

    7404 - NOT (six gates per chip)

    7408 - AND (four gates per chip)

    7432 - OR (four gates per chip)

    7486 - XOR (four gates per chip)

    3737Logic Circuit F. M. Fernando URSM-College of Engineering

    3838Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    20/25

    2

    39

    Chips Pinouts

    Basic logic chipsoften come in 14-pinpackages.

    Package sizes andstyles vary.

    Pin 1 is indicatedwith a dot or half-circle

    Numbers are readcounter-clockwisefrom pin 1 (viewedfrom the top)

    Pin 1 Pin 7

    Pin 14 Pin 8

    Logic Circuit F. M. Fernando URSM-College of Engineering

    40

    Chips Pinouts

    Chips require avoltage to function

    Vcc is equal to 5

    volts and is typicallypin 14

    Ground is typicallypin 7

    Pin 1 Pin 7

    Pin 14 Pin 8

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    21/25

    2

    NUMBERING SYSTEM FORDIGITAL ICs

    414141Logic Circuit F. M. Fernando URSM-College of Engineering

    42

    NUMBERING SYSTEM FORDIGITAL ICs

    424242Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    22/25

    2

    4343

    NUMBERING SYSTEM FORDIGITAL ICs

    434343Logic Circuit F. M. Fernando URSM-College of Engineering

    4444444444Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    23/25

    2

    45

    Wiring a chip

    Vcc

    Vcc

    IN

    IN

    OUT

    LED orProbe

    Logic Circuit F. M. Fernando URSM-College of Engineering

    46

    Layout of the (Logic TrainerKit) Experimenter's Board

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    24/25

    2

    47

    Flat Side

    Wires

    7400

    Component Placement onBreadboard

    Logic Circuit F. M. Fernando URSM-College of Engineering

    48

    Equivalent Logic Diagram

    Logic Circuit F. M. Fernando URSM-College of Engineering

  • 8/10/2019 2-Basic Digital Logic - LAB

    25/25

    49

    Case Project 1(Guessing Game)

    Using the 74XX series IC, build an equivalent of the logic

    game that works as follows:

    a) One player, using 4 switches, creates a 4-bit combination.

    These switches are hidden from his opponent.

    b) Another player will try to guess the combination of the 4

    switches using another set of switches.

    c) A BLUE LED will indicate whether the combination of the 4

    hidden switches is correct. If any of the switches is incorrect, a

    RED LED will be ON instead. The LEDs cannot be both ON.

    Solution should include at least 3 proposed circuit designs andyour recommendation which among these circuits is your choice

    with corresponding justification.

    Logic Circuit F. M. Fernando URSM-College of Engineering