03-logic gates view

Upload: ravi-shankar-kaushik

Post on 14-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 03-Logic Gates View

    1/21

    1

    Logic Gates

    DCS201- Computer Science

    By:Dilum Bandara

  • 7/27/2019 03-Logic Gates View

    2/21

    CSE 2

    Outline

    p Boolean algebra

    p Different types of gates

    p Gate networks

  • 7/27/2019 03-Logic Gates View

    3/21

    CSE 3

    Boolean Algebra

    p George Boole (1815-1864) developed analgebra know an as the Boolean algebra

    p to examine a given set of propositions

    (statements) with a view to checking theirlogical consistency & simplifying them byremoving redundant statements or clauses

  • 7/27/2019 03-Logic Gates View

    4/21

    CSE 4

    Example

    pKamal is a clever student and hepasses exams well

    1 (TRUE)1 (TRUE)

    0 (FALSE)0 (FALSE)

    He passes exams wellKamal is a clever

    student

    This is a truth table

  • 7/27/2019 03-Logic Gates View

    5/21

    CSE 5

    Boolean Algebra cont

    p AND operation is called BooleanMultiplication

    n Indicated by period (.) symbol

    n A.B

    p OR operation is called Boolean Addition

    n Indicated by plus (+) symbol

    n A+B

  • 7/27/2019 03-Logic Gates View

    6/21

    CSE 6

    Some Boolean Algebraic Rules

    p Boolean addition

    0+0 = 0

    0+1 = 11+0 = 1

    1+1 = 1

    p Boolean multiplication

    0.0 = 0

    0.1 = 01.0 = 0

    1.1 = 1

  • 7/27/2019 03-Logic Gates View

    7/21

    CSE 7

    Logic Gates

    p Computers are developed using bi-stabledevices such as transistors.

    p They can be in only 2 states either ON orOFF.

    p A simple switch is an example for such adevice witch can either be ON or OFF.

  • 7/27/2019 03-Logic Gates View

    8/21

    CSE 8

    Logic Gates cont

    11

    00

    BulbSwitch

  • 7/27/2019 03-Logic Gates View

    9/21

    CSE 9

    Fundamental logic gates

    1. AND are all inputs are true?

    2. OR is at least one input is true?

    3. NOT flip the truth value

  • 7/27/2019 03-Logic Gates View

    10/21

    CSE 10

    AND gate

    111

    001

    010

    000

    LBA

    L = A.B

  • 7/27/2019 03-Logic Gates View

    11/21

    CSE 11

    Symbol

    111

    001

    010

    000

    ZBA

  • 7/27/2019 03-Logic Gates View

    12/21

    CSE 12

    OR Gate

    111

    101

    110

    000

    ZBA

    Z = A+B

  • 7/27/2019 03-Logic Gates View

    13/21

    CSE 13

    NOT gate

    01

    10

    ZA

    Also called the Inverter

    AZ =

    A+

    A+

  • 7/27/2019 03-Logic Gates View

    14/21

    CSE 14

    Gate Networks

    p The AND, OR and NOT gates can beinterconnected together to form othergates & logic networks.

    p These are also called combinationalnetworks.

    p Based on these fundamental gates NAND,NOR, XOR and XNOR gates are formed.

  • 7/27/2019 03-Logic Gates View

    15/21

    CSE 15

    NAND gate

    X

    01111001

    1010

    1000

    (Z)X (A.B)BA

    BAZ .=

  • 7/27/2019 03-Logic Gates View

    16/21

    CSE 16

    NOR Gate

    011001

    010

    100ZBA

    BZ +=

  • 7/27/2019 03-Logic Gates View

    17/21

    CSE 17

    XOR Gate

    p Exclusive OR gate

    BABAZ..

    +=

    011

    101110

    000

    ZBA

  • 7/27/2019 03-Logic Gates View

    18/21

    CSE 18

    Logic Network - Example

    pBuild the gate networkn Z = X (X+Y)

  • 7/27/2019 03-Logic Gates View

    19/21

    CSE 19

    A practical Scenario

    p Saman will go to the party if Kamal doesnot go

    p A Kamal going to the party

    p Z Saman going to the party

    AZ =

  • 7/27/2019 03-Logic Gates View

    20/21

    CSE 20

    Practical Scenario 2

    pSaman will go to the party if Ranigoes and Kamal does not.

    pA Kamal going to the partypB Rani going to the partypZ Saman going to the party

    ABZ.

    =

  • 7/27/2019 03-Logic Gates View

    21/21

    CSE 21

    Gate network

    ANDB z

    NOT

    A

    Kamal

    SamanRani