1 / 56

COMS 361 Computer Organization

COMS 361 Computer Organization. Title: Boolean Algebra Date: 11/02/2004 Lecture Number: 17. Announcements. Homework 8 Due Thursday, 11/11/04. Review. Representing numbers in binary Problems Unsigned (magnitude) Sign-magnitude One’s complement Two’s complement. Outline.

shubha
Download Presentation

COMS 361 Computer Organization

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. COMS 361Computer Organization Title: Boolean Algebra Date: 11/02/2004 Lecture Number: 17

  2. Announcements • Homework 8 • Due Thursday, 11/11/04

  3. Review • Representing numbers in binary • Problems • Unsigned (magnitude) • Sign-magnitude • One’s complement • Two’s complement

  4. Outline • Representing numbers in binary • Finish overflow • Boolean Algebra • Boolean Logic

  5. Truth Table • Provides a listing of every possible combination of inputs and corresponding outputs • Example (2 inputs, 2 outputs):

  6. Truth Table • Example (3 inputs, 2 outputs):

  7. Proof using Truth Table • Can use truth table to prove a Boolean expression • Prove that: x . (y + z) = (x . y) + (x . z) (i) Construct truth table for LHS & RHS of above equality

  8. Proof using Truth Table (ii) Check that LHS = RHS • Postulate is SATISFIED because output column 2 & 5 (for LHS & RHS expressions) are equal for all cases

  9. Duality • Duality Principle – every valid Boolean expression (equality) remains valid if the operators and identity elements are interchanged, as follows: +  . 1  0 • Example: Given the expression a + (b.c) = (a+b).(a+c) then its dual expression is a . (b+c) = (a.b) + (a.c)

  10. Duality • Duality gives free theorems • “two for the price of one” • You prove one theorem and the other comes for free! • If (x+y+z)' = x'.y.'z' is valid, then its dual is also valid: (x.y.z)' = x'+y'+z’ • If x + 1 = 1 is valid, then its dual is also valid: x . 0 = 0

  11. Basic Theorems of Boolean Algebra • Apart from the axioms/postulates, there are other useful theorems. Idempotency (a) x + x = x (b) x . x = x Proof of (a): x + x = (x + x).1 (identity) = (x + x).(x + x') (complementarity) = x + x.x' (distributivity) = x + 0 (complementarity) = x (identity)

  12. Basic Theorems of Boolean Algebra • Theorems can be proved using the truth table method. • They can also be proved by algebraic manipulation using axioms/postulates or other basic theorems.

  13. Basic Theorems of Boolean Algebra • absorption can be proved by: x + x.y = x.1 + x.y (identity) = x.(1 + y) (distributivity) = x.(y + 1) (commutativity) = x.1 (Theorem 2a) = x (identity) • By duality: x.(x+y) = x • Try to prove other theorems by algebraic manipulation.

  14. Boolean Functions • Boolean function is an expression formed with binary variables, the two binary operators, OR and AND, and the unary operator, NOT, parenthesis and the equal sign. • Its result is also a binary value. • We usually use . for AND, + for OR, and ' or ¬ for NOT. Sometimes, we may omit the . if there is no ambiguity.

  15. Boolean Functions • Examples: F1= xyz' F2= x + y'z F3=(x'y'z)+(x'yz)+(xy') F4=xy'+x'z • From the truth table, F3=F4. • Can you also prove by algebraic manipulation that F3=F4?

  16. Complement of Functions • Given a function, F, the complement of this function, F', is obtained by interchanging 1 with 0 in the function’s output values. Example: F1 = xyz' Complement: F1' = (xyz')' = x' + y' + (z')' DeMorgan = x' + y' + z Involution

  17. Complement of Functions • More general DeMorgan’s theorems useful for obtaining complement functions: (A + B + C + ... + Z)' = A' . B' . C' … . Z' (A . B . C ... . Z)' = A' + B' + C' + … + Z'

  18. Standard Forms • Certain types of Boolean expressions lead to gating networks which are desirable from implementation viewpoint • Two Standard Forms:Sum-of-Products and Product-of-Sums • Literals: a variable on its own or in its complemented form. Examples: x, x' , y, y' • Product Term: a single literal or a logical product (AND) of several literals. Examples: x, xyz', A'B, AB

  19. Standard Forms • Sum Term: a single literal or a logical sum (OR) of several literals. Examples: x, x+y+z', A'+B, A+B • Sum-of-Products (SOP) Expression: a product term or a logical sum (OR) of several product terms. Examples: x, x+yz', xy'+x'yz, AB+A'B' • Product-of-Sums (POS) Expression: a sum term or a logical product (AND) of several sum terms. Exampes: x, x(y+z'), (x+y')(x'+y+z), (A+B)(A'+B')

  20. Standard Forms • Every boolean expression can either be expressed as sum-of-products or product-of-sums expression

  21. AND, OR and NOT constitute connectives Boolean algebra is required for constructing digital circuits There are certain postulates and theorems in Boolean algebra which helps in manipulation of boolean expression Boolean laws can be proved with either the help of truth table or with the basic postulates SOP and POS are two generic way of expressing any boolean function Summary

  22. Example: Half Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: half adder adds two binary digits to form Sum and Carry

  23. Example: Half Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: half adder adds two binary digits to form Sum and Carry

  24. Example: Half Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: half adder adds two binary digits to form Sum and Carry

  25. Example: Half Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: half adder adds two binary digits to form Sum and Carry

  26. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  27. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  28. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  29. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  30. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  31. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  32. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  33. Example: Full Adder • Truth Tables • Tabulate all possible input combinations and their associated output values Example: full adder adds two binary digits and Carry in to form Sum and Carry Out Example: half adder adds two binary digits to form Sum and Carry

  34. Example: Full Adder Sum = A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1

  35. Example: Full Adder Sum = A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1

  36. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1

  37. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1

  38. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Cout = A B Cin

  39. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Cout = A B Cin + A B Cin

  40. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Cout = A B Cin + A B Cin + A B Cin

  41. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Cout = A B Cin + A B Cin + A B Cin + A B Cin

  42. Example: Full Adder Sum = A B Cin + A B Cin + A B Cin + A B Cin Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1 A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Cout = A B Cin + A B Cin + A B Cin + A B Cin

  43. L1 L4 L6 L2 L5 L7 L3 Example • Circuit to drive a digital display • Need 4 bits to represent 10 numbers (0-9)

  44. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  45. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  46. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  47. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  48. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  49. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

  50. L1 L4 L6 L2 L5 L7 L3 Example • Determine which segments are on for each number

More Related