Alan Mishchenko UC Berkeley (With many thanks to Donald Knuth for

Slides:



Advertisements
Similar presentations
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
Advertisements

ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Boolean Functions and their Representations
Computer Arithmetic, Multiplexers Prof. Sin-Min Lee Department of Computer Science.
DAG-Aware AIG Rewriting Alan Mishchenko, Satrajit Chatterjee, Robert Brayton Department of EECS, University of California Berkeley Presented by Rozana.
Canonical Forms and Logic Miniminization
Propositional Calculus Math Foundations of Computer Science.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Department of Computer Engineering
CS 151: Introduction to Digital Design Chapter 2-9 Exclusive-OR Gates.
Digital Logic Computer Organization 1 © McQuain Logic Design Goal:to become literate in most common concepts and terminology of digital.
Logic Circuits Chapter 2. Overview  Many important functions computed with straight-line programs No loops nor branches Conveniently described with circuits.
Logic Functions: XOR, XNOR
Enumeration of Irredundant Circuit Structures Alan Mishchenko Department of EECS UC Berkeley UC Berkeley.
Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B, and then determines their relative magnitudes.
1 Implicant Expansion Methods Used in The BOOM Minimizer Petr Fišer, Jan Hlavička Czech Technical University, Karlovo nám. 13, Prague 2
Revision Mid 1 Prof. Sin-Min Lee Department of Computer Science.
A Semi-Canonical Form for Sequential Circuits Alan Mishchenko Niklas Een Robert Brayton UC Berkeley Michael Case Pankaj Chauhan Nikhil Sharma Calypto Design.
CHAPTER 2 Boolean algebra and Logic gates
Sequential Equivalence Checking for Clock-Gated Circuits Hamid Savoj Robert Brayton Niklas Een Alan Mishchenko Department of EECS University of California,
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques
Reducing Structural Bias in Technology Mapping
Boolean Algebra & Logic Gates
Overview Part 2 – Combinational Logic Functions and functional blocks
Prof. Sin-Min Lee Department of Computer Science
Mapping into LUT Structures
Delay Optimization using SOP Balancing
Faster Logic Manipulation for Large Designs
Unit 18: Computational Thinking
Robert Brayton Alan Mishchenko Niklas Een
Alan Mishchenko Satrajit Chatterjee Robert Brayton UC Berkeley
Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B, and then determines their relative magnitudes.
A Semi-Canonical Form for Sequential AIGs
Alan Mishchenko University of California, Berkeley
Applying Logic Synthesis for Speeding Up SAT
Karnaugh Maps (K-Maps)
Chain Reduction for Binary and Zero-Suppressed Decision Diagrams
Versatile SAT-based Remapping for Standard Cells
SAT-based Methods: Logic Synthesis and Technology Mapping
Propositional Calculus: Boolean Algebra and Simplification
Optimized Implementation of Logic Function
Standard-Cell Mapping Revisited
Faster Logic Manipulation for Large Designs
Digital Logic & Design Dr. Waseem Ikram Lecture 13.
SAT-Based Area Recovery in Technology Mapping
Polynomial Construction for Arithmetic Circuits
Combinatorial Logic Circuit
Canonical Computation without Canonical Data Structure
SAT-Based Optimization with Don’t-Cares Revisited
Canonical Computation Without Canonical Data Structure
Robert Brayton UC Berkeley
Resolution Proofs for Combinational Equivalence
ECB2212-Digital Electronics K-Map
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
Alan Mishchenko UC Berkeley (With many thanks to Donald Knuth,
Overview Part 3 – Additional Gates and Circuits 2-8 Other Gate Types
From now on: Combinatorial Circuits:
Overview Part 2 – Circuit Optimization
Lab Instructors will overview the MSP430
Chapter 3 Special Section
Canonical Computation without Canonical Data Structure
Delay Optimization using SOP Balancing
Robert Brayton Alan Mishchenko Department of EECS UC Berkeley
Canonical Computation without Canonical Data Structure
A Practical Approach to Arithmetic Circuit Verification
Principles & Applications
SAT-based Methods: Logic Synthesis and Technology Mapping
Alan Mishchenko Department of EECS UC Berkeley
Presentation transcript:

Using Enumeration to Generate All Minimum Circuits for Boolean Functions of 4 and 5 Variables Alan Mishchenko UC Berkeley (With many thanks to Donald Knuth for TAOCP, Volume 4, Section 7.1.2 “Boolean evaluation”)

Overview Small Boolean functions (n-functions where n < 6) Minimum circuits (min-circuits) Circuit enumeration algorithms Exhaustive enumeration of min-circuits Experimental results Conclusions and future work Applications? 2

Two Different 12-Node Min-Circuits for The Most Complex 5-Function: 169ae443

Terminology Boolean value: 0 or 1 Boolean variable: x  {0,1} abcd F 0000 0001 0010 0011 1 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Boolean value: 0 or 1 Boolean variable: x  {0,1} A set of n Boolean variables, e.g. n=4, {a,b,c,d} Minterm: a complete assignment of a set of n Boolean variables, e.g. {a,b,c,d} = 0011 The total number of minterms = 2n Boolean function: a complete assignments of all 2n minterms in terms of the set of variables The total number of functions = 22^n Truth table: a simple representation of Boolean function, e.g. 0001 0001 0001 1111 = 0x111F

NPN Classes Two functions belong to the same NPN class if one of them can be derived from the other by complementing inputs (N), permuting inputs (P), and complementing the output (N)

Min-Circuit Types Using terminology introduced by Knuth in TAOCP C(f): the node count in the minimum-node DAG L(f): the same as above but leaf-DAG (fanout only at inputs) U(f): the same as L(f) but with logic sharing (fanout) only at inputs and the first logic level D(f): the level count in the minimum-level circuit DN(f): the node count in the minimum-level circuit Cm(f): the node count in the minimum-node width-n DAG (“minimum memory”) Cm’(f): the same as Cm(f) but with additional generation rule Cm1(f): the same as Cm(f) but width-(n+1) DAG

Min-Circuit Enumeration Methods Bottom-up Start with inputs, add gates – leads to L(f) Top-down Start with the output, add gates – leads to Cm(f) Hybrid Hard to define in an intuitive way – leads to C(f)

Bottom-Up Enumeration: L(f) This is the reformulated Algorithm L from TAOCP by Knuth, modified to work with NPN classes rather than individual functions Maintain a hash table of reached NPN classes Initialize it with the constant 0 function and the buffer function Consider pairs of classes whose min-circuits have sizes n1 and n2 Add on top one two-input gate (AND/XOR) in five polarities: The polarities are: f1 & f2, f1 & ~f2, ~f1 & f2, ~f1 & ~f2, f1  f2 (One of the classes should be exhaustively permuted/complemented) Check each of the resulting functions among the reached classes If it is there, skip it If not, add the new class and set its min-circuit to have size n1+n2+1 Stop when all NPN classes have been reached Runtime Takes 0.01 sec for all 4-input functions Takes 200 sec for all 5-input functions Currently infeasible for all 6-input functions

Other Enumeration Types The most general one, C(f), leads to the best quality but is the hardest to implement The top-down one, Cm1(f), is easy to implement but runs into problems with NPN classification (because it requires n+1 variable NPN classes) L(f) is a good trade-off between quality, runtime, and the ease of implementation Below, in discussion and results, we focus on L(f)

Min-Circuit Classes of 4-Functions

Min-Circuit Classes for 4-Functions (only AND, no XOR) It is interesting that L(f) here has more classes with an odd number of nodes than with an even number of nodes!

Computing L(f) for 5-Functions This table is generated using command “funenum –I 5 –l” in ABC.

Computing D(f) for 5-Functions This table is generated using command “funenum –I 5 –d” in ABC.

Computing Cm(f) for 5-Functions This table is generated using command “funenum –I 5 –S 5” in ABC.

Min-Circuit Types for 5-Functions

Counting Min-Circuits The focus of this presentation is on counting the number of different min-circuits for each NPN class (finished) generating all different min-circuits (not finished) What two min-circuits are considered different? A min-circuit is characterized by the unordered pairs of NPN classes of fanins of the topmost node Two circuits are different, if at least one fanin of the topmost node of the first circuit has NPN class that is not present among the fanins of the second circuit

Distribution of Min-Circuit Counts for 4-Functions A column label is a range of counts of min-circuits. For example, [5;8] means that there are 5, 6, 7 or 8 different min-circuits.

Distribution of Min-Circuit Counts for 5-Functions It is interesting to note that among all 11-node NPN classes, there are 5450 classes with a unique min-circuit and one class with exactly 523 different min-circiuts. The next closest to it, is one class with exactly 314 different min-circuits.

Future Work Generate all min-circuits for 4- and 5-functions Finish computation of Cm1(f) for 5-functions This computation is based on Frontier-Based Search (Knuth) and call for improving exact NPN classification for 6-functions Extend all results to (a subset of simple) 6-functions Requires improving exact NPN classification for 6-functions Find good practical applications

Conclusion Introduced the problem of min-circuit enumeration Presented statistics for several types of min-circuits for 4- and 5-functions independently verified the information from TAOCP by Knuth Showed the distribution of min-counts of different L(f) min-circuits for 4- and 5-functions new result Plan to produce the actual implementation of all min-circuits for 4- and 5-functions, and a practical subset of those for 6-functions

Four 4-Functions That Require 10 AND Nodes (XORs not used) This slide is borrowed from presentation “Practical SAT” by Niklas Een