CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 4: Logic Optimization Chapter 4.

Slides:



Advertisements
Similar presentations
Chapter 3 Gate-Level Minimization
Advertisements

Digital Logic Design Gate-Level Minimization
Figure 4.1. The function f (x1, x2, x3) =  m(0, 2, 4, 5, 6).
Gate-Level Minimization
ECE C03 Lecture 31 Lecture 3 Two-Level Logic Minimization Algorithms Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Chapter 3 Simplification of Switching Functions. Karnaugh Maps (K-Map) A K-Map is a graphical representation of a logic function’s truth table.
4.2 Strategy for minimization So far, we used an intuitive approach to decide how the 1s in the K-map should be grouped together to obtain the minimum-cost.
Gate-level Minimization
Boolean Algebra and Combinational Logic
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE 331 – Digital System Design
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
Chapter 3 Simplification of Switching Functions
Circuit Optimization Goal: To obtain the simplest implementation for a given function Optimization is a more formal approach to simplification that is.
Gate Logic: Two Level Canonical Forms
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.
Gate-Level Minimization1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
ECE 331 – Digital System Design Multi-level Logic Circuits and NAND-NAND and NOR-NOR Circuits (Lecture #8) The slides included herein were taken from the.
Canonical Forms and Logic Miniminization
Introduction Gate-level minimization refers to the design task of finding an optimal gate-level implementation of Boolean functions describing a digital.
ENEE244-02xx Digital Logic Design Lecture 7. Announcements Homework 3 due on Thursday. Review session will be held by Shang during class on Thursday.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
2.7 NAND and NOR logic networks
Boolean Algebra and Logic Simplification
Chapter 2: Boolean Algebra and Logic Functions
Lecture 3: Incompletely Specified Functions and K Maps CSE 140: Components and Design Techniques for Digital Systems Fall 2014 CK Cheng Dept. of Computer.
KU College of Engineering Elec 204: Digital Systems Design
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
1 Chapter 5 Karnaugh Maps Mei Yang ECG Logic Design 1.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
Department of Computer Engineering
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
ECE 331 – Digital System Design NAND and NOR Circuits, Multi-level Logic Circuits, and Multiple-output Logic Circuits (Lecture #9) The slides included.
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 2: Intro. to Logic Circuits Chapter 2.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
Two-Level Simplification Approaches Algebraic Simplification: - algorithm/systematic procedure is not always possible - No method for knowing when the.
ECE 2110: Introduction to Digital Systems PoS minimization Don’t care conditions.
Elements of discrete devices synthesis (module T170M012) 2012 Kaunas university of technology Electronic and measurement systems dep. Doc. dr. Žilvinas.
UM EECS 270 Spring 2011 – Taken from Dr.Karem Sakallah Logic Synthesis: From Specs to Circuits Implementation Styles –Random –Regular Optimization Criteria.
Combinational Logic Part 2: Karnaugh maps (quick).
Unit 5 Karnaugh Maps Fundamentals of Logic Design by Roth and Kinney.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
2-1 Introduction Gate Logic: Two-Level Simplification Design Example: Two Bit Comparator Block Diagram and Truth Table A 4-Variable K-map for each of the.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 2 – Combinational Logic Circuits Part 2.
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.
ETE 204 – Digital Electronics
Venn Diagram – the visual aid in verifying theorems and properties 1 E.
Logic Functions: XOR, XNOR
ECE 3110: Introduction to Digital Systems Chapter #4 Review.
Karnaugh Maps (K-Map) A K-Map is a graphical representation of a logic function’s truth table.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
ECE/CS 352 Digital System Fundamentals1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 2 – Part 5 Tom Kaminski & Charles R. Kime.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
ENGG 340 Midterm Review. Introduced the Concept of Variables and Functions Introduced the Concept of AND, OR, and NOT Introduced the Concept of Truth.
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
1 CS 352 Introduction to Logic Design Lecture 4 Ahmed Ezzat Multi-level Gate Circuits and Combinational Circuit Design Ch-7 + Ch-8.
Lecture 07 Digital logic By Amr Al-Awamry. 4 variables K-Map.
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi.
MULTI-LEVEL GATE CIRCUITS / NAND AND NOR GATES
Gate-Level Minimization
ECE 2110: Introduction to Digital Systems
ECE 3110: Introduction to Digital Systems
Boolean Algebra and Combinational Logic
CSE 370 – Winter Combinational Implementation - 1
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Instructor: Alexander Stoytchev
Overview Part 2 – Circuit Optimization
Presentation transcript:

CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 4: Logic Optimization Chapter 4

Motivation Algebraic manipulation is not systematic. This chapter presents methods that can be automated in CAD tools. Although tools used for logic optimization, designers must understand the process.

Figure 4.1 The function f =  m(0, 2, 4, 5, 6)

x 2 (a) Truth table(b) Karnaugh map m 0 m 2 m 3 m 1 x 1 x m 0 m 1 m 3 m 2 x 1 Figure 4.2 Location of two-variable minterms

Figure 2.15 A function to be synthesized

Figure 4.4 Location of three-variable minterms x 1 x 2 x (b) Karnaugh map x 2 x m 0 m 1 m 3 m m 4 m 5 m 7 m 6 x 1 (a) Truth table m 0 m 1 m 3 m 2 m 6 m 7 m 4 m 5

Figure 4.6 A four-variable Karnaugh map x 1 x 2 x 3 x x 2 x 4 x 1 x 3 m 0 m 1 m 5 m 4 m 12 m 13 m 8 m 9 m 3 m 2 m 6 m 7 m 15 m 14 m 11 m 10

x 1 x 2 x 3 x

x 1 x 2 x 3 x

x 1 x 2 x 3 x

x 1 x 2 x 3 x

Figure 4.8 A five-variable Karnaugh map x 1 x 2 x 3 x x 5 1= x 1 x 2 x 3 x x 5 0=

Terminology A variable either uncomplemented our complemented is called a literal. A product term that indicates when a function is equal to 1 is called an implicant. An implicant that cannot have any literal deleted and still be a valid implicant is called a prime implicant.

Figure 4.9 Three-variable function f =  m(0, 1, 2, 3, 7) x 1 x 2 x

Terminology (cont) A collection of implicants that accounts for all input combinations in which a function evaluates to 1 is called a cover. An essential prime implicant includes a minterm covered by no other prime. Cost is number of gates plus number of gate inputs. Assume primary inputs available in both true and complemented form.

Minimization Procedure Generate all prime implicants. Find all essential prime implicants. If essential primes do not form a cover, then select minimal set of non-essential primes.

Figure 4.10 Four-variable function f =  m(2, 3, 5, 6, 7, 10, 11, 13, 14) x 1 x 2 x 3 x

Figure 4.11 The function f =  m(0, 4, 8, 10, 11, 12, 13, 15) x 1 x 2 x 3 x

Figure 4.12 The function f =  m(0, 2, 4, 5, 10, 11, 13, 15) x 1 x 2 x 3 x

Minimization of POS Forms Find a cover of the 0’s and form maxterms. x 1 x 2 x

Figure 4.14 POS minimization of f =  M(0, 1, 4, 8, 9, 12, 15) x 1 x 2 x 3 x

Incompletely Specified Functions Often certain input conditions cannot occur. Impossible inputs are called don’t cares. A function with don’t cares is called an incompletely specified function. Don’t cares can be used to improve the quality of the logic designed.

Figure 4.15 Two implementations of f =  m(2, 4, 5, 6, 10) + D(12, 13, 14, 15) x 1 x 2 x 3 x d0 01d0 00d0 11d

Figure 4.15 Two implementations of f =  m(2, 4, 5, 6, 10) + D(12, 13, 14, 15) x 1 x 2 x 3 x d0 01d0 00d0 11d

Multiple-Output Circuits Necessary to implement multiple functions. Circuits can be combined to obtain lower cost solution by sharing some gates.

Figure 4.16 An example of multiple-output synthesis x 1 x 2 x 3 x (a) Function 1 f 1 x 1 x 2 x 3 x (b) Functionf 2

f 1 f 2 x 2 x 3 x 4 x 1 x 3 x 1 x 3 x 2 x 3 x 4 (c) Combined circuit forf 1 f 2 and

Figure 4.17 An example of multiple-output synthesis x 1 x 2 x 3 x (a) Optimal realization of(b) Optimal realization of 1 f 3 f x 1 x 2 x 3 x

(c) Optimal realization of f 3 x 1 x 2 x 3 x x 1 x 2 x 3 x andtogetherf 4

Figure 4.17 An example of multiple-output synthesis f 3 f 4 x 1 x 4 x 3 x 4 x 1 x 1 x 2 x 2 x 4 x 4 (d) Combined circuit for f 3 f 4 and x 2

x 1 x 2 x 3 x (a) Function 0 f 1 x 1 x 2 x 3 x (b) Functionf

x 1 x 2 x 3 x (a) Optimal realization of(b) Optimal realization of f 3 f 4 x 1 x 2 x 3 x

Figure 4.18 DeMorgan’s theorem in terms of logic gates x 1 x 2 x 1 x 2 x 1 x 2 x 1 x 2 x 1 x 2 x 1 x 2 x 1 x 2 x 1 x 2 += (a) x 1 x 2 + x 1 x 2 = (b)

Figure 4.19 Using NAND gates to implement a sum-of-products x 1 x 2 x 3 x 4 x 5 x 1 x 2 x 3 x 4 x 5 x 1 x 2 x 3 x 4 x 5

Figure 4.20 Using NOR gates to implement a product-of-sums x 1 x 2 x 3 x 4 x 5 x 1 x 2 x 3 x 4 x 5 x 1 x 2 x 3 x 4 x 5

Multilevel Synthesis SOP or POS circuits have 2-levels of gates. Only efficient for functions with few inputs. Many inputs can lead to fan-in problems. Multilevel circuits can also be more area efficient.

Figure 4.21 Implementation in a CPLD

Figure 4.22 Implementation in an FPGA

Figure 4.23 Using 4-input AND gates to realize a 7-input product term 7 inputs

Figure 4.24 A factored circuit x 6 x 4 x 1 x 5 x 2 x 3 x 2 x 3 x 5

Example 4.5

Figure 4.25 A multilevel circuit x 1 x 2 x 3 x 4 f 1 f 2

Impact on Wiring Complexity Space on chip is used by gates and wires. Wires can be a significant portion. Each literal corresponds to a wire. Factoring reduces literal count, so it can also reduce wiring complexity.

Functional Decomposition Multilevel circuits often require less area. Complexity is reduced by decomposing 2-level function into subcircuits. Subcircuit implements function that may be used in multiple places.

Example 4.6

Figure 4.26 A multilevel circuit x 1 x 2 x 3 x 4 f g

Figure 4.27 The structure of a decomposition 1 x 2 x 3 x 4 f g h x x 1 x 2 x 3 x 4 f g

x 1 x 2 x 3 x x 1 x 2 x 3 x x 5 0=x 5 1= f

Figure 4.28 An example of decomposition x 1 x 2 x 5 x 4 f x 3 g k

Figure 4.29 a Implementation of XOR x 2 x 1 x 1 x 2  x 2 x 1 x 1 x 2  (a) Sum-of-products implementation (b) NAND gate implementation

Example 4.8

x 2 x 1 g x 1 x 2  (c) Optimal NAND gate implementation Figure 4.29 b Implementation of XOR f = x 1  x 2 = x 1 x 2 + x 1 x 2 = x 1 (x 1 + x 2 ) + x 2 (x 1 + x 2 )

Practical Issues Functional decomposition can be used to implement general logic functions in circuits with built-in constraints. Enormous numbers of possible subfunctions leads to necessity for heuristic algorithms.

Figure 4.30 Conversion to a NAND-gate circuit x 2 x 1 x 3 x 4 x 5 x 6 x 7 x 2 x 1 x 3 x 4 x 5 x 6 x 7 f f (a) Circuit with AND and OR gates (b) Inversions needed to convert to NANDs

Figure 4.30 Conversion to a NAND-gate circuit x 2 x 1 x 3 x 4 x 5 x 6 x 7 f (b) Inversions needed to convert to NANDs x 2 x 1 x 3 x 4 x 5 x 6 x 7 f

Figure 4.31 Conversion to a NOR-gate circuit x 2 x 1 x 3 x 4 x 5 x 6 x 7 f (a) Circuit with AND and OR gates x 2 x 1 x 3 x 4 x 5 x 6 x 7 f (a) Inversions needed to convert to NORs

Figure 4.31 Conversion to a NOR-gate circuit x 2 x 1 x 3 x 4 x 5 x 6 x 7 f x 2 x 1 x 3 x 4 x 5 x 6 x 7 f

Figure 4.32 Circuit example for analysis

x 1 x 2 x 5 x 4 f x 3 P 1 P 4 P 5 P 6 P 8 P 2 P 3 P 9 P 10 P 7 Figure 4.33 Circuit example for analysis

x 1 x 2 x 4 f x 5 (c) Circuit with AND and OR gates x 3 Figure 4.34 Circuit example for analysis x 1 x 2 x 3 x 4 x 5 f P 1 P 2 P 3 (a) NAND-gate circuit x 1 x 2 x 3 x 4 x 5 f (b) Moving bubbles to convert to ANDs and ORs

Figure 4.35 Circuit example for analysis

CAD Tools espresso – finds exact and heuristic solutions to the 2-level synthesis problem. sis – performs multilevel logic synthesis. Numerous commercial CAD packages are available from Cadence, Mentor, Synopsys, and others.

Figure 4.46 A complete CAD system Design conception Design correct? Chip configuration Timing simulation No Yes Design entry, initial synthesis, and functional simulation (see section 2.8) Physical design Logic synthesis/optimization

Figure 4.42 VHDL code for the function f =  m(1, 4, 5, 6)

Figure 4.43 Logic synthesis options in MAX+PLUS II

Physical Design Physical design determines how logic is to be implemented in the target technology. –Placement determines where in target device a logic function is realized. –Routing determines how devices are to be interconnected using wires.

Figure 4.44 Results of physical design

Timing Simulation Functional simulation does not consider signal propagation delays. After physical design, more accurate timing information is available. Timing simulation can be used to check if a design meets performance requirements.

Figure 4.45 Timing simulation results (a) Timing in an FPGA (b) Timing in a CPLD

Figure 4.46 A complete CAD system Design conception Design correct? Chip configuration Timing simulation No Yes Design entry, initial synthesis, and functional simulation (see section 2.8) Physical design Logic synthesis/optimization

STD_LOGIC type Defined in ieee.std_logic_1164 package. Enumerated type with 9 values. ‘1’ – strong one‘0’ – strong zero ‘X’ – strong unknown‘Z’ – high impedence ‘H’ – weak one‘L’ – weak zero ‘W’ – weak unknown‘U’ – uninitialized ‘-’ – don’t care We will almost always use STD_LOGIC.

Figure 4.47 VHDL code using STD_LOGIC

Figure 4.48 VHDL code for the function f =  m(0, 2, 4, 5, 6)

Figure 4.49 Implementation of the VHDL code for the function f =  m(0, 2, 4, 5, 6) DQ PAL-like block (from interconnection wires) x 1 x 2 x 3 unused 0 0 1

DQ PAL-like block (from interconnection wires) x 1 x 2 x 3 unused 0 1 Figure 4.50 Implementation using XOR synthesis (f = x 3  x 1 x 2 x 3 )

Figure 4.51 VHDL code for f =  m(0, 2, 4, 5, 6) implemented in a LUT

Figure 4.52 The VHDL code for f =  m(2, 3, 9, 10, 11, 13)

Figure 4.53 VHDL code for a 7-variable function

Figure 4.54 Two implementations of a 7-variable function x 6 x 4 f x 5 0 x 7 x 2 x 3 x 2 x 7 x 4 x 5 0 x 6 x 1 x 3 x 1 x 4 x 5 x 6 x 1 x 3 x 6 x 2 x 3 x 7 x 2 x 4 x 5 x 7 (a) Sum-of-products realization x 1 x 7 x 2 x 6 x 1 x 6 x 2 x 7 + x 5 x 3 x 4 f (b) Factored realization x 1

Logic Function Representation Truth tables Algebraic expressions Venn diagrams Karnaugh maps n-dimensional cubes

Figure 4.36 Representation of f =  m(1, 2, 3) x f x 2 x 1 x1 1x x 2

Figure 4.37 Representation of f =  m(0, 2, 4, 5, 6)

Figure 4.38 Representation of f =  m(0, 2, 3, 6, 7, 8, 10, 15)

n-Dimensional Hypercube Function of n variables maps to n-cube. Size of a cube is number of vertices. A cube with k x’s consists of 2 k vertices. n-cube has 2 n vertices. 2 vertices are adjacent if they differ in one coordinate. Each vertex in n-cube adjacent to n others.

Figure 4.39 The coordinate *-operation o o x 1 0 x B i A i 0 1 x A i B i * C = A * B such that 1.C =  if A i * B i =  for more than one i. 2.Otherwise, C i = A i * B i when A i * B i   and C i = x for the coordinate where A i * B i = .

Using *-operation to Find Primes f is specified using a set of cubes, C k of f. Let c i and c j be any two cubes in C k. Apply *-operation to all pairs of cubes in C k : –G k+1 = c i * c j for all c i, c j in C k Form new cover for f as follows: –C k+1 = C k  G k+1 – redundant cubes –A is redundant if exists a B s.t. A i = B i or B i = x for all i. Repeat until C k+1 = C k.

Example 4.14

Example 4.15

Figure 4.40 The coordinate #-operation o x B i A i 0 1 x A i B i #     o C = A # B, such that 1.C = A if A i # B i =  for some i. 2.C =  if A i # B i =  for all i. 3.Otherwise, C =  i (A 1, A 2,..., B i,... A n ), where the union is for all i for which A i = x and B i  x.

Finding Essential Primes Let P be set of all prime implicants. Let p i denote one prime implicant in P. Let DC denote the don’t cares vertices for f. Then p i is an essential prime implicant iff: –p i # (P – p i ) # DC  

Example 4.16

Example 4.17

Procedure to Find Minimal Cover Let C 0 = ON  DC be the initial cover of f. Find all primes, P, of C 0 using *-operation. Find the essential primes using #-operation. If essentials cover ON-set then done else –Delete any nonessential prime that is more expensive than some other prime. –Use branching technique to select lowest cost primes which cover ON-set.

Figure 4.41 An example four-variable function 1 x 2 x 3 x x 1 x 2 x 3 x d1 1 d d x 5 0=x 5 1= d x

Summary Described 2-level logic synthesis methods. Discussed multilevel logic synthesis. Introduced CAD tools for logic synthesis.