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

Slides:



Advertisements
Similar presentations
Techniques for Combinational Logic Optimization
Advertisements

Overview Part 3 – Additional Gates and Circuits 2-8 Other Gate Types
ECE 667 Synthesis & Verification - Boolean Functions 1 ECE 667 Spring 2013 ECE 667 Spring 2013 Synthesis and Verification of Digital Circuits Boolean Functions.
DAG-Aware AIG Rewriting Alan Mishchenko, Satrajit Chatterjee, Robert Brayton Department of EECS, University of California Berkeley Presented by Rozana.
Dynamic Logic Synthesis. Basic Domino CMOS Gate Clock  evaluate transistor precharge transistor inverting buffer N logic.
Canonical Forms and Logic Miniminization
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Faster Logic Manipulation for Large Designs Alan Mishchenko Robert Brayton University of California, Berkeley.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
CS 151: Introduction to Digital Design Chapter 2-9 Exclusive-OR Gates.
Logic Circuits Chapter 2. Overview  Many important functions computed with straight-line programs No loops nor branches Conveniently described with circuits.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. Circuit Optimization Logic and Computer Design Fundamentals.
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
A Semi-Canonical Form for Sequential Circuits Alan Mishchenko Niklas Een Robert Brayton UC Berkeley Michael Case Pankaj Chauhan Nikhil Sharma Calypto Design.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
BDD-based Synthesis of Reversible Logic for Large Functions Robert Wille Rolf Drechsler DAC’09 Presenter: Meng-yen Li.
Sequential Equivalence Checking for Clock-Gated Circuits Hamid Savoj Robert Brayton Niklas Een Alan Mishchenko Department of EECS University of California,
A Toolbox for Counter-Example Analysis and Optimization
Reducing Structural Bias in Technology Mapping
Boolean Algebra & Logic Gates
Homework Reading Machine Projects Labs
Overview Part 2 – Combinational Logic Functions and functional blocks
COMP541 Combinational Logic - 3
Prof. Sin-Min Lee Department of Computer Science
CS Chapter 3 (3A and ) Part 1 of 8
COMP541 Combinational Logic - 3
Alan Mishchenko UC Berkeley
Mapping into LUT Structures
CS Chapter 3 (3A and ) Part 1 of 8
Delay Optimization using SOP Balancing
EEL 3705 / 3705L Digital Logic Design
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
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
Standard-Cell Mapping Revisited
Faster Logic Manipulation for Large Designs
GC 211:Data Structures Algorithm Analysis Tools
SAT-Based Area Recovery in Technology Mapping
Canonical Computation without Canonical Data Structure
SAT-Based Optimization with Don’t-Cares Revisited
Canonical Computation Without Canonical Data Structure
Dr. Clincy Professor of CS
Robert Brayton UC Berkeley
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 for
Overview Part 3 – Additional Gates and Circuits 2-8 Other Gate Types
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, TAOCP, Volume 4, Section 7.1.2 “Boolean evaluation”)

Overview Small Boolean functions (n-functions where n < 6) Minimum circuits (min-circuits) 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 Boolean n variables, e.g. n=4, {a,b,c,d} Minterm: a complete assignment of a set of Boolean variables, e.g. {a,b,c,d} = 0011 The total number of minterms = 2^n Boolean function: a complete assignments of all minterms in terms of the set of variables The total number of functions = 2^(2^n) Truth table: a compact representation of Boolean function, e.g. 0001 0001 0001 1111

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 in TAOCP by Knuth C(f): the minimum-node DAG (the most general type) L(f): the minimum-node leaf-DAG (fanout only at inputs) U(f): the minimum-node DAG with logic sharing (fanout) only at inputs and the first logic level D(f): the minimum-level circuit DN(f): the node count in the minimum-level circuit Cm(f): the minimum-node width-n DAG (“minimum memory”) Cm’(f): the same as Cm(f) with one extra generation rule Cm1(f): the minimum-node 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 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 constant 0 function and 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 4-input functions Takes 200 sec for 5-input functions Currently infeasible for 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 we focus on L(f) is discussion and results

Min-Circuit Classes of 4-Functions

Min-Circuit Classes for 4-Functions (only AND, no XOR) It is interesting to note 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

Computing D(f) for 5-Functions

Computing Cm(f) for 5-Functions

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 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

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) 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 all min-circuit types for 4- and 5-functions (most of the info available in TAOCP by Knuth) Showed distribution of min-circuits of L(f) (new result)

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