ee - 4 kmap logic simplification

Upload: jorge-ferreira

Post on 06-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    1/43

    Slide 1

    Electronic Engineering 1

    BENGEEE-SHU-1B

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    2/43

    Slide 2

    Digital Electronics

    Boolean Algebra and Logic SimplificationBoolean operations and expressions

    Laws and rules of Boolean algebra

    DeMorgans TheoremKarnaugh mapSOP/POS simplification

    Dont care conditions

    5 variables

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    3/43

    Slide 3

    Converting product terms to STD SOP

    Step 1: Multiply each non std product term by a termmade up of the sum of a missing variable and itscomplement.

    Step 2: Repeat Step 1 until all terms contain all literals.The number product terms is doubled for eachmissing variable.

    CBACABABC

    CBACCABCBAAB

    Literal C ismissing

    The product

    term is doubled

    Equivalent to 1(always TRUE)

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    4/43

    Slide 4

    Converting sum terms to STD POS

    CBACBACBACBACCBACBABA

    Literal C is

    missing

    The sum term is doubled

    Equivalent to 0(always FALSE)

    Step 1: Add to each non std sum term with a term madeup of the product of a missing variable and itscomplement.

    Step 2: Apply Rule 12; A + BC = (A+B) (A+C)

    Step 3: Repeat Step 1 until all terms contain all literals.

    The number sum terms is doubled for eachmissing variable.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    5/43

    FloydDigital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.Upper Saddle River, New Jersey 07458

    All rights reserved.

    Slide 5

    The Karnaugh Map

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    6/43

    Slide 6

    Karnaugh map

    Simplification of Combinational Logic Circuits usingKarnaugh Map

    The Karnaugh map provides a systematic method forsimplifying Boolean expressions.

    If properly used, will produce the simplest SOP or POSexpression possible, known as the minimum expression.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    7/43Slide 7

    Karnaugh map

    A Karnaugh map is an array of cells in which each cell

    represents a binary value of the input variables.

    The cells are arranged in a way so that simplification ofa given expression is simply a matter of properlygrouping the cells.

    Karnaugh maps can be used for expressions with two,three, four, and five variables.

    The number of cells in a K-map is equal to the total

    number of possible input variable combinations, i.e. thenumber of rows in a truth table.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    8/43Slide 8

    2-variable Karnaugh map

    The 2-variable K-map is an array of 4 cells as shown below. In

    part (b), it shows the standard products terms that arerepresented by each cell in the K-map.

    BA

    0 1

    0

    1

    BA BA

    BA AB

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    9/43Slide 9

    Karnaugh map

    The 3-variable K-map is an array of 8 cells as shown. In

    part (b), it shows the standard products terms that arerepresented by each cell in the K-map.

    CBA CBA

    CBA CBA

    CBA ABC

    CBA CBA

    C

    AB0 1

    00

    01

    11

    10

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    10/43Slide 10

    Karnaugh map

    The 4-variable K-map is an array of 16 cells as shown. In part(b), it shows the standard products terms that are

    represented by each cell in the K-map.

    Take note ofthe order of

    the inputbinary values

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    11/43Slide 11

    Karnaugh map

    Cell Adjacency

    The cells in a K-map are arranged so that there is only asingle-variable change between adjacent cells. Adjacencyis defined by a single-variable change as shown.

    Cells that differ by only one variable are adjacent.

    Cells with values that differ by more than one variable arenot adjacent.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    12/43Slide 12

    Karnaugh mapExample of a 3 variable K Map

    CAB 0 1

    00 000 001

    01 010 011

    11 110 111

    10 100 101

    Identify the cells adjacent to the 010 cell.

    The 010 cell is adjacent to the 000 cell, the 011 cell andthe 110 cell.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    13/43Slide 13

    Mapping a Standard SOP Expression

    For an SOP expression in standard form, a 1 is placed

    on the K-map for each product term in the expression.

    Each 1 is placed in a cell corresponding to the value of aproduct term.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    14/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    15/43Slide 15

    Karnaugh mapExample 2

    Map the following truth tables onto a K-map

    Input Output

    A B X

    0 0 1

    0 1 0

    1 0 0

    1 1 1

    B

    A 0 1

    0 1 0

    1 0 1

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    16/43Slide 16

    Karnaugh map

    C

    AB0 1

    00 0 0

    01 1 0

    11 0 0

    10 1 0

    A B C Output, X

    0 0 0 0

    0 0 1 0

    0 1 0 1

    0 1 1 0

    1 0 0 1

    1 0 1 0

    1 1 0 0

    1 1 1 0

    Example 2 (continue)

    Map the following truth tables onto a K-map

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    17/43Slide 17

    Karnaugh map

    A B C Output, X

    0 0 0 1

    0 0 1 1

    0 1 0 1

    0 1 1 0

    1 0 0 0

    1 0 1 01 1 0 1

    1 1 1 0

    CAB 0 1

    00 1 1

    01 1 011 1 0

    10 0 0

    Example 2 (continue)

    Map the following truth tables onto a K-map

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    18/43Slide 18

    K-Map Simplification of SOP Expression

    To obtain a minimum SOP expression using K-map:

    Grouping the 1s

    A group must contain either 1, 2, 4, 8 etc, which are allpower of two.

    The goal is to maximize the size of the groups and tominimize the number of groups. Always include the largestpossible number of 1s in a group.

    Each 1 on the map must be included in at least one group.

    The 1s already in a group can be included in another groupas long as the overlapping groups include non common 1s.

    Stop when all 1s has been designated to at least a group.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    19/43Slide 19

    Karnaugh map

    2. Determining the min SOP expression from K-map

    Each group of cells containing 1s creates one productterm composed of all variables that occur in only oneform (either uncomplemented or complemented) withinthe group.

    Variables that occur both uncomplemented andcomplemented within the group are eliminated.

    These are called contradictory variables.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    20/43Slide 20

    Karnaugh map

    2. Determining the min SOP expression from K-map

    (continue)Determine the minimum product term for each group.

    For a 3-variable map:

    A 1-cell group yields a 3-variable product term

    A 2-cell group yields a 2-variable product term

    A 4-cell group yields a 1-variable term

    An 8-cell group yields a value of 1 for the expression

    3. When all the minimum product terms are derivedfrom the K-map, they are summed to form theminimum SOP expression.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    21/43Slide 21

    Karnaugh map

    Example 3

    Determine the product terms for the K-map and write theresulting minimum SOP expression.

    CBA BC

    AB

    B

    CA

    AC

    K-map iscontiguous

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    22/43Slide 22

    Karnaugh map

    Example 4

    Group the following K maps and write the simplified expression

    C

    AB 0 1

    00 1 1

    01 1 0

    11 0 0

    10 1 1

    C

    AB 0 1

    00 1 101 0 0

    11 1 1

    10 1 1

    C

    AB 0 1

    00 0 101 0 1

    11 0 1

    10 1 0

    CAB BA CBABCCA

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    23/43

    Slide 23

    Karnaugh mapExample 5

    Use a K map to minimize the following standard SOP

    expression

    CBACBACBABCACBA

    BCA CAB 0 1

    00 1 1

    01 0 1

    11 0 0

    10 1 1

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    24/43

    Slide 24

    Karnaugh map

    Example 6

    The table shows truth table for output X

    A B C X

    0 0 0 1

    0 0 1 0

    0 1 0 0

    0 1 1 1

    1 0 0 1

    1 0 1 1

    1 1 0 0

    1 1 1 1

    Write the STANDARDsum ofproducts, SOP, logic expression for

    the output X in terms of A, B & C.

    ABCCBACBABCACBAX

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    25/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    26/43

    Slide 26

    Mapping a Standard POS Expression

    For an POS expression in standard form, a 0 is placed

    on the K-map for each sum term in the expression.

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    27/43

    Slide 27

    Mapping a Standard POS Expression

    Example 7Map the following standard POS expression on a K-map

    DCBADCBADCBADCBADCBA

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    28/43

    Slide 28

    Karnaugh map

    Example 8Use a Karnaugh map to minimize the following standard POS

    expression:

    CBACBACBACBACBA

    CBA:POS

    s1thegroupingbysametheisresultthe,Similarly

    lawvedistributi

    ACBA:SOP

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    29/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    30/43

    Slide 30

    Karnaugh mapDont care conditionsExample 9

    Map the following truth table onto a K-map and produce the

    minimum SOP espression

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    31/43

    Slide 31

    Karnaugh map 5 variables

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    32/43

    Slide 32

    Karnaugh map 5 variables example

    Yellow group:

    Orange group:

    Red group:

    Grey cell:

    ED

    ECB

    DBA

    EDCB

    EDCBDBACEBEDx

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    33/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    34/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    35/43

    Slide 35

    Notice

    Next lesson Combinational logic circuit

    Notes # 5

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    36/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 36

    The Karnaugh Map

    3-Variable Karnaugh Map3-Variable Example

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    37/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 37

    The Karnaugh Map

    4-Variable Karnaugh Map

    4-Variable Example

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    38/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 38

    The Karnaugh Map

    5-Variable Karnaugh Mapping

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    39/43

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    40/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 40

    VHDL

    VHDL Operators

    and

    ornot

    nand

    nor

    xor

    xnor

    VHDL Elements

    entity

    architecture

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    41/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 41

    VHDL

    Entity Structure

    Example:

    entity AND_Gate1 is

    port(A,B:in bit:X:out bit);

    end entity AND_Gate1

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    42/43

    Floyd

    Digital Fundamentals, 9/e

    Copyright 2006 by Pearson Education, Inc.

    Upper Saddle River, New Jersey 07458All rights reserved.

    Slide 42

    VHDL

    Architecture

    Example:

    architecture LogicFunction of AND_Gate1 is

    begin

    X

  • 8/3/2019 EE - 4 Kmap Logic Simplification

    43/43

    Floyd Copyright 2006 by Pearson Education, Inc.

    Hardware Description Languages (HDL)

    Boolean Expressions in VHDLAND X