ENG241 Digital Design Week #2 Combinational Logic Circuits.

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
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.
Chapter 2 Logic Circuits.
Gate-level Minimization
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Computer Engineering (Logic Circuits) (Karnaugh Map)
Logic gate level Part 3: minimizing circuits. Improving circuit efficiency Efficiency of combinatorial circuit depends on number & arrangement of its.
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.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Chapter 2: Boolean Algebra and Logic Functions
Boolean Algebra. Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
Department of Computer Engineering
D IGITAL L OGIC D ESIGN I G ATE -L EVEL M INIMIZATION.
Combinational Logic 1.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Overview Part 1 – Gate Circuits and Boolean Equations
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
Combinational Logic Part 2: Karnaugh maps (quick).
Gate-Level Minimization
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Computer Engineering (Logic Circuits) (Karnaugh Map)
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
Unit 1 Minimization Techniques and Logic Gates. Introduction to Digital Systems Analog devices and systems process time-varying signals that can take.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
ECE 3110: Introduction to Digital Systems Chapter #4 Review.
1 COMP541 Combinational Logic - II Montek Singh Jan 18, 2012.
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
Boolean Algebra. BOOLEAN ALGEBRA Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0).
CHAPTER 2 Boolean algebra and Logic gates
Boolean Algebra & Logic Gates
CHAPTER 3 Simplification of Boolean Functions
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
Chapter 2: Boolean Algebra and Logic Functions
14:332:231 DIGITAL LOGIC DESIGN Boolean Algebra
ECE 2110: Introduction to Digital Systems
Computer Organisation
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
ECE 3110: Introduction to Digital Systems
CHAPTER 2 Boolean Algebra
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Princess Sumaya University
Boolean Algebra.
Chapter 2 Boolean Algebra and Logic Gate
Chapter 3 Gate-level Minimization.
MINTERMS and MAXTERMS Week 3
COMP541 Combinational Logic - II
Minimization of Switching Functions
Overview Part 2 – Circuit Optimization
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
Circuit Simplification and
Computer Architecture
Presentation transcript:

ENG241 Digital Design Week #2 Combinational Logic Circuits

Resources  Chapter #2, Mano Sections 2.1 Logic Gates 2.2 Boolean Algebra 2.3 Min Terms & Max Terms 2.4 Logic Optimization 2

Week #2 Topics  Binary Logic and Gates  Boolean Functions  Boolean Algebra (Truth Tables)  Basic Identities  Standard Forms (Minterms, Maxterms)  Circuit Optimization (K-Maps)  Map Manipulations (Prime Implicants) 3

Binary Logic  Binary variables Can be 0 or 1 (T or F, low or high) Variables named with single letters in examples Really use words when designing circuits  Basic Functions AND OR NOT 4

5 Logic Signals BB inary ‘0’ is represented by a “low” voltage (range of voltages) BB inary ‘1’ is represented by a “high” voltage (range of voltages) TT he “voltage ranges” guard against noise of binary signalsExample

NOT Operator  Unary Operator  Symbol is bar Z = X  Truth table ->  Inversion 6

Inverter Gate 7

AND Gate  Symbol is dot Z = X.Y  Or no symbol Z = XY  Truth table ->  Z is 1 only if Both X and Y are 1 8 Switches in series => AND

9 Switching Circuits (AND Gate) AND AND Gate: Symbol

AND Gate: Timing Timing Diagrams 10

OR Gate  Symbol is + Not addition Z = X + Y  Truth table ->  Z is 1 if either 1 Switches in parallel => OR 11

12 Switching Circuits (OR Gate) OR OR Gate: Symbol

OR Gate: Timing Timing Diagrams 13

14 Binary Logic  Truth Tables, Boolean Expressions, and Logic Gates xyz xyz xz ANDORNOT z = x y = x yz = x + yz = x = x’

More Inputs  Work same way  What’s output? 15

NAND Gates  Very common for discrete logic 16

NOR Gates  NOT OR  Also common X Y Z

Logic Diagram  Boolean Expression  Logic Diagram 18  What is the Boolean expression?

Boolean Expression  Logic Diagram  Consider function How many gates do we need to implement this function? 19

Boolean Operator Precedence  The order of evaluation in a Boolean expression is:  Consequence: Parentheses appear around OR expressions  Example: F = A(B + C)(C + D) 1.Parentheses 2. Not 3. And 4. Or 20

Mechanically Go From Truth Table to Function  Steps of design: 1. Start with Problem Statement 2. Obtain Truth Table 3. Obtain a algebraic boolean function 4. Draw the circuit diagram

Design Steps (Simple Example) Specification:  Design a circuit that has 3 inputs x, y, z and a single output F. F is true when the three inputs are the same and false otherwise. 22

Design Steps (Simple Example)  Step #1, since we have three inputs then the Truth Table has to have 8 entries (2 3 ) XYZF

Design Steps (Simple Example)  Step #2, Pick the entries in the truth table where F is equal 1.  Give Expression: XYZF

Design Steps (Simple Example)  Step #3, Draw a logic diagram that represents the boolean functions. XYZF

Representation: Truth Table  2 n rows where n # of variables 26  Give Boolean Expression?  Not Simplified!

Boolean Functions: Complexity  There can be different representations for a boolean function the simplest (Why?)  Usually we want the simplest (Why?) Fewer gates (Less Area, Less Power Consumption, Faster!)  We can use identities to reduce complexity of Boolean expressions. 27

Boolean Algebra & Identities  There is only one way that a Boolean function can be represented in a truth table.  However, when the function is in algebraic form, it can be expressed in a variety of ways.  Boolean algebra is a useful tool for simplifying digital circuits.  Use identities to manipulate functions 28

Table of Identities 29

Dual of an Expression  The dual of an expression is obtained by: 1. Changing AND to OR and OR to AND throughout 2. Changing 1’s to 0’s and 0’s to 1’s  For example  The dual of X+0 is: X.1,  The dual of X.0 is: X+1 30

Duals  Left and right columns are duals 31

Single Variable Identities 32

Commutative  Order independent 33

Associative  Independent of order in which we group  So can also be written as and 34

Distributive Identity 15 is the dual of identity 14. Identity 14 is well known from ordinary algebra! 35

DeMorgan’s Theorem  Used a lot  NOR equals invert AND  NAND equals invert OR 36 Proof?

Truth Tables for DeMorgan’s 37

Useful Theorems ninimizatioMyyyx     tionSimplifica yxyxyxyx       Consensuszyxzyzyx              zyxzyzyx   x x x xx xx 38

Example 1: Boolean Algebraic Proof  A + A · B = A (Absorption Theorem) Proof Steps Justification (identity or theorem) A + A · B =A · 1 + A · B X = X · 1 = A · ( 1 + B) X · Y + X · Z = X · (Y + Z) = A · X = 1 = A X · 1 = X 39

Cont.. Boolean Algebraic Proof Cont.. Boolean Algebraic Proof  Our primary reason for doing proofs is to learn: Careful and efficient use of the identities and theorems of Boolean algebra, and How to choose the appropriate identity or theorem to apply to make forward progress, irrespective of the application. 40

Algebraic Manipulation  When a Boolean equation is implemented with logic gates, i. Each term requires a gate, ii. Each variable designates an input to the gate.  We define a literal as a single variable within a term that may or may not be complemented.  The expression above has THREE terms and EIGHT literals. 41

Algebraic Manipulation  Consider function How many gates do we need to implement this function? 42

Simplify Function Apply End Result? 43

Fewer Gates 1.Fewer Gates! 2.Fewer Inputs per gate! 44

The Duality Principle Recall how to obtain the dual of an expression! The duality principle states that a Boolean equation remains valid if we take the dual of the expression on both sides of the equal sign. 45

1. Complement of a Function XYZFF The complement representation for a function F, (F’), is obtained from an interchange of 1’s to 0’s and 0’s to 1’s for the values of F in the truth table. 46

2. Cont..Complement of a Function  The complement of a function can be derived algebraically by applying DeMorgan’s theorem. 47

3. Cont..Complement of a Function  Yet another way of deriving the complement of a function is to: Take the dual of the function equation Complement each literal. 48

ENG241 Digital Design Cont..Week #2 Combinational Logic Circuits

Resources  Chapter #2, Mano Sections 2.3 Standard Forms 2.4 Circuit Optimization (K-Maps) 50

Week #2, #3 Topics  Standard Forms (Minterms, Maxterms)  Circuit Optimization (K-Maps)  Map Manipulations (Prime Implicants) 51

From Truth Table to Function  Consider a truth table  Can implement F by taking OR of all terms that are 1 52 MinTerm Product Term

Standard Forms  Assume we have a circuit with 3 variables X, Y, Z  Definitions: Product Term – a subset of the variables appear  XY, XZ, XZ’, XYZ Min Term – is a product term in which all variables appear once  (XYZ, X’YZ, X’Y’Z’) 53

Number of Minterms  For n variables, there will be 2 n minterms  Like binary numbers from 0 to 2 n -1 54

Definition: Minterm  Is a Product Term in which ALL variables appear once (complemented or not) 55

Sum of Minterms (SOM)  OR all of the minterms of truth table row with a 1 In this case m 1 + m 3 + m 4 + m 6 In this case m 0 +m 2 +m 5 +m 7 56 m0m0 m1m1 m2m2 m3m3 m4m4 m5m5 m6m6 m7m7

Alternative Representation In this case m 1 + m 3 + m 4 + m 6 In this case m 0 +m 2 +m 5 +m 7 57

Summary of Properties of Minterms  There are 2 n minterms for a Boolean function with n variables  Any Boolean function can be expressed as a logical sum of minterms  The complement of a function contains those minterms not included in the original function.  A function that includes all the 2 n minterms is equal to logic 1. 58

Sum of Products (SOP)  The sum-of-minterms form is a standard algebraic expression that is obtained directly from a truth table.  The expression obtained contains the maximum number of literals in each term.  Simplification of the sum-of- minterms expression is called sum- of-products. 59

SOM vs. SOP Sum of minterms After Simplification we get the Sum of products 60

Sum of Products Implementation Sum of products We refer to this implementation as a two- level circuit 61

2-level Implementation  Sum of products has 2 levels of gates  Is there a 3-level rep of this circuit? 62

2-level vs. 3-level Implementation AB + CD + CE can be Also expressed as AB + C(D+E) What’s best? Hard to answer!! More gate delays? But maybe we only have 2-input gates 63

Definition: Maxterm  Is a Sum Term in which all variables appear once (complemented or not) 64

Minterm related to Maxterm  Minterm and maxterm with same subscripts are complements  Example (Use Demorgans theory) 65

Product of Maxterms  We can also express F as AND of all rows that should evaluate to 0 66 M0M0 M1M1 M2M2 M3M3 M4M4 M5M5 M6M6 M7M7

Two-Level Circuit Optimization  The complexity of the digital logic gates that implement a Boolean function is directly related to the algebraic expression from which the function is implemented!!  Boolean expressions may be simplified by algebraic manipulation (i.e. identities) but it is awkward and not straight forward! 67

Karnaugh Maps  Graphical depiction of truth table  A box for each minterm So 2 variables, 4 boxes 3 variable, 8 boxes And so on  Useful for simplification By inspection Algebraic manipulation harder 68

Examples 69  There are implied 0s in other boxes  Figure (b) F = m 1 + m 2 + m 3

Simplification 70

Three-Variable Map  Eight minterms  Look at encoding of columns and rows 71

Simplification  Adjacent squares (horizontally or vertically) are minterms that vary by single variable  Draw rectangles on map to simplify function  Illustration next 72

How to obtain a simplified expression?  Combine as many 1’s as possible from the map to form rectangle verticallyhorizontallynot diagonally.  Only adjacent 1’s can be combined vertically or horizontally but not diagonally.  The number of 1’s that can be combined is a power of 2, (2 0 =1, 2 1 =2, 2 2 =4, 2 3 =8), … 73

Example XYZF

Example 75 X YZ

Adjacency is Cylindrical  Note that wraps from left edge to right edge. 76

Another Minimization Example  Each of the two adjacent pairs of entries can be simplified by eliminating the changing bit. x is eliminated in column 2 y is eliminated in the other pair. F = y’z + x’z’ 77

Covering 4 Squares is 78

Another Example  In general, as more squares are combined, we obtain a product term with fewer literals.  Overlap is allowed. 79

4-variable map  At limit of K-map 80

Also Wraps (toroidal topology) 81

Simplifying a 4-Variable Function WX YZ Y W Z X Z 82

Don’t Care  So far we have dealt with functions that were always either 0 or 1  Sometimes we have some conditions where we don’t care what result is  Example: dealing with BCD Only care about first 10 83

Mark With an `X’  In a K-map, mark don’t care with an ‘X’  Simpler implementations  Can select an X either as 1 or 0  Example: 84

Example or What would we have if Xs were 0? 85

Prime Implicants  Each element in the K-Map is an implicant.  A prime implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map.  A single 1 on a map represents a prime implicant if it is not adjacent to any other 1.  Two adjacent 1’s form a prime implicant, provided they are not within a group of four adjacent squares.  Four adjacent 1’s form a prime implicant if they are not within a group of eight adjacent squares, and so on.  If a minterm in a square is covered by only one prime implicant, that prime implicant is said to be essential.  They are found with only one prime  They are found by looking at each square marked with a 1 and checking the number of prime implicants that cover it. Those with only one prime implicant are essential. 86

Implicant/Prime Implicant/Essential Implicant/Prime Implicant/Essential Consider: Each Element of f on is an Implicant Prime Implicants are: abc is a Prime Implicant but NOT an Essential Prime Implicant bcd is an Implicant but NOT a Prime Implicant bd is an Essential Prime Implicant 87

Finding Simplified Expressions  The procedure for finding simplified expressions is 1. Determine all essential 1. Determine all essential prime implicants. 2. The final expression is formed from the logical sum of: essential prime implicants, I. The essential prime implicants, with II. Other prime implicants II. Other prime implicants needed to cover the remaining minterms  There may be more than one simplified expression. 88

Prime Implicants: Example  Two essential prime implicants (caused by m 0 and m 5 ) This gives us two terms: x’z’ and xz  Finding prime implicants for the remainders results in four expressions: F = xz + x’z’ + yz + wz F = xz + x’z’ + yz + wx’ F = xz + x’z’ + x’y + wz F = xz + x’z’ + x’y + wx’ 89

Essential Prime Implicants (6,7)XX (10,11)XX (12,13)XX (18,19)XX (13,29)XX (14,30)XX (0,2,16,18)XXXX (0,2,4,6,8,10,12,14)XXXXXXXX Prime Implicants Prime Implicants

91

Consensus Theorem  The third term is redundant Can just drop  What does it mean? For third term to be true, Y & Z both 1 Then one of the first two terms must be 1! 92

Proof of Consensus Theorem 93

Three Variable Maps  Three variable maps exhibit the following characteristics: 1. One box represents minterm with 3 literals 2. Rectangle of 2 boxes -> 2 literals 3. Rectangle of 4 boxes -> 1 literal 4. Rectangle of 8 boxes -> Logic 1 (on 3-variable map) 94

Slight Variation  Overlap is OK.  No need to use full m 5 -- waste of input 95

Another Example FFour adjacent corners can be combined to form the two literal term x’z’. FFour adjacent squares can be combined to form the two literal term x’y. TThe remaining 1 is combined with a single adjacent 1 to obtain the three literal term w’y’z’. FF = x’z’ + x’y + w’y’z’ 96