lecture 2 combinational logic
play

Lecture 2: Combinational Logic CSE 140: Components and Design - PowerPoint PPT Presentation

Lecture 2: Combinational Logic CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1 Outline What is a


  1. Lecture 2: Combinational Logic CSE 140: Components and Design Techniques for Digital Systems Spring 2014 CK Cheng, Diba Mirza Dept. of Computer Science and Engineering University of California, San Diego 1

  2. Outline • What is a combinational circuit? • Combinational Logic 1. Scope 2. Specification : Boolean algebra, truth tables 3. Synthesis: circuits 2

  3. PI Q: What is a combinational circuit? A. A circuit whose output depends only on current inputs B. A circuit that has memory of its past states C. A circuit that contains any logic gate 3

  4. What is a combinational circuit? • Output depends only on current inputs • No memory • Example: Circuit that adds to binary numbers 4

  5. Digital Circuits Operate on Binary Values • Typically consider only two discrete values: 1 ’ s and 0 ’ s – 1, TRUE, HIGH – 0, FALSE, LOW • 1 and 0 can be represented by anything (typically voltage) 5

  6. Basic Combinational Logic: Gates A Y= B 6

  7. Basic Combinational Logic: Gates A Y= AB B Truth Table Equivalence between: AND A B Y – Symbol (Logic circuit) 0 0 0 – Truth table 0 1 0 1 0 0 – Boolean Equation 1 1 1 7

  8. Boolean algebra and switching functions: Operators and Digital Logic Gates One-input operator Two-input operator Two-input operator NOT (Complement, ` ) AND ( ˄ , · ) OR ( ˅ , + ) AND OR NOT A B Y A B Y A Y 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 A A A 1 1 1 A A A 0 0 0 1 dominates in OR 0 dominates in AND 1 blocks the output 0 blocks the output 0 passes signal A 1 passes signal A 8

  9. Starting with basic gates we want to build more complex logic circuits Problem Specification: Synthesis a b c d 9 e

  10. Combinational Logic: Scope • Description – Language: e.g. C Programming, Verilog, VHDL – Boolean algebra – Truth table • Design – Schematic Diagram – Inputs, Gates, Nets, Outputs • Goal – Validity: correctness, turnaround time – Performance: power, timing, cost – Testability: yield, diagnosis, robustness 10

  11. Boolean Algebra: George Boole • Introduced binary variables • Introduced the three fundamental logic operations: AND, OR, and NOT. • Born to working class parents • Taught himself mathematics and joined the faculty of Queen’s College in Ireland. • Wrote An Investigation of the Laws of Thought (1854) George Boole: 1815 - 1864 1-<11> 1-<11>

  12. Boolean Algebra Similar to regular algebra but defined on on a set (B) with only three basic ‘logical’ operations: 1. Intersection: AND (2-input) , Operator: . 2. Union: OR (2 input), Operator: + 3. Complement: NOT ( 1 input) Operator: These operations satisfy the following laws: • Commutative laws: a+b=b+a, a · b=b · a • Distributive laws: a+(b · c)=(a+b) · (a+c), a · (b+c)=a · b+a · c • Identity laws: a+0=a, a · 1=a • Complement laws: a+a ’ =1, a · a ’ =0 <12>

  13. Switching Algebra • Boolean Algebra: multiple-valued logic, i.e. each variable have multiple values. • Switching Algebra: binary logic, i.e. each variable can be either 1 or 0. • Boolean Algebra ≠ Switching Algebra Boolean Algebra Switching Algebra BB <13>

  14. Starting with basic gates we want to build more complex logic circuits Problem Specification: Words Truth table Boolean (switching) expression Synthesis a b Reduced Boolean expression c d 14 e

  15. Specifying Logic Problems: Truth tables Example: Half Adder Truth Table a a b carry sum 0 0 0 0 Sum 0 1 0 1 b 1 0 0 1 1 1 1 0 Carry 15

  16. How do we go from Truth table to a Boolean Equation? Switching Expressions or Truth Table Boolean Equation: a b carry sum 0 0 0 0 Sum (a, b) = a ’ b + ab ’ 0 1 0 1 Carry (a, b) = ab 1 0 0 1 1 1 1 0 Switching Function 16

  17. Need Some Definitions • Complement: variable with a bar over it A , B , C • Literal: variable or its complement A , A , B , B , C , C • Implicant: product of literals ABC , AC , BC • Implicate: sum of literals ( A+B+C) , ( A+C) , ( B+C) • Minterm: product that includes all input variables ABC , ABC , ABC • Maxterm: sum that includes all input variables (A+B+C) , (A+B+C) , (A+B+C) 17

  18. Logic circuit vs. Boolean Algebra Expression ab a b ab + cd y=e (ab+cd) c cd d e Boolean Algebra: Schematic (circuit) Diagram: 5 literals 5 primary inputs 4 operators 4 components 9 signal nets Obj: min #terms 12 pins min #literals 18

  19. Specifying input combinations as Boolean expressions A B carry sum Min term Max term 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 19

  20. Sum of Product Canonical Form A B carry sum Min term Max term 0 0 0 0 A’B’ A+B 0 1 0 1 A’B A+B’ 1 0 0 1 AB’ A’+B 1 1 1 0 AB A’+B’ I. sum(A,B) = II. carry(A,B)= 20

  21. PI Q: Is the expression for sum obtained in the previous slide expected and correct? A. No, it is not expected and it is not correct. It should have been S= A+B B. It might not be expected but it is correct 21

  22. Sum of Product Canonical Form A B carry sum Min term Max term 0 0 0 0 m 0 M 0 0 1 0 1 m 1 M 1 1 0 0 1 m 2 M 2 1 1 1 0 m 3 M 3 I. sum(A,B) = II. carry(A,B)= 22

  23. Product of Sum Canonical Form A B carry sum Min term Max term 0 0 0 0 A’B’ A+B 0 1 0 1 A’B A+B’ 1 0 0 1 AB’ A’+B 1 1 1 0 AB A’+B’ I. sum(A,B) = II. carry(A,B)= 23

  24. Product of Sum Canonical Form A B carry sum Min term Max term 0 0 0 0 m 0 M 0 0 1 0 1 m 1 M 1 1 0 0 1 m 2 M 2 1 1 1 0 m 3 M 3 I. sum(A,B) = II. carry(A,B)= 24

  25. PI Q: The SOP form seems to be more compact than the POS form. Is there a situation where we would prefer the latter over the former to express the switching function? A. Yes, when the output is 1 more often than 0 B. Yes, when the output is 0 more often than 1 C. No, we always prefer the SOP form because its more compact 25

  26. PI Q: How can we check if our switching expression in POS and SOP canonical forms is correct? A. We can’t – just listen to the professor and follow B. Regenerate the truth table from the switching expression C. Derive one canonical form from the other using Boolean Algebra 26

  27. Re-deriving the truth table Truth Table Switching Expressions: A B carry sum Sum (A,B) = A’B + AB ’ 0 0 0 Carry (A, B) = AB 0 1 0 1 0 0 Ex: 1 1 1 Sum (0,0) = 0 ’ .0 + 0.0 ’ = 0 + 0 = 0 Sum (0,1) = 0 ’ 1 + 0.1 ’ = 1 + 0 = 1 Sum (1,1) = 1 ’ 1 + 1.1 ’ = 0 + 0 = 0 Logic circuit for half adder: a a sum carry b b 27

  28. The SOP and POS forms don’t usually give the optimal circuit or the simplest Boolean expression of the switching function To optimize the circuit, simplify the Boolean expression using: 1. Boolean Algebra axioms and theorems 2. Karnaugh Maps (next lecture) 28

  29. Axioms of Boolean Algebra 1. B = 0 if B not equal to 1 2. 0’ = 1 3. 1.1 = 1 4. 0.1 = 0 5. a+0=a, a.1=a Identity law 6. a+a ’ =1, a.a ’ =0 Complement law 1-<29>

  30. Theorems of Boolean Algebra I. Commutative Law: A + B = B +A AB = BA II. Distributive Law A(B+C) = AB + AC A A B B A C C A+BC = (A+B)(A+C) A A B B A C 30 C

  31. III Associativity (A+B) + C = A + (B+C) C A A B B C C A (AB)C = A(BC) A B B C IV: Consensus Theorem: AB+B’C+AC = AB+B ’ C 31

  32. PI Q: Which term in AB ’ +AC+BC can be deleted? A. AB ’ B. AC C. BC D. None of the above 1-<32>

  33. Proof of consensus Theorem using Boolean Algebra AB+B’C+AC = AB+B ’ C 1-<33>

  34. V. DeMorgan ’ s Theorem A Y • Y = AB = A + B B A Y B A Y B A • Y = A + B = A B Y B 34

  35. Bubble Pushing • Pushing bubbles backward (from the output) or forward (from the inputs) changes the body of the gate from AND to OR or vice versa. • Pushing a bubble from the output back to the inputs puts bubbles on all gate inputs. A A Y Y B B • Pushing bubbles on all gate inputs forward toward the output puts a bubble on the output and changes the gate body. A A Y Y B B 1-<35>

  36. Example of transforming circuits using bubble pushing 36

  37. 37

  38. 38

Recommend


More recommend