Multilevel Logic Synthesis Algebraic Methods

Similar documents
Binary Decision Diagrams

Multi-Level Logic Optimization. Technology Independent. Thanks to R. Rudell, S. Malik, R. Rutenbar. University of California, Berkeley, CA

Computer Organization I. Lecture 13: Design of Combinational Logic Circuits

ECE 697B (667) Spring 2003

Logic Synthesis. Basic Definitions. k-cubes

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

UNIT 5 KARNAUGH MAPS Spring 2011

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Karnaugh Maps Objectives

Chapter 2 Combinational Logic Circuits

Lecture 7: Karnaugh Map, Don t Cares

CHAPTER 5 KARNAUGH MAPS

COM111 Introduction to Computer Engineering (Fall ) NOTES 6 -- page 1 of 12

UNIT 3 BOOLEAN ALGEBRA (CONT D)

Unit 2 Boolean Algebra

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

CHAPTER 3 BOOLEAN ALGEBRA

EEE130 Digital Electronics I Lecture #4

Chap 2. Combinational Logic Circuits

Gate-Level Minimization

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

This form sometimes used in logic circuit, example:

Advanced Digital Design with the Verilog HDL, Second Edition Michael D. Ciletti Prentice Hall, Pearson Education, 2011

ENG2410 Digital Design Combinational Logic Circuits

Number System conversions

211: Computer Architecture Summer 2016

The One-Quarter Fraction

CSE 140: Components and Design Techniques for Digital Systems

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

CHAPTER 7. Exercises 17/ / /2 2 0

ELC224C. Karnaugh Maps

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

CHAPTER III BOOLEAN ALGEBRA

Chapter 2 Combinational Logic Circuits

L4: Karnaugh diagrams, two-, and multi-level minimization. Elena Dubrova KTH / ICT / ES

Optimizations and Tradeoffs. Combinational Logic Optimization

Fundamental Algorithms for System Modeling, Analysis, and Optimization

CHAPTER III BOOLEAN ALGEBRA

INTRO TO I & CT. (Boolean Algebra and Logic Simplification.) Lecture # By: Department of CS & IT.

ECE 238L Boolean Algebra - Part I

Digital Logic Design. Combinational Logic

Lecture 4: Four Input K-Maps

CHAPTER 7. Solutions for Exercises

14:332:231 DIGITAL LOGIC DESIGN

2 Application of Boolean Algebra Theorems (15 Points - graded for completion only)

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Karnaugh Map & Boolean Expression Simplification

Logic Minimization. Two-Level. University of California. Prof. Srinivas Devadas. Prof. Richard Newton Prof. Sanjit Seshia. Prof.

CHAPTER 2 BOOLEAN ALGEBRA

Construction of Mixed-Level Orthogonal Arrays for Testing in Digital Marketing

Chapter 2 Combinational Logic Circuits

Chapter 3. Boolean Algebra. (continued)

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

DIGITAL ELECTRONICS & it0203 Semester 3

T02 Tutorial Slides for Week 6

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

CHAPTER 7 MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES

Logic Gate Level. Part 2

MATH602: APPLIED STATISTICS

Unit 2 Boolean Algebra

Chapter 2 Boolean Algebra and Logic Gates

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

MC9211 Computer Organization

Fractional Replications

Unit 3 Session - 9 Data-Processing Circuits

Chapter 2: Switching Algebra and Logic Circuits

Chapter 2 Combinational Logic Circuits

Chapter 2. Digital Logic Basics

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Boolean Algebra & Logic Gates. By : Ali Mustafa

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

Boolean Algebra and Logic Design (Class 2.2 1/24/2013) CSE 2441 Introduction to Digital Logic Spring 2013 Instructor Bill Carroll, Professor of CSE

Chapter 4 Optimized Implementation of Logic Functions

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Chapter 2 Combinational Logic Circuits

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Fundamentals of Boolean Algebra

Slides for Lecture 16

Logic Synthesis of EXOR Projected Sum of Products

Unit 2 Session - 6 Combinational Logic Circuits

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Chapter 4 BOOLEAN ALGEBRA AND THEOREMS, MINI TERMS AND MAX TERMS

CPE100: Digital Logic Design I

Solutions to Assignment No 5 Digital Techniques Fall 2007

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Karnaugh Maps (K-Maps)

PLA Minimization for Low Power VLSI Designs

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

Lecture 4: More Boolean Algebra

Midterm1 Review. Jan 24 Armita

Cover Sheet for Lab Experiment #3

Logic Design I (17.341) Fall Lecture Outline

Standard Expression Forms

ENGG 1203 Tutorial - 2 Recall Lab 2 - e.g. 4 input XOR. Parity checking (for interest) Recall : Simplification methods. Recall : Time Delay

Boolean Algebra and logic gates

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

Logical Design of Digital Systems

Transcription:

Multilevel Logic Synthesis Algebraic Methods Logic Circuits Design Seminars WS2010/2011, Lecture 6 Ing. Petr Fišer, Ph.D. Department of Digital Design Faculty of Information Technology Czech Technical University in Prague Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti

Outline Basic definitions logic synthesis Operation upon multi-level network Algebraic methods - kerneling PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 2

Multilevel Logic Synthesis General aim: Given a logic function described by: Equations Truth table Network (?) Given constraints: Limited gate fan-in Limited gate fan-out Gate library Area constraints Timing constraints Testability constraints Constraints Synthesize logic network implementing the function and meeting the constraints Logic function Logic synthesis Network PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 3

Preliminaries Multilevel implementation network Network primary inputs (PIs), primary outputs (POs) Network nodes, signals Single-output nodes assumed Nodes = functions of: Immediate node fan-ins PIs PIs and intermediate signals PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 4

Multilevel Logic Synthesis Multilevel vs. two-level synthesis (optimization) Higher potential of reusing logic Group implicants in 2-level Shared subfunctions are extracted in multilevel More degrees of freedom Much more difficult Even more degrees of freedom structural don t cares Even more difficult PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 5

Multilevel Logic Synthesis Main categories: Rule-based systems (LSS) Algorithmic methods Algebraic methods Boolean methods PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 6

LSS Developed in IBM in late 1970 s Rule-based local transformations Starting from an initial network, refine it to minimize the number of gates Uses ad-hoc rules the network is looked for certain patterns, which are replaced by other, functionally equivalent ones local, text-book simplifications limited gate types (library) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 7

Algorithmic Methods Started in 1980 s MIS, SIS, MVSIS, ABC Two synthesis steps: 1. Technology-independent optimization Algebraic methods Boolean methods 2. Technology mapping Can be interleaved PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 8

Technology-Independent Optimization Main goal: Given function description, make it smaller and faster??? what is smaller & faster description? Favorite descriptions and their measures SOP Area # of terms # of literals Factored form # of literals Delay Constant (?) # of levels AIG # of nodes AIG depth PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 9

Factored Form (FF) Recursive definition: A literal is a factored form A product of factored forms is a factored form A sum of factored forms is a factored form Simply: parenthesized AND-OR-AND-OR- expression E.g. (ad+b c)(c+d (e+ac ))+(d+e)fg 13 literals, 6 levels E.g. (ad+b c) this is not a factored form! Properties Any logic function can be described by FF Describes the structure of the network Good area and delay estimation Implicitly represents a function and its complement: F = (ad+b c)(c+d (e+ac ))+(d+e)fg F = ((a +d ).(b+c )+(c.(d+e.(a +c))).(d e +f +g ) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 10

Factored Form (FF) Properties Isomorphic to a tree Isomorphic to a network consisting of AND and OR gates (& inverters at the inputs) straightforward HW implementation PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 11

Factoring Algorithmic Optimization Basic Operations = find factors, i.e., create one FF from one SOP (FF) Example F = abc + abd + a c d + b c d (12 literals) F = ab(c+d) + c d (a +b ) (8 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 12

Decomposition Algorithmic Optimization Basic Operations = express a one function by a set of functions Example F = abc + abd + a c d + b c d (12 literals) Differences from factorization: 1. The result needs not be FF (demorgan allowed) 2. Multiple use of subexpressions allowed F = XY + (XY) X = ab Y = c + d (8 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 13

Extraction Algorithmic Optimization Basic Operations = express a set of functions by a set of functions Example F = acd + bcd + e G = ae + be H = cde (14 literals) Difference from decomposition: F = XY + e G = Xe H = Ye X = a + b Y = cd (11 literals) extracting common subexpressions of more functions PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 14

Algorithmic Optimization Basic Operations Substitution (or resubstitution ) = express a function using another function Example F = ac + ad + bc d G = c + d (9 literals) F = Ga + G b G = c + d (6 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 15

Algorithmic Optimization Basic Operations Collapsing (or elimination, flattening ) = express a function without using another function Inverse to substitution usually = express a function using PIs only usually = express a network as a SOP two-level Example F = Ga + G b G = c + d (6 literals) F = ac + ad + bc d G = c + d (9 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 16

Boolean Division Definition division of f by p Given functions f, p, find functions q, r, so that f = pq + r p Boolean divisor q quotient r remainder If r is null, p is called a Boolean factor f = pq f p p = f / q p exists, if pf q and r are not unique! see the examples PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 17

Algebraic vs. Boolean Boolean methods Boolean rules allowed like: a(b + c) = ab + ac a + ab = a a + a = 1 (a + b) = a.b this is Boolean decomposition: F = abc + abd + a c d + b c d (12 literals) F = XY + (XY) X = ab Y = c + d (8 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 18

Algebraic vs. Boolean Algebraic methods Boolean rules not allowed, only algebraic like: a(b + c) = ab + ac a + ab = a not allowed a + a not allowed (a + b) not allowed this is algebraic decomposition: F = abc + abd + a c d + b c d (12 literals) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 19 F = XY + WZ X = ab, Y = c + d W = a + b, Z = c d (12 literals)

Algebraic Expressions Some definitions Cube could be understood as a set of literals F is an algebraic expression if F is a set of cubes (SOP), so that no single cube contains another E.g., F = ab + ac is an algebraic expression E.g., F = a + a b is an algebraic expression E.g., F = a + ab is not an algebraic expression PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 20

Algebraic Expressions Definitions Product of two cubes c and d: 0 if x : x c d x c d cd c d otherwise Boolean product of two expressions f and g: fg = {cd c f, d g, cd 0} Example: (a + b)(c + d + a ) = ac + ad + bc + bd + a b Algebraic product of two expressions f and g: f and g have disjoint supports of variables Example: (a + b)(c + d) = ac + ad + bc + bd if a product is not algebraic, it is Boolean PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 21

Algebraic Division Definitions Boolean division: Operation that performs f = pq + r No restriction imposed on p, q, r Algebraic division: Operation that performs f = pq + r pq must be an algebraic product recall: disjoint variable support Boolean / algebraic factor r = PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 22

Algebraic Division Examples f = ab + bc + a b f = pq + r These are not algebraic c a b 1 1 1 1 1 divisor (p) quotient (q) remainder (r) c a a b + ab c b a b + ab b a + c ab ac b ac + a b a + b a + b + c factor a b N/A ab + bc + a b PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 23

Weak Division Given functions f, p 1. find functions q, r, so that f = pq + r 2. pq is an algebraic product 3. r has minimum of cubes 4. pq + r and f are the same expressions (the same set of cubes) Properties: simple Boolean factoring The operation is unique (unique q and r) Could be O(n), n is the number of cubes (assuming the cubes are properly ordered) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 24

Weak Division Examples f = ab + bc + a b = = b(c + a ) + ab c a b 1 1 1 1 1 divisor (p) quotient (q) remainder (r) c a a b + ab c b a b + ab The only weak division b a + c ab ac b ac + a b a + b a + b + c factor a b N/A ab + bc + a b PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 25

Kerneling Kerneling: looking for common subexpressions (algebraic) Some definitions & notations Cube-free expression: has no (algebraic?) factor E.g.: ab + c is cube-free ab + ac is not cube-free (a is a divisor) abc is not cube-free (a, b, c are divisors) Primary divisor of an expression f: d(f) = f / c; c is a single cube Kernel of an expression f: a cube-free primary divisor Co-kernel of a kernel d(f): the cube c used to obtain the kernel Set of primary divisors of f: D(f) = { f / c; c is a single cube } Set of kernels of f: K(f) = { g g D(f) and g is cube-free } Set of co-kernels of f: C(f) = { c g K(f); g = f / c } PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 26

Kerneling Example y = adf + aef + bdf + bef + cdf + cef + g = (a + b + c)(d + e)f + g Notice: a + b + c d + e Kernel (a + b + c)(d + e) f (a + b + c)(d + e)f + g 1 df, ef af, bf, cf one kernel may have more co-kernels kernel of a given co-kernel is unique Co-kernel PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 27

Kerneling What is it good for? Algebraic substitution Algebraic factoring & decomposition Algebraic extraction Simple algorithms Not as powerful as Boolean ones, but sufficient enough In logic synthesis, we are looking for the best decomposition (extraction), in general looking for the best divisors = shared by most cubes in one expression = shared by most functions = reducing the number of FF literals most PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 28

Kerneling How to find the best decomposition (extraction)? plenty of divisors. Which one to choose? The problem formalized: Given a set of functions Find a minimum number of divisors common to maximum of functions (subexpressions) Rectangle cover problem (NPH) PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 29

Rectangle Cover NP-Hard Heuristic must be used Simple greedy heuristic: 1. Select rectangle with highest value 2. Substitute it into the expressions 3. Create new matrix, goto 1. (like in the example) Find some rectangle cover and iteratively refine it Like in Espresso: Reduce, Expand, Irredundant PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 30

References Algebraic Methods J. A. Darringer et al. "Logic synthesis through local transformations", IBM Journal of Research and Development, vol. 25, no. 4, pp. 272-280, July, 1981. G. D. Hachtel, F. Somenzi: Logic Synthesis and Verification Algorithms, Kluwer Academic Pub, 1996, 564 p. S. Hassoun, T. Sasao, Logic Synthesis and Verification, Boston, MA, Kluwer Academic Publishers, 2002, 454 p. PI-SCN-6, ČVUT FIT, Petr Fišer, 2010 31