260 likes | 324 Views
Announcements. Assignment 6 due tomorrow No Assignment 7 yet. Announcements. Joe & Ali: Game show Buzzer Trisha & Matt: EMG & pedal Jamy, Lei, Mark: LED cube: parts? Jingliang: Piezoelectric charger Eric: Water printer(?) Philip &Gaurav: model train (parts?). Lecture 16 Overview.
E N D
Announcements • Assignment 6 due tomorrow • No Assignment 7 yet
Announcements • Joe & Ali: Game show Buzzer • Trisha & Matt: EMG & pedal • Jamy, Lei, Mark: LED cube: parts? • Jingliang: Piezoelectric charger • Eric: Water printer(?) • Philip &Gaurav: model train (parts?)
Lecture 16 Overview • Logic gates • Boolean Algebra • DeMorgan's Theorem • Karnaugh maps
The XOR gate C=AXORB C=AB C The XNOR gate C=ANORB C=AB C
How to build a digital gate • We can build an inverter with one switch: INPUT=1 INPUT=0 • A NAND gate takes two switches in series: INPUT A INPUT B
CMOS gates • Gates are very easy to build using MOSFET transistors (recall; transistors can be considered as a voltage controlled switch) • p-type conduct when the input=0 • n-type conduct when the input=1
CMOS NAND gate • NAND gates are built using 4 MOSFETs • p-type conduct when the input=0 • n-type conduct when the input=1
CMOS NAND gate • The NAND gate is by far the most important • It is cheapest to construct • It can be used to produce all other logic operations
CMOS NAND gate • The NAND gate is by far the most important • It is cheapest to construct • It can be used to produce all other logic operations XOR • In general, how do we figure out how to build a complex logic circuit?
Method I: Boolean Algebra AND: OR: NOT: Associative Law: Commutative Law: Precedence: Distributive Law: DeMorgan's Theorem:
Complete Rules of Boolean Algebra AND: OR: NOT: Associative Law: Commutative Law: Precedence: Distributive Law: DeMorgan's Theorem:
DeMorgan's Theorem Proof "The contradictory opposite of a disjunctive proposition is a conjunctive proposition composed of the contradictories of the parts of the disjunctive proposition (William of Ockham, Summa Logicae)." OR "break the line, change the sign" Duality between AND and OR means that any logic function can be implemented by using just OR and NOT gates , or by just AND and NOT gates
Using the Rules of Boolean Algebra Example: Simplify the following function: 14 gates expand this =1 3 gates
Method II: Karnaugh Maps • There are often many solutions available to implement a given logic expression • How do we find the most efficient (least number of gates)? • Use a Karnaugh map. Set up the Karnaugh map like this: Three inputs; A, B and C Two inputs; A and B Three inputs; A,B and C 4 cells 8 cells 8 cells • Each map consists of 2n cells, where n is the number of inputs (logic variables) • Row and column assignments arranged such that adjacent terms change by only one bit • so: use 00,01,11,10 instead of 00,01,10,11 • Makes it easier to identify subcubes
Karnaugh Maps: Setting up the Maps Four inputs; A,B,C and D 16 cells
Karnaugh Maps: Setting up the Maps • Here's an example: Truth Table: Karnaugh Map • The Karnaugh map "wraps around itself" - i.e. the top and bottom, right and left edges are touching. • Adjacent cells contain terms which vary by only one input variable. • A subcube is defined as a set of 2m adjacent cells with the same value. m is an integer, so the subcube can be 1,2,4,8... cells This is how we want the circuit to behave.
Karnaugh Maps: Example 1 • "Box the ones" This subcube is represented by A'·B This subcube is represented by A·C' • So, the output is true if (A'ANDB) OR (AANDC') are true • "sum of products": A'·B + A·C' • This requires 5 gates: • note clean schematic layout • The method only works if ALL of the 1's are considered • The minimal expression uses the smallest number of maximal subcubes
Karnaugh Maps: Example 2: CD CD AB AB • Draw the table • Find any isolated cells • Find any 2-cell subcubes which are not adjacent to other 2-cell subcubes. Remember wrapping
Karnaugh Maps: Example 2: CD AB • Draw the table • Find any isolated cells • Find 2-cell subcubes. • Find 4-cell subcubes which are not adjacent to other four cell subcubes • Find 8-cell subcubes etc etc. • Minimal expression is formed by the smallest number of maximal subcubes
Karnaugh Maps: Example 2: CD AB • A'·B'·D'
Karnaugh Maps: Example 2: CD AB • B'·C'
Karnaugh Maps: Example 2: CD AB • C'·D
Karnaugh Maps: Example 2: CD AB • A·D
Karnaugh Maps: Example 2: CD AB • So sum-of products realization is: O=A'·B'·D'+B'·C'+C'·D+AD • Requires 9 gates
Karnaugh Maps: Example 2: • So sum-of products realization is: O=A'·B'·D'+B'·C'+C'·D+AD • Requires 9 gates A'·B'·D' B'·C' C'·D AD