Chapter 2 Digital Design and Computer Architecture , 2 nd Edition David Money Harris and Sarah L. Harris Chapter 2 <1>
Chapter 2 :: Topics • Introduction • Boolean Equations • Boolean Algebra • From Logic to Gates • Multilevel Combinational Logic • X’s and Z’s, Oh My • Karnaugh Maps • Combinational Building Blocks • Timing Chapter 2 <2>
Introduction A logic circuit is composed of: • Inputs • Outputs • Functional specification • Timing specification functional spec inputs outputs timing spec Chapter 2 <3>
Circuits • Nodes – Inputs: A , B , C – Outputs: Y , Z n1 A E1 – Internal: n1 B E3 Y • Circuit elements C E2 Z – E1, E2, E3 – Each a circuit Chapter 2 <4>
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 functional spec inputs outputs timing spec Chapter 2 <5>
Rules of Combinational Composition • Every element is combinational • Every node is either an input or connects to exactly one output • The circuit contains no cyclic paths • Example: Chapter 2 <6>
Boolean Equations • Functional specification of outputs in terms of inputs • Example: S = F( A , B , C in ) C out = F( A , B , C in ) A S C B L C out C in S = A B C in C out = AB + AC in + BC in Chapter 2 <7>
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 • 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) Chapter 2 <8>
Sum-of-Products (SOP) Form • All equations can be written in SOP form • Each row has a minterm • A minterm is a product (AND) of literals • Each minterm is TRUE for that row (and only that row) • Form function by ORing minterms where the output is TRUE • Thus, a sum (OR) of products (AND terms) minterm minterm A B Y name m 0 0 0 0 A B m 1 0 1 1 A B m 2 1 0 0 A B m 3 1 1 1 A B Y = F( A , B ) = Chapter 2 <9>
Sum-of-Products (SOP) Form • All equations can be written in SOP form • Each row has a minterm • A minterm is a product (AND) of literals • Each minterm is TRUE for that row (and only that row) • Form function by ORing minterms where the output is TRUE • Thus, a sum (OR) of products (AND terms) minterm minterm A B Y name m 0 0 0 0 A B m 1 0 1 1 A B m 2 1 0 0 A B m 3 1 1 1 A B Y = F( A , B ) = Chapter 2 <10>
Sum-of-Products (SOP) Form • All equations can be written in SOP form • Each row has a minterm • A minterm is a product (AND) of literals • Each minterm is TRUE for that row (and only that row) • Form function by ORing minterms where the output is TRUE • Thus, a sum (OR) of products (AND terms) minterm minterm A B Y name m 0 0 0 0 A B m 1 0 1 1 A B m 2 1 0 0 A B m 3 1 1 1 A B Y = F( A , B ) = AB + AB = Σ (1, 3) Chapter 2 <11>
Product-of-Sums (POS) Form • All Boolean equations can be written in POS form • Each row has a maxterm • A maxterm is a sum (OR) of literals • Each maxterm is FALSE for that row (and only that row) • Form function by ANDing the maxterms for which the output is FALSE • Thus, a product (AND) of sums (OR terms) maxterm name maxterm A B Y M 0 0 0 0 A + B M 1 0 1 1 A + B M 2 1 0 0 A + B M 3 1 1 1 A + B Y = F( A , B ) = ( A + B )( A + B ) = Π (0, 2) Chapter 2 <12>
Boolean Equations Example • You are going to the cafeteria for lunch – You won’t eat lunch (E) – If it’s not open (O) or – If they only serve corndogs (C) • Write a truth table for determining if you will eat lunch (E). O C E 0 0 0 1 1 0 1 1 Chapter 2 <13>
Boolean Equations Example • You are going to the cafeteria for lunch – You won’t eat lunch (E) – If it’s not open (O) or – If they only serve corndogs (C) • Write a truth table for determining if you will eat lunch (E). O C E 0 0 0 0 1 0 1 0 1 1 1 0 Chapter 2 <14>
SOP & POS Form • SOP – sum-of-products minterm O C E 0 0 O C 0 1 O C 1 0 O C 1 1 O C • POS – product-of-sums maxterm O C E 0 0 O + C 0 1 O + C 1 0 O + C 1 1 O + C Chapter 2 <15>
SOP & POS Form • SOP – sum-of-products O C E minterm 0 0 0 O C E = OC 0 1 0 O C 1 0 1 O C = Σ (2) 1 1 0 O C • POS – product-of-sums maxterm O C E 0 0 0 O + C E = ( O + C )( O + C )( O + C ) 0 1 0 O + C = Π (0, 1, 3) 1 0 1 O + C 1 1 0 O + C Chapter 2 <16>
Boolean Algebra • Axioms and theorems to simplify Boolean equations • Like regular algebra, but simpler: variables have only two values (1 or 0) • Duality in axioms and theorems: – ANDs and ORs, 0’s and 1’s interchanged Chapter 2 <17>
Boolean Axioms Chapter 2 <18>
T1: Identity Theorem • B 1 = B • B + 0 = B Chapter 2 <19>
T1: Identity Theorem • B 1 = B • B + 0 = B B = B 1 B = B 0 Chapter 2 <20>
T2: Null Element Theorem • B 0 = 0 • B + 1 = 1 Chapter 2 <21>
T2: Null Element Theorem • B 0 = 0 • B + 1 = 1 B = 0 0 B = 1 1 Chapter 2 <22>
T3: Idempotency Theorem • B B = B • B + B = B Chapter 2 <23>
T3: Idempotency Theorem • B B = B • B + B = B B = B B B = B B Chapter 2 <24>
T4: Identity Theorem • B = B Chapter 2 <25>
T4: Identity Theorem • B = B = B B Chapter 2 <26>
T5: Complement Theorem • B B = 0 • B + B = 1 Chapter 2 <27>
T5: Complement Theorem • B B = 0 • B + B = 1 B = 0 B B = 1 B Chapter 2 <28>
Boolean Theorems Summary Chapter 2 <29>
Boolean Theorems of Several Vars ( ) Note: T8’ differs from traditional algebra: OR (+) distributes over AND (•) Chapter 2 <30>
Simplifying Boolean Equations Example 1: Y = AB + AB Chapter 2 <31>
Simplifying Boolean Equations Example 1: Y = AB + AB = B ( A + A ) T8 = B (1) T5’ = B T1 Chapter 2 <32>
Simplifying Boolean Equations Example 2: Y = A ( AB + ABC) Chapter 2 <33>
Simplifying Boolean Equations Example 2: Y = A ( AB + ABC) = A ( AB( 1 + C )) T8 = A ( AB (1)) T2’ = A ( AB ) T1 = ( AA ) B T7 = AB T3 Chapter 2 <34>
DeMorgan’s Theorem • Y = AB = A + B A Y B A Y B • Y = A + B = A B A Y B A Y B Chapter 2 <35>
Bubble Pushing • Backward: – Body changes – Adds bubbles to inputs A A Y Y B B • Forward: – Body changes – Adds bubble to output A A Y Y B B Chapter 2 <36>
Bubble Pushing • What is the Boolean expression for this circuit? A B Y C D Chapter 2 <37>
Bubble Pushing • What is the Boolean expression for this circuit? A B Y C D Y = AB + CD Chapter 2 <38>
Bubble Pushing Rules • Begin at output, then work toward inputs • Push bubbles on final output back • Draw gates in a form so bubbles cancel A B C Y D Chapter 2 <39>
Bubble Pushing Example A B C Y D Chapter 2 <40>
Bubble Pushing Example no output A bubble B C Y D Chapter 2 <41>
Bubble Pushing Example no output A bubble B C Y D bubble on A input and output B C Y D Chapter 2 <42>
Bubble Pushing Example no output A bubble B C Y D bubble on A input and output B C Y D no bubble on input and output A B C Y D Y = ABC + D Chapter 2 <43>
From Logic to Gates • Two-level logic: ANDs followed by ORs • Example: Y = ABC + ABC + ABC A B C A B C minterm: ABC minterm: ABC minterm: ABC Y Chapter 2 <44>
Circuit Schematics Rules • Inputs on the left (or top) • Outputs on right (or bottom) • Gates flow from left to right • Straight wires are best Chapter 2 <45>
Circuit Schematic Rules (cont.) • Wires always connect at a T junction • A dot where wires cross indicates a connection between the wires • Wires crossing without a dot make no connection wires crossing wires connect wires connect without a dot do at a T junction at a dot not connect Chapter 2 <46>
Multiple-Output Circuits • Example: Priority Circuit A A 2 A 1 A Y 3 Y 2 Y 1 Y 0 Output asserted 3 0 0 0 0 0 corresponding to 0 0 0 1 0 0 1 0 most significant 0 0 1 1 0 1 0 0 TRUE input 0 1 0 1 0 1 1 0 0 1 1 1 A 3 1 0 0 0 Y 3 1 0 0 1 1 0 1 0 A 2 Y 2 1 0 1 1 1 1 0 0 A 1 Y 1 1 1 0 1 1 1 1 0 A 0 Y 0 1 1 1 1 PRIORITY CiIRCUIT Chapter 2 <47>
Recommend
More recommend