1 / 74

CS 150 Computer Organization & Architecture

CS 150 Computer Organization & Architecture. Lecture 3 . Overview. Quiz 3 Boolean Operations Truth tables Logic gates Alternate gate shapes Functionally complete gates Boolean expressions Boolean theorems Canonical forms (SOP & POS) Boolean minimization The design process

corina
Download Presentation

CS 150 Computer Organization & Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 150Computer Organization & Architecture Lecture 3

  2. Overview • Quiz 3 • Boolean Operations • Truth tables • Logic gates • Alternate gate shapes • Functionally complete gates • Boolean expressions • Boolean theorems • Canonical forms (SOP & POS) • Boolean minimization • The design process • Karnaugh maps

  3. A New Kind of Algebra Boolean Algebra - a relatively simple mathematical tool that allows us to describe the relationship between a logic circuit’s output(s) and its input(s) as an algebraic equation.

  4. Logical Not Operator Also known as complement or invert operation Not Operation is usually denoted by X’ or X This is a truth table. It gives input-output mapping by simply enumerating all possible input combinations and the associated output.

  5. NOT Gate Also known as complement or invert gate X X’ This is a schematic. It is a graphical representation of a circuit which implements the operation.

  6. Denotes AND condition – Output is true iff all inputs are true Logical And Operation AND Operation is usually denoted by X = A * B X = AB

  7. AND Gate A X B Boolean Expressions X = A * B X = AB X = A x B

  8. Denotes OR condition – Output is true if any inputs are true Logical Or Operation OR Operation is usually denoted by X = A + B

  9. OR Gate A X B C Boolean Expression X = A + B + C

  10. NAND Gate A X B Denotes Inversion Boolean Expressions X = (A * B)` X = (AB)` X = (A x B)` ____ X = A * B __ X = AB ____ X = A x B

  11. NOR Gate A X B C Denotes Inversion Boolean Expression X = A + B + C X = (A + B + C)`

  12. XOR Gate A X B Boolean Expression X = AB` + A`B

  13. Alternate Gate Shapes Sometimes the logic of a circuit is more easily understood if an alternative gate shape is used. Rules:1. Change the gate shape (AND ==> OR; OR ==> AND). 2. Change the bubbles (add where missing; remove if present). Examples: A A AND AB AB B B (A’+B’)’ = AB

  14. Alternate Gate Shapes Cont A A A+B A+B OR B B (A’B’)’ = A+B A A (AB)’ (AB)’ NAND B B A’ + B’ = (AB)’ A A (A+B)’ (A+B)’ NOR B B A’B’ = (A+B)’

  15. One Last One X X’ INV X X’

  16. Functionally Complete Gates Any Boolean logic equation can be implemented with a combination of: AND gates & NOT gates OR gates & NOT gates Some gates are functionally complete.These gates can implement any combinational logic equation. These gates are: NAND gates (contain both AND & NOT functions) NOR gates (contain both OR & NOT functions)

  17. Functionally Complete Gates - NAND A A’ NOT A AB AND B A A+B B OR What are the NOR Gate representation for each?

  18. Boolean Expressions Boolean expressions are made up of constants and variables combined by AND, OR and NOT operations Examples: 1 A’ A•B C+D AB A(B+C) AB+C A•B is the same as AB (• is omitted when obvious ) Parentheses are used like in regular algebra for grouping A literal is each instance of a variable or constant This expression has 4 variables and 10 literals: a’bd + bcd + ac’ + a’d’

  19. Boolean Expressions Each Boolean expression can be specified by a truth table which lists all possible combinations of the values of all variables in the expression. F = A’ + B C A B C A' B C F = A' + B C 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 1 0 1 1 Which combination is missing?

  20. Boolean Expressions From Truth Tables Each 1 in the output of a truth table specifies one term in the corresponding boolean expression. The expression can be read off by inspection… • A B C F • 0 0 0 0 • 0 0 1 0 • 0 1 0 1 • 0 1 1 0 • 0 0 0 • 1 0 1 0 • 1 1 0 1 • 1 1 1 0 F is true when A is false, B is true, and C is false OR A is true, B is true, and C is false F = A’BC’ + ABC’

  21. Another Example • A B C F • 0 0 0 0 • 0 0 1 1 • 0 1 0 1 • 0 1 1 0 • 0 0 1 • 1 0 1 0 • 1 1 0 1 • 1 1 1 0 F = ? F = A’B’C + A’BC’ + AB’C’ + ABC’

  22. Boolean Expressions Each Boolean expression has a corresponding realization with logic gates. F = A’ + B C A F B C

  23. Seat Belt Buzzer • Three digital inputs • Car on/off • Seat belt attached/unattached • Timer timed out/not timed out C = 0 if car off, 1 if car on B = 0 if unattached, 1 if attached T = 0 if timed out, 1 if not timed out

  24. Seat Belt Buzzer • Process • Construct Truth Table • Construct Boolean Equation Result O = CB`T

  25. Seat Belt Buzzer Circuit O = CB`T T O C B

  26. More Examples • G = AB + ACDE + ACF • G = A(B + CDE + CF) • G = A(B’ + C(D’E + F)) • What are the circuit representations for these?

  27. More Examples • G = AB + ACD’E + ACF A B C G D E F

  28. More Examples • G = A(B + CD’E + CF) A G B C D E F

  29. More Examples • G = A(B’ + C(D’E + F)) A G B D E F C

  30. Some Basic Boolean Theorems From these We can get these

  31. Some Basic Boolean Theorems From these We can get these

  32. Basic Boolean Algebra Theorems Here are the first Boolean Algebra theorems we will study and use. X + 0 = X X • 1 = X X + 1 = 1 X • 0 = 0 X + X = X X • X = X ( X' )' = X X + X' = 1 X • X' = 0 Each can easily be proved by showing it valid for X = 0 and X = 1 or by using a truth table

  33. Other Boolean Theorems Commutative Law X • Y = Y • X X + Y = Y + X Associative Law ( X • Y ) • Z = X • ( Y • Z) = X • Y • Z ( X + Y ) + Z = X + ( Y + Z ) = X + Y + Z Distributive Law X(Y + Z) = XY + XZ (A + B)(C + D) = AC + AD + BC + BD X + (YZ) = (X + Y)(X + Z)  NOT like regular Algebra AB + CD = (A + C)(A + D)(B + C)(B + D)  NOT like regular Algebra

  34. DeMorgan’s Theorems • It is sometimes difficult to understand a Boolean equation that is in the form of a NAND or NOR function. • Using DeMorgan’s Theorem, it is possible to convert the equation into an AND or OR function, which is sometimes easier to deal with. ( X + Y )’ = X’ Y’ ( X Y )’ = X’ + Y’

  35. General DeMorgan’s Conversion Conversion Steps: 1. Change the logic symbol ( + to *; * to +). 2. Break the “bar” over the symbol that was changed. Examples: Equation to convert: X = (A * B * C)’ step 1: (A + B + C)’ change logic symbol(s) step 2: A’ + B’ + C’ break bar over symbol change(s) X = A’ + B’ + C’ Equation to convert: X = (A + B + C)’ step 1: (A * B * C)’ change logic symbol(s) step 2: A’ * B’ * C’ break bar over symbol change(s) X = A’B’C’

  36. Summary of Boolean Theorems Commutative Law X • Y = Y • X X + Y = Y + X Associative Law ( X • Y ) • Z = X • ( Y • Z) = X • Y • Z ( X + Y ) + Z = X + ( Y + Z ) = X + Y + Z Distributive Law X(Y + Z) = XY + XZ X + (YZ) = (X + Y)(X + Z) (A + B)(C + D) = AC + AD + BC + BD AB + CD = (A + C)(A + D)(B + C)(B + D) Miscellaneous Laws X + 0 = X X • 1 = X X + 1 = 1 X • 0 = 0 X + X = X X • X = X ( X' )' = X X + X' = 1 X • X' = 0 Simplification Theorems X Y + X Y’ = X ( X + Y ) (X + Y’ ) = X X + X Y = X X ( X + Y ) = X ( X + Y’ ) Y = X Y X Y’ + Y = X + Y DeMorgans Laws ( X + Y )’ = X’ Y’ ( X Y )’ = X’ + Y’

  37. Canonical Boolean Forms • Sum-Of-Products form or SOP • Product of Sums form or POS

  38. Sum of Products Form • Sometimes called MINTERM form • Indicates 1s in truth table • All terms are products of single variables only (no parentheses) • Terms are ANDed together X = A B C’ + D E + F G H Yes X = A B + C D + E Yes X = A B + C ( D + E ) No

  39. Variations of SOP Form • Standard SOP Form • Every term contains every variable • F = A’B’C’ + A’BC + ABC • Numeric SOP or Minterm Expansion Form • Uses numbers to represent rows in truth table where function is 1 • F(A,B,C) = Σm(0, 3, 7)

  40. Minterm Expansion Form • Minterm notation is a short hand way of writing Boolean expressions • Each row can be numbered • Call each row’s AND term a minterm What is the Boolean expression for this TT? F = A’B’C + A’BC + ABC’ An alternate way of expressing this is F = m1 + m3 + m6 or F(A,B,C) = Σm(1, 3, 6) m0 m1 m2 m3 m4 m5 m6 m7

  41. Product of Sums Form • Sometimes called MAXTERM form • Indicates 0s in truth table • All terms are sums of single variables only • Terms are ORed together X = ( A + B + C’ ) ( D + E ) Yes X = ( A + B )( C + D’ )E’F Yes X = ( A + B + C’ ) ( D + E ) + H No X = ( A’ + BC ) ( D + E ) No

  42. Variations of POS Form • Standard POS Form • Every term contains every variable • F = (A’ + B’ + C’)(A’ + B + C)(A + B + C) • Numeric POS or Maxterm Expansion Form • Uses numbers to represent rows in truth table where function is 0 • F(A,B,C) = πM(0, 3, 7)

  43. Maxterm Expansion Form • Maxterm notation is a short hand way of writing Boolean expressions • Each row can be numbered • Call each row’s OR term a maxterm What is the boolean expression for this TT? F = (A+B+C)(A+B’+C)(A’+B+C) An alternate way of expressing this is F = (M0)(M2)(M4) or F(A,B,C) = πM(1, 2, 4) M0 M1 M2 M3 M4 M5 M6 M7

  44. POS vs. SOP • Any expression can be written either way • Can convert from one to another using theorems • Sometimes SOP looks simpler • AB + CD = ( A + C )( B + C )( A + D )( B + D ) • Sometimes POS looks simpler • (A + B)( C + D) = BD + AD + BC + AC • SOP will be most commonly used in this class but learn both

  45. Algebraic Simplification • Why simplify?? • Simplify equations -> Less hardware to implement -> less cost • Example – what is the Boolean expression for this TT? F = A`B`C + AB`C + ABC` + ABC What hardware is used for this? 4 3-input AND’s 1 4-input OR What is simplified expression? F = B`C + AB What hardware is used for this? 2 2-input AND’s 1 2-input OR

  46. Algebraic Simplification • 3 Methods used to simplify Boolean expressions • Combine terms (X Y + X Y’ = X) • Eliminate terms and variables (X + X Y = X) • Add redundant terms (X + X = X)

  47. Applying Methods of Algebraic Simplification F = A’B’C + AB’C + ABC Combine terms: A’B’C + AB’C = B’C(A’+A) [X’+X=1, X·1=X] = B’C F = B’C + ABC Add redundant terms: B’C + ABC + AB’C [X+X=X] Combine terms: ABC + AB’C = AC(B+B’) [X’+X=1, X·1=X] = AC F = B’C + AC

  48. Applying Methods of Algebraic Simplification F = (A’+B’+C)(A+B’+C)(A+B+C) Combine terms: (A’+B’+C)(A+B’+C)= (B’+C)+(A’·A) [X’·X=0, X+0=X] = (B’+C) F = (B’+C)(A+B+C) Add redundant terms: (B’+C)(A+B+C)(A+B’+C) [X·X=X] Combine terms: (A+B+C)(A+B’+C) = (A+C)+(B·B’) [X’·X=0, X+0=X] = (A+C) F = (B’+C)(A+C)

  49. Designing Combinational Logic Circuits • Define the problem • Set up the truth table • Write the Boolean equation • Simplify the output expression • Draw the logic diagram

  50. Step 1 – Define the Problem Converting English to Boolean The air conditioner should be turned on if and only if the temperature is greater than 75, the time is between 8am and 5pm, and it is not a holiday.

More Related