CSE 502N Fundamentals of Computer Science - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

CSE 502N Fundamentals of Computer Science

Description:

Parallel columns illustrate duality principle. DeMorgan's Laws for n Variables ... The Duality Principle ... from each other through the duality principle. ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 17
Provided by: davidedwa
Category:

less

Transcript and Presenter's Notes

Title: CSE 502N Fundamentals of Computer Science


1
CSE 502NFundamentals of Computer Science
  • Summer 2005
  • Lecture 17
  • Introduction to Digital Logic and
  • Logic Minimization

2
Elementary Binary Logic Functions
  • Digital circuits represent information using 2
    voltage levels.
  • binary variables (1 0) are used to denote these
    values
  • Functions of binary variables are called logic
    functions.
  • AND(A,B) 1 if A1 and B1, else it is zero.
  • AND is generally written in the shorthand AB (or
    AB or AÙB)
  • OR(A,B) 1 if A1 or B1, else it is zero.
  • OR is generally written in the shorthand form AB
    (or AB or AÚB)
  • NOT(A) 1 if A0 else it is zero.
  • NOT is generally written in the shorthand form
    (or ØA or A?)
  • AND, OR and NOT can be used to express all other
    logic functions.

3
Two Variable Binary Logic Functions
  • Similar truth tables for 3 or 4 variable
    functions are too big
  • How can we represent functions in terms of AND,
    OR, NOT?
  • NAND? EXOR?

4
Basic Logic Gates
  • Logic gates compute elementary binary
    functions.
  • output of an AND gate is 1 when both of its
    inputs are 1, otherwise the output is zero
  • similarly for OR gate and inverter

5
Multivariable Gates
  • AND function on n variables is 1 if and only
    if ALL its arguments are 1.
  • n input AND gate output is 1 if all inputs are
    1
  • OR function on n variables is 1 if and only if
    at least one of its arguments is 1.
  • n input OR gate output is 1 if any inputs are
    1
  • Can construct large gates from 2 input gates.
  • however, large gates can be less expensive than
    required number of 2 input gates

6
Elements of Boolean Algebra
  • Boolean algebra defines rules for manipulating
    symbolic binary logic expressions.
  • Can define circuit for expression by combining
    gates.
  • a symbolic binary logic expression consists of
    binary variables and the operators AND, OR and
    NOT (e.g. ABC?)
  • The possible values for any Boolean expression
    can be tabulated in a truth table.

7
Boolean Functions to Logic Circuits
  • Any Boolean expression can be converted to a
    logic circuit made up of AND, OR and NOT gates.
  • Add parentheses to expression to fully define
    order of operations A(B(C ?))
  • Create gate for last operation in expression
  • Continue inward
  • Number of simple gates needed to implement
    expression equals number of operations in
    expression.
  • so, simpler equivalent expression yields less
    expensive circuit
  • Boolean algebra provides rules for simplifying
    expressions

8
Basic Identities of Boolean Algebra
  • 1. X 0 X
  • 3. X 1 1
  • 5. X X X
  • 7. X X 1
  • 9. (X ) X
  • 10. X Y Y X
  • 12. X(YZ ) (XY )Z
  • 14. X(YZ ) XY XZ
  • 16. (X Y )? X ?Y ?
  • 2. X1 X
  • 4. X0 0
  • 6. XX X
  • 8. XX 0
  • 11. XY YX
  • 13. X(YZ ) (XY )Z
  • 15. X(YZ ) (XY )(XZ )
  • 17. (XY) X?Y ?
  • Identities define intrinsic properties of Boolean
    algebra.
  • Note 15-17 have no counterpart in ordinary
    algebra.
  • Parallel columns illustrate duality principle.

9
DeMorgans Laws for n Variables
  • As we saw earlier in the semester, we can extend
    DeMorgans laws to 3 variables by applying the
    laws for two variables.
  • Generalization to n variables.
  • (X1 X2 Xn)? X ?1X ?2 X ?n
  • (X1X2 Xn)? X ?1 X ?2 X ?n

10
Simplification of Boolean Expressions
FX ?YZ X ?YZ ?XZ
11
The Duality Principle
  • The dual of a Boolean expression is obtained by
    interchanging all ANDs and ORs, and all 0s and
    1s.
  • E.g., the dual of A(BC ?)0 is A(BC ?)1
  • If E1 and E2 are Boolean expressions then
  • E1 E2 ? dual (E1)dual (E2)
  • A(BC ?)0 (B ?C )D ? A(BC ?)1 (B
    ?C )D
  • The pairs of identities (1,2), (3,4), (5,6),
    (7,8), (10,11), (12,13), (14,15) and (16,17) all
    follow from each other through the duality
    principle.

12
The Consensus Theorem
  • Theorem. XY YZ X ?Z XY X ?Z
  • Proof. XY YZ X ?Z XY (X X ?)YZ X ?Z
    2,7
  • XY XYZ X ?YZ X ?Z 14
  • XY(1 Z ) X ?Z(Y 1) 2,11,14
  • XY X ?Z
    3,2
  • Example. (A B )(A? C ) AA? AC A?B BC
  • AC A?B BC
  • AC A?B
  • Dual. (X Y )(Y Z )(X ? Z ) (X Y )(X ?
    Z )

13
Taking the Complement of a Function
  • Any suggestions?
  • Method 1. Apply DeMorgans Theorem repeatedly.
  • (X(Y ?Z ? YZ ))? X ? (Y ?Z ? YZ )?
  • X ? (Y ?Z ?)?(YZ )?
  • X ? (Y Z )(Y ? Z ?)
  • Method 2. Complement literals and take dual
  • (X (Y ?Z ? YZ ))? dual (X ?(YZ Y ?Z ?))
  • X ? (Y Z )(Y ? Z ?)

14
Sum of Products Form
  • The sum of products is one of two standard forms
    for Boolean expressions.
  • ?sum-of-products-expression? ?p-term?
    ?p-term? ... ?p-term?
  • ?p-term? ?literal? ?literal?
    ?literal?
  • example. X ?Y ?Z X ?Z XY XYZ
  • A minterm is a term that contains every variable,
    in either complemented or uncomplemented form.
  • example. in expression above, X ?Y ?Z is minterm,
    but X ?Z is not
  • A sum of minterms expression is a sum of products
    expression in which every term is a minterm.
  • X ?Y ?Z X ?YZ XYZ ? XYZ
  • shorthand list minterms numerically, so X ?Y ?Z
    X ?YZ XYZ ? XYZ becomes 001011110111 or
    (1,3,6,7)

15
Simplifying Sum-of-Products Expressions
  • Sum of products forms yield 2 level AND-OR
    circuits.
  • Any expression can be put into sum of products
    form by applying distributive laws.
  • The simplest sum of products expression yields
    simplest 2 level AND-OR circuit.
  • Any Boolean expression can be viewed as a set of
    minterms.
  • An expression F covers another expression G, if
    the minterms in G are a subset of the minterms in
    F.
  • AC covers ABC, since AC contains minterms 5 and
    7 (from the set of 8 minterms on the variables A,
    B, and C ) and ABC contains only minterm 5.

16
General Simplification Procedure
  • Given an expression F (e.g. ABDA?BBC?D?B?CDB?C
    D?)
  • Step 1. Let M be the set of minterms covered by
    F.
  • A?B?CD A?B?CD?
  • A?BC?D? A?BC?D A?BCD A?BCD?
  • ABC?D? ABC?D ABCD
  • AB?CD AB?CD?
  • Step 2. For each minterm, m, find all maximal
    terms that cover m and also cover other minterms
    in M, but no minterms that are not in M. Let T be
    the resulting set of terms.
  • (T A?B, BC?, BD, CD, A?C, B?C )
  • Step 3. Select all terms in T that cover minterms
    covered by no other terms in T ( BC?, B?C )
  • Step 4. Select additional terms in T until
    selected terms cover all minterms. At each step,
    select a term that covers the largest possible
    number of new minterms. ( A?B, CD )
Write a Comment
User Comments (0)
About PowerShow.com