Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and

Slides:



Advertisements
Similar presentations
Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Digital Logic.
Advertisements

Digital Logic Design Gate-Level Minimization
BOOLEAN ALGEBRA. A Mathematical notation used to represent the function of the Digital circuit. A notation that allows variables & constants to have only.
Prof. Sin-Min Lee Department of Computer Science
Combinational Logic Circuits Chapter 2 Mano and Kime.
ECE 238L Computer Logic Design Spring 2010
Gate-Level Minimization
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Revision Mid 2 Prof. Sin-Min Lee Department of Computer Science.

Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter 2: Combinatorial Logic Circuits Illustration Pg. 32 Logic Circuit Diagrams - Circuit Optimization -2,3,4 level maps 48 elements Optimized to 25.
IKI a-Simplification of Boolean Functions Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture.
Logic Design CS221 1 st Term K-Map Cairo University Faculty of Computers and Information.
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
F = ∑m(1,4,5,6,7) F = A’B’C+ (AB’C’+AB’C) + (ABC’+ABC) Use X’ + X = 1.
1 Digital Logic Design Week 5 Simplifying logic expressions.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Chapter 3 Gate-Level Minimization
PRASAD A. PAWASKAR SPN. NO DETE 2 SEMESTER lec1-11.
Boolean Algebra Introduction Logical arguments are valid (or not) by virtue of their form, not content Example All men are mortal(premise 1) Harry is a.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Chapter3: Gate-Level Minimization Part 1 Origionally By Reham S. Al-Majed Imam Muhammad Bin Saud University.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
CS1Q Computer Systems Lecture 7
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
XOR Operator A short digression… … to introduce another Boolean operation: exclusive- OR (XOR) ABA + B XOR.
ENG241 Digital Design Week #2 Combinational Logic Circuits.
Karnaugh Maps (K-Maps)
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
CS231 Boolean Algebra1 Summary so far So far: – A bunch of Boolean algebra trickery for simplifying expressions and circuits – The algebra guarantees us.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
June 12, 2002© Howard Huang1 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are.
Karnaugh Map (K-Map) By Dr. M. Khamis Mrs. Dua’a Al Sinari.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Department of Preparatory Year, Umm Al Qura University CSCI 240 Digital Logic.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Digital Logic. Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations.
CS231 Boolean Algebra1 Circuit analysis summary After finding the circuit inputs and outputs, you can come up with either an expression or a truth table.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CE1110: Digital Logic Design Gate Level Minimization Karnaugh Maps (K-Maps)
Assembly Lab1 - Review.
CHAPTER 3 Simplification of Boolean Functions
Department of Preparatory Year, Umm Al Qura University
Computer Organisation
Prof. Sin-Min Lee Department of Computer Science
CS 352 Introduction to Logic Design
Princess Sumaya University
Circuit analysis summary
Lecture 3 Gunjeet Kaur Dronacharya Group of Institutions
Karnaugh Maps References: Lecture 4 from last semester
Lecture 4 Sums of Product Circuits Simplification
BASIC & COMBINATIONAL LOGIC CIRCUIT
Karnaugh Maps Topics covered in this presentation: Karnaugh Maps
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
MINTERMS and MAXTERMS Week 3
COE 202: Digital Logic Design Combinational Logic Part 3
Minimization of Switching Functions
Dr. Clincy Professor of CS
From now on: Combinatorial Circuits:
Karnaugh maps Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. These operations can.
Analysis of Logic Circuits Example 1
Analysis of Logic Circuits Example 1
Circuit Simplification and
Computer Architecture
Presentation transcript:

Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and Karnaugh Maps Prof. Sin-Min Lee Department of Computer Science

Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations +, *, ’. Binary operations have two inputs, unary has one OR + AND * NOT ’

Logic Circuits ≡ Boolean Expressions All logic circuits are equivalent to Boolean expressions and any boolean expression can be rendered as a logic circuit. AND-OR logic circuits are equivalent to sum-of-products form. Consider the following circuits: A B C A Y=AB*+B*C B ABC C A B C Y AB*C Y A*B y=ABC+AB*C+A*B

NAND and NOR Gates NAND and NOR gates can greatly simplify circuit diagrams. As we will see, can you use these gates wherever you could use AND, OR, and NOT. A B AB 1 NAND A B AB 1 NOR

XOR and XNOR Gates XOR is used to choose between two mutually exclusive inputs. Unlike OR, XOR is true only when one input or the other is true, not both. A B AB 1 A B A B 1 XOR XNOR

NAND and NOR as Universal Logic Gates Any logic circuit can be built using only NAND gates, or only NOR gates. They are the only logic gate needed. Here are the NAND equivalents:

NAND and NOR as Universal Logic Gates (cont) Here are the NOR equivalents: NAND and NOR can be used to reduce the number of required gates in a circuit.

Example Problem A hall light is controlled by two light switches, one at each end. Find (a) a truth function, (b) a Boolean expression, and (c) a logic network that allows the light to be switched on or off by either switch. Let x and y be the switches: x y f(x,y) 1 (What kind of gate has this truth table?

x y f(x,y) 1 Example (cont) One possible equation is the complete sum-of-products form: f(X,Y) = XY* + X*Y Use The Most Complex Machine xLogicCircuit Module to implement the equation.

Hint 2 : Use 2 NAND gates to build 2 NOT gates How to use NAND gates to build an OR gate? Truth Table A B C D Q A B C D Q 1 Hint 1 : Use 3 NAND gates Hint 2 : Use 2 NAND gates to build 2 NOT gates Hint 3 : Put the 3rd NAND gate after the 2 “NOT” gates

Hint 2 : Use 3 NAND gates to build an OR gate How to use NAND gates to build a NOR gate? Truth Table A B C D Q E A B C D E Q 1 Hint 1 : Use 4 NAND gates Hint 2 : Use 3 NAND gates to build an OR gate Hint 3 : Use a NOR gate to build a NOT gate Hint 4 : Put the “NOT” gate after “OR” gate

Since functions can be represented by a sum of product form of minterms, any function can be shown in the map by placing each a 1 in each square which represents a minterm in the function. EXAMPLE: Draw the map for f = X + Y 1. Determine which minterms are needed by using truth table. X Y f = X + Y minterm 0 0 0 m0 0 1 1 m1 1 0 1 m2 1 1 1 m3

2. Draw the map and place a 1 in each square for required minterms. Y X 1 1 X 1 f = X + Y = m1 + m2 + m3 = X´ Y + X Y´ + X Y

Use the 2-Variable Karnaugh Map for Minimization Example: Given f (X,Y) =  (0, 2) Find: Simplified sum of products Y Y X m0 m1 X m2 m3

2-Variable Karnaugh Map 1. Place the 1’s corresponding to the minterms on the map. f (X,Y) =  (0, 2) Y Y X 1 X 1

2-Variable Karnaugh Map 2. Now group the 1’s into columns or rows; in this case we can group them in the first column. f (X,Y) =  (0, 2) Y Y X 1 X 1 3. This column is Y´ so the simplified function f (X,Y) = Y´

2-Variable Karnaugh Map Example 2: Given f (X,Y) =  (0, 2, 3) Find: Simplified sum of products Y Y X m0 m1 X m2 m3

2-Variable Karnaugh Map Example 3: Given f (X,Y) =  (0, 1) Find: Simplified sum of products Y Y X m0 m1 X m2 m3

Three Variable Map m0 m1 m3 m2 m4 m5 m7 m6 Y YZ X 0 0 0 1 1 1 10 0 0 0 1 1 1 10 X´ Y´ Z´ X´ Y´ Z X´ Y Z X´ YZ´ 1 X Y´ Z´ XY´Z X Y Z X Y Z´ X Z

Three Variable Map There are 2N = 23 = 8 squares. The minterms are arranged so that only one variable changes from 0 to 1 or from 1 to 0 as you move from square to square in the vertical or horizontal direction. For any two adjacent squares, only one literal changes from complemented to non-complemented (normal). From this property the left and right ends of the map are “adjacent.”

Y YZ X 0 0 0 1 1 1 10 X´Y´Z´ X´ Y´ Z X´ Y Z X´ Y Z´ X 1 X Y´Z´ X Y´ Z X Y Z X YZ´ Z Using the distributive and complement properties, any two adjacent minterms can be combined and simplified to a single term with one less literal.

Combining terms on the Karnaugh Map simplifies Boolean functions. Example: combine adjacent squares for X´ Y´ Z and XY´Z X´Y´ Z + XY´Z = Y´ Z ( X´ + X) = Y´ Z · 1 = Y´ Z Example: Combine adjacent squares for X Y´Z´ and X YZ´ XY´Z´ + X YZ´ = X Z´ ( Y´ + Y) = X Z´ · 1 = X Z´ Y YZ X 0 0 0 1 1 1 10 X´Y´Z´ X´ Y´ Z X´ Y Z X´ Y Z´ X 1 X Y´Z´ X Y´ Z X Y Z X YZ´ Z

Example: Simplify f = X´Y´ Z´ + X Y Z + X´Y´ Z + X´ Y Z Y YZ X 0 0 0 1 1 1 10 1 1 1 1 X 1 Z f = X´Y´ + Y Z

Even if the function is not in its simplest form, we can still use the map to simplify it further. Example: Simplify f = X´ Y´ + Y´ Z + X´ Z + X Y Z Y YZ X 0 0 0 1 1 1 10 1 1 1 1 1 X 1 Z f = Z + X´ Y´ (by further grouping of minterms)

3-Variable Karnaugh Map Example: Given f (X,Y,Z) =  (0, 2, 3, 4, 7) Find: Simplified sum of products YZ Y X m0 m1 m3 m2 m5 m7 m6 m4 X Z

3-Variable Karnaugh Map Example: Given f (X,Y,Z) =  (0, 2, 3, 4, 7) Simplified sum of products: f = YZ + YZ + XY YZ Y X 1 1 1 1 1 X Z

Truth Table f (X,Y,Z) =  (0, 2, 3, 4, 7) Simplified sum of products: f = Y´Z´ + YZ + X´Y The truth table for f: X Y Z f 0 0 0 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1

f (X,Y,Z) =  (0, 2, 3, 4, 7) = Y´Z´ + YZ + X´Y Y Z Y f Z X Y

3-Variable Karnaugh Map Example 2: Given f (X,Y,Z) =  (2, 3, 4, 5) Find: Simplified sum of products YZ Y X m0 m1 m3 m2 m5 m7 m6 m4 X Z

3-Variable Karnaugh Map Example 2: Given f (X,Y,Z) =  (1, 2, 5, 6, 7) Find: Simplified sum of products YZ Y X m0 m1 m3 m2 m5 m7 m6 m4 X Z

3-Variable Karnaugh Map Example 3: Given f (X,Y,Z) = X´Z + X´Y + XY´Z + YZ Find: “Sum of minterms” expression YZ Y X m0 m1 m3 m2 m5 m7 m6 m4 X Z

Exclusive OR XOR f = X´Y + XY´ = X  Y X Y f 0 0 0 0 1 1 1 0 1 1 1 0

Exclusive OR f (X,Y) =  (1, 2) = X  Y Y Y X 1 1 X

XOR Truth Table f (X,Y,Z) = X  Y  Z =  (1, 2, 4, 7) The truth table for f: X Y Z f 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1

Exclusive OR X Y f (X,Y,Z) = X  Y  Z Z

Four Variable Map Y YZ WX 0 0 0 1 1 1 10 m0 m1 m3 m2 m4 m5 m7 m6 00 01 0 0 0 1 1 1 10 m0 m1 m3 m2 m4 m5 m7 m6 W x´y´z 00 01 m12 m13 m15 m14 m8 m9 m11 m10 X 11 w x y´z W 10 Z

Four Variable Map N = 4 variables 2N = 24 = 16 square (minterms) Row and column are numbered using a reflected-code sequence. The minterm number can be obtained by concatenation of the row and column number . Example: Row 4 = 10, Column 2 = 01 giving 1001 = 9 decimal for W X´ Y´ Z.

1 Y YZ 0 0 0 1 1 1 10 wx´y´z wx´y´z´ wx´y´z´ w´x´y z´ 00 01 X 11 W 10 0 0 0 1 1 1 10 wx´y´z 1 wx´y´z´ wx´y´z´ w´x´y z´ 00 01 X 11 W 10 Z Notice that top and bottom edges and right and left edges are “adjacent.”

1 square = a term with 4 literals 16 square = a function equal to 1 Y YZ 0 0 0 1 1 1 10 WX 00 01 X 11 W 10 Z

Simplify: f (W, X, Y, Z) = W X´ Z + W X Z + W´ Y Z f = W Z + Y Z f = Z ( W + Y) Y YZ 0 0 0 1 1 1 10 WX 00 01 X 11 W 10 Z

Simplify: f (W, X, Y, Z) =  ( 0, 1, 4, 5, 6, 8, 9, 12, 13, 14) f = Y´ + WZ´ + XZ´ Y YZ 0 0 0 1 1 1 10 WX 00 01 X 11 W 10 Z 8 square 4 square 4 square

Simplify: f = W´ X´ Y´ + X´Y Z´ + W´ X Y Z´ + W X´ Y´ f = X´ Z´ + X´ Y´ + W´ Y Z´ Y YZ 0 0 0 1 1 1 10 WX 00 01 X 11 10 Z

Simplification of kmap Generate all PIs Find EPIs If EPIs can cover all minterms, then it is answer. Otherwise choose some non-essential PIs (which has less cost) such that all minterms are cover.

Step 1 Generate PIs Blue circle are PIs They are the largest circle you can drawn on kmap

Step 2 Find EPIs Red circle are EPIs Minterm 5, 14, 11 can only be cover by these 3 red circle

Step 3 EPIs cannot cover minterm 7 Choose between green/blue circle to cover minterm 7 Green is chosen as it is larger Less cost

Final Final result is obtained x3x4’ + x2’x3 + x1’x3 + x2x3’x4

Complement and Product of Sums On the K Map a 1 was placed in the squares which represented minterms for a function. The squares not used represent the complement of the function. Mark these squares with 0, combine them and read the complement as a sum of products function, f´. Using De Morgan’s Law on f´ will give f, the original Function. It will be in a product of sums form. Example: Determine the Product of sums form for f ( W, X, Y, Z) =  (0, 1, 2, 5, 8, 9, 10) f´ = W X + YZ + X Z´ from the map f = (W´ + X´) ( Y´ + Z´) ( X´ + Z) by De Morgan’s

Complement and Product of Sums Also, can determine the product of sums form directly from The map by recognizing that the 0’s on the map represent maxterms. Remember that a 1 on the edge of the map Represents a complemented literal for maxterms. Thus, for f ( W, X, Y, Z) =  (0, 1, 2, 5, 8, 9, 10)……. (combine 0’s on k-map)… f = ( Y´ + Z´) (W´ + X´) ( X´ + Z)

Y YZ 0 0 0 1 1 1 10 WX 1 1 0 1 00 0 1 0 0 01 11 0 0 0 0 W 10 1 1 0 1 Z f = ( Y´ + Z´ ) ( W´ + X´ ) ( X´ + Z)