330 likes | 600 Views
COMP211 Computer Logic Design Lecture 3. Combinational Logic 1. Prof. Taeweon Suh Computer Science Education Korea University. Introduction. A logic circuit is composed of: Inputs Outputs Functional specification Timing specification. Circuits. Nodes Inputs: A , B , C
E N D
COMP211Computer Logic DesignLecture 3. Combinational Logic 1 Prof. Taeweon Suh Computer Science Education Korea University
Introduction A logic circuit is composed of: Inputs Outputs Functional specification Timing specification
Circuits Nodes • Inputs: A, B, C • Outputs: Y, Z • Internal: n1 Circuit elements • E1, E2, E3
Types of Logic Circuits Combinational Logic • Memoryless • Outputs determined by current values of inputs Sequential Logic • Has memory • Outputs determined by previous and current values of inputs
Rules of Combinational Composition Every circuit element is itself combinational Every node of the circuit is either designated as an input to the circuit or connects to exactly one output terminal of a circuit element The circuit contains no cyclic paths: every path through the circuit visits each circuit node at most once Example:
Boolean Equations Functional specification of outputs in terms of inputs Example: S = F(A, B, Cin) Cout = F(A, B, Cin)
Terminology The Complementof a variable A is A A variable or its complement is called literal The AND of one or more literals is called a product orimplicant • Example: AB, ABC, B OR of one or more literals is called a sum • Example: A + B Order of operations • NOT has the highest precedence, followed by AND, then OR • Example: Y = A + BC
Sum-of-Products (SOP) Form Y = F(A, B) = AB + AB All Boolean equations can be written in SOP form A mintermis a product (AND) of literals involving all of the inputs to the function Each row in a truth table has a minterm that is TRUE for that row (and only that row) The function is formed by ORing the minterms for which the output is TRUE • Thus, a sum (OR) of products (AND terms)
Product-of-Sums (POS) Form Y = F(A, B) = (A + B)(A + B) All Boolean equations can be written in POS form A maxterm is a sum (OR) of literals Each row in a truth table has a maxterm that is FALSE for that row (and only that row) The function is formed by ANDing the maxterms for which the output is FALSE • Thus, a product (AND) of sums (OR terms)
Boolean Equations Example You are going to the cafeteria for lunch • You won’t eat lunch (E: eat) • If it’s not open (O: open) • If they only serve corndogs (C: corndogs) Write a truth table for determining if you will eat lunch (E)
SOP & POS Form Y = AB Y = (A + B)(A + B)(A + B) SOP – sum-of-products POS – product-of-sums
When to Use SOP and POS? SOP produces the shortest equations when the output is true on only a few rows of a truth table POS is simpler when the output is false on only a few rows of a truth table
Boolean Algebra Set of axioms and theorems to simplify Boolean equations Like regular algebra, but in some cases simpler because variables can have only two values (1 or 0) Axioms and theorems obey the principles of duality: • ANDs and ORs interchanged, 0’s and 1’s interchanged
Boolean Axioms Axioms are not provable
Boolean Theorems of One Variable The prime (’) symbol denotes the dual of a statement
T1: Identity Theorem B 1 = B B + 0 = B
T2: Null Element Theorem B 0 = 0 B + 1 = 1
T3: Idempotency Theorem B B = B B + B = B
T4: Identity Theorem B = B
T5: Complement Theorem B B = 0 B + B = 1
Simplifying Boolean Expressions: Example 1 Y = AB + AB = B (A + A) T8 = B (1) T5’ = BT1
Simplifying Boolean Expressions: Example 2 Y = A (AB + ABC) = A (AB (1 + C)) T8 = A (AB (1)) T2’ = A (AB) T1 = (AA)B T7 = ABT3
DeMorgan’s Theorem Powerful theorem in digital design Y = AB = A + B Y = A + B = AB
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 Pushing bubbles on allgate inputs forward toward the output puts a bubble on the output and changes the gate body
Bubble Pushing What is the Boolean expression for this circuit?
Bubble Pushing Y = AB + CD What is the Boolean expression for this circuit?
Bubble Pushing Rules Begin at the output of the circuit and work toward the inputs. Push any bubbles on the final output back toward the inputs. Working backward, draw each gate in a form so that bubbles cancel.