An Algorithm for Minimizing of Boolean Functions Based on Graph DS

Similar documents
An algorithm for minimizing of Boolean functions based on graph data structure.

Minimization of Boolean Functions Which Include Don't-Care Statements, Using Graph Data Structure

Using Genetic Algorithm with Non-identical Population for Minimizing Boolean Functions

Anale. Seria Informatică. Vol. X fasc Annals. Computer Science Series. 10 th Tome 1 st Fasc. 2012

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 04. Boolean Expression Simplification and Implementation

SEPP: a New Compact Three-Level Logic Form

Chapter 2 Combinational

ADAPTIVE MAP FOR SIMPLIFYING BOOLEAN EXPRESSIONS

Chapter 2 Combinational Logic Circuits

Smart Sort and its Analysis

REDUCING GRAPH COLORING TO CLIQUE SEARCH

A New Heuristic for DSOP Minimization

2008 The McGraw-Hill Companies, Inc. All rights reserved.

A Deterministic Polynomial-time Algorithm for the Clique Problem and the Equality of P and NP Complexity Classes

COMP combinational logic 1 Jan. 18, 2016

DKT 122/3 DIGITAL SYSTEM 1

Assignment (3-6) Boolean Algebra and Logic Simplification - General Questions

ESOP CIRCUIT MINIMIZATION BASED ON THE FUNCTION ON-SET. Likai Chai

On a conjecture of Keedwell and the cycle double cover conjecture

(Refer Slide Time 5:19)

Calculus Early Transcendentals 7th Edition Pdf

On the Strongly Connected and Biconnected Components of the Complement of Graphs

Simplified Digital Logic Circuits Using Binary Decision Tree

Digital Electronics

Lecture 4: Implementation AND, OR, NOT Gates and Complement

The NP-Completeness of Some Edge-Partition Problems

On Designs of Radix Converters Using Arithmetic Decompositions

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

The crossing number of K 1,4,n

Last Name Student Number. Last Name Student Number

DESIGN AND IMPLEMENTATION OF VLSI SYSTOLIC ARRAY MULTIPLIER FOR DSP APPLICATIONS

S1 Teknik Telekomunikasi Fakultas Teknik Elektro FEH2H3 2016/2017

Winning Positions in Simplicial Nim

VLSI Implementation of Adders for High Speed ALU

Review: Standard forms of expressions

Syllabi & Scheme of Examination MCA/Msc-2 nd Year. Website:-

Characterization of Super Strongly Perfect Graphs in Chordal and Strongly Chordal Graphs

Lecture 9 - Matrix Multiplication Equivalences and Spectral Graph Theory 1

Generating Topology on Graphs by. Operations on Graphs

International Journal of Scientific & Engineering Research Volume 9, Issue 8, August ISSN

Inadmissible Class of Boolean Functions under Stuck-at Faults

LSN 4 Boolean Algebra & Logic Simplification. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

On Algebraic Expressions of Generalized Fibonacci Graphs

LOGIC CIRCUITS. Kirti P_Didital Design 1

Relational Algebraic Graph Algorithms

Chapter 2. Boolean Expressions:

An Algorithm for the Construction of Decision Diagram by Eliminating, Merging and Rearranging the Input Cube Set

Slide Set 5. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

International Training Workshop on FPGA Design for Scientific Instrumentation and Computing November 2013

Self Centered and Almost self centered graphs

Gate-Level Minimization

Sarah Will Math 490 December 2, 2009

MODULE 5 - COMBINATIONAL LOGIC

An Effective Upperbound on Treewidth Using Partial Fill-in of Separators

Linear Algebra Lay 4th Edition Solution

Design and Analysis of Algorithms

Foundations of Discrete Mathematics

Experiment 4 Boolean Functions Implementation

TEACHING & EXAMINATION SCHEME For the Examination COMPUTER SCIENCE. B.Sc. Part-I

Literal Cost F = BD + A B C + A C D F = BD + A B C + A BD + AB C F = (A + B)(A + D)(B + C + D )( B + C + D) L = 10

RGB Digital Image Forgery Detection Using Singular Value Decomposition and One Dimensional Cellular Automata

AN AGENT BASED INTELLIGENT TUTORING SYSTEM FOR PARAMETER PASSING IN JAVA PROGRAMMING

An Interactive Introduction to Graph Theory

EEC 116 Fall 2011 Lab #3: Digital Simulation Tutorial

Software Implementation of Break-Up Algorithm for Logic Minimization

Algorithms for Verifying Variants of Boolean Algebra Equations and Expressions

PRIME WEIGHTED GRAPH IN CRYPTOGRAPHIC SYSTEM FOR SECURE COMMUNICATION. M.B. (Govt.) P.G. College Haldwani (U.K.), INDIA

Chapter 3. Gate-Level Minimization. Outlines

LAB #1 BASIC DIGITAL CIRCUIT

4 KARNAUGH MAP MINIMIZATION

Module -7. Karnaugh Maps

EE292: Fundamentals of ECE

Gate-Level Minimization

Computer Science. Unit-4: Introduction to Boolean Algebra

COURSE STRUCTURE AND SYLLABUS APPROVED IN THE BOARD OF STUDIES MEETING HELD ON JULY TO BE EFFECTIVE FROM THE ACADEMIC YEAR

Test Driven Development with Oracles and Formal Specifications

Foundations of Discrete Mathematics

The Complexity of Camping

Efficient Computation of Canonical Form for Boolean Matching in Large Libraries

IT 201 Digital System Design Module II Notes

Using Geometric Constraints to Capture. design intent

Math 443/543 Graph Theory Notes

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

An Effective Algorithm for Minimum Weighted Vertex Cover problem

Book List. A Collection of Books. Computer Science

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

COMPUTER SIMULATION OF COMPLEX SYSTEMS USING AUTOMATA NETWORKS K. Ming Leung

Minimization of Multiple-Valued Functions in Post Algebra

Chapter 2 Graphs. 2.1 Definition of Graphs

EECS 140/141 Introduction to Digital Logic Design Fall Semester 2016 Exam #1 Date: 3 October 2016

Ch. 5 : Boolean Algebra &

Parallel Combinatorial Search on Computer Cluster: Sam Loyd s Puzzle

Uniform Graph Construction Based on Longitude-Latitude Mapping for Railway Network

CprE 281: Digital Logic

Proposed syllabus for

Continuing with whatever we saw in the previous lectures, we are going to discuss or continue to discuss the hardwired logic design.

Digital Double Exposure on Binary Images Analysis by Boolean Algebra Operations

Operations on Signed Numbers

Giovanni De Micheli. Integrated Systems Centre EPF Lausanne

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 2. LECTURE: LOGIC NETWORK MINIMIZATION 2016/2017

Transcription:

World Applied Programming, Vol (1), No (3), August 2011. 209-214 ISSN: 2222-2510 2011 WAP journal. www.waprogramming.com An Algorithm for Minimizing of Boolean Functions Based on Graph DS Masoud Nosrati * Eslamabad-E-Gharb branch, Islamic Azad University, Eslamabad-E-Gharb, Iran minibigs_m@yahoo.co.uk Mehdi Hariri Eslamabad-E-Gharb branch, Islamic Azad University, Eslamabad-E-Gharb, Iran mehdi.hariri@yahoo.com Abstract: In this paper, we intend to introduce a new heuristic algorithm to apply maximum minimization to Boolean functions with normal SOP form. To implement the proposed algorithm, we use the graph data structure and define the adjacencies. Also, we demonstrate some conditions to achieve the maximum minimization. Through this paper, the problem of shared vertices in more than one adjacency is talked, and the solution is presented. Karnaugh map is used to clarify the matter. Key word: Minimization of Boolean functions Graph data structure SOP functions Discrete mathematics I. INTRODUCTION Minimization of Boolean functions is one of the basic operations in Boolean algebra. This is also useful in digital circuits design, and it was been regarded to decrease the price of manufactured circuits by removing extra gates.[1,13,14,19] In this paper, we present an algorithm to minimize the Boolean functions extremely. We use the graph data structure to implement this algorithm. Before it, some methods and algorithms was introduced like "Factoring Boolean functions using graph partitioning"[2] or "A Heuristic Method of Two-Level Logic Synthesis"[3]. These methods are absolutely heuristic, and they don't give the maximum minimized form of Boolean function all the time. The method that we are going to introduce is a simple way to reach the maximum minimized form of Boolean function. Also, it could be used in education, because of its simplicity. In second part which is entitled as "Graph data structure and agreements", the structure of proposed graph and its objects and methods will be talked. In addition, some agreements are presented which are considered during this paper. In third part that is named "SOP functions and graph", the relationship between SOP functions and graph data structure is objected. Furthermore, the conditions of minimization of function by proposed graph are demonstrated. In "Minimization algorithm", that is forth part of this paper, the algorithm of minimization and its description is presented. Eventually, "conclusion" is places as fifth part. II. GRAPH DATA STRUCTURE AND AGREEMENTS First time, graph has been used for solving the classic problem of Königsberg bridges by Leonhard Euler in 1736. After that, graph came into mathematics world.[4] A graph is constructed of two sets, V (vertices) and E (Edges). For example, look at Fig.1. 209

2 4 5 1 3 G=(V,E) V=1,2,3,4,5 E=(1,2),(1,3),(2,4),(3,4),(4,5) Fig.1 A simple example of graph A path in graph is a set of vertices we should cross to get to a special vertex. If the initial and final vertices are the same, this path is called cycle, and if all the edges in a cycle are met just one time, it is called a simple cycle.[5,6,7] According to these definitions, there is one simple cycle in Fig.1, which is 1,2,4,3. Here, we make two agreements and describe the reason in third part of paper. Agreement1: Each vertex makes a simple cycle by itself. Agreement2: A couple of adjacent vertices make a simple cycle. (Adjacent vertices are those which are related by an edge.) According to these agreements, the simple cycles for Fig.1 are like below: 1, 2, 3, 4, 5 1,2, 1,3, 2,4, 3,4, 4,5 1,2,4,3 Now, we can implement the class of proposed graph data structure. This class contains some objects to store V and E, and also some methods to create and remove vertices and edges.[4,8,9,16,18] In addition, there is a method that returns the list of all simple cycles which begins with Vi. Another method is defined to return the number of all adjacent vertices of V i, too. Class Graph //Objects // Data containers to store Vertices and Edges public: Graph(); // To create an empty graph bool IsEmpty(); // If graph has no vertices returns TRUE(1), else returns FALSE(0) void AddVertex(Vertex V); // Insert a new vertex void AddEdge(Vertex U, Vertex V); // Insert a new edge between u and v void RemoveVertex (Vertex V); // Deletes v and all edges incident to it void RemoveEdge(Vertex U, Vertex V); // Deletes edge (u,v) list Cycles(Vertex V i ); // Returns the list of all cycles that begins with V i int AdjacentVertices(Vertex V i ); // Returns the number of adjacent vertices of V i 210

III. SOP FUNCTIONS AND GRAPH Boolean functions are used for indicating the performance of complex two-level circuits with AND - OR gates. These functions could be shown in normal SOP (Sum Of Products) or POS forms.[10,11,17] We aren't going to talk about algebraic concepts or the way of generating SOP or POS forms. Just propose that we have a SOP function which should be minimized. There are different ways to minimize SOP functions. One is using the algebraic rules, which is hard and confusing for large functions with many variables. Another is using Karnaugh map. It could be used for functions with 2 to 6 variables, by drawing the map of adjacency. In fact, Karnaugh map is an illustrative form of truth table. It puts the adjacent statements near each other and provides the opportunity of selecting appropriate adjacency. Fig.2 shows the Karnaugh map for 4-variables Boolean functions. In this map, different states of variables are showed by 0 and 1.[12] 0000 0001 0011 0010 0100 0101 0111 0110 1100 1101 1111 1110 1000 1001 1011 1010 Fig.2 Karnaugh map for 4-variables Boolean functions It is seen that each two adjacent cells has one different bit. In other word, the XOR of two adjacent cells equals 2 r, r=0,1,2,. Consider that function (I) should be minimized by this map. By replacing the variables with 0 and 1 (function (II)), its Karnaugh map will be as Fig.3. (I) f(w,x,y,z) = w'x' + w'xy'z + w'x + w'xyz + wx' + wx'yz + wx (II) f(w,x,y,z) = 0010 + 0101 + 0110 + 0111 + 1010 + 1011 + 1110 0010 w'xz 0101 0111 0110 1110 1011 1010 wx'y Fig.3 Karnaugh map for function (I) with appropriate adjacencies In Fig.3, appropriate adjacencies are selected, and minimization operation - which is remaining similar bits and removing the others [15] - is done. Essential condition to choose an appropriate adjacency is defined as (*). (*) The number of cells in an adjacency should be equal to 2 k, k=0,1,2, and no similar bits equal to k. Another point which should be regarded is that always the biggest adjacencies that contain more cells should be selected, in order to make the function more minimized, by reducing more different bits.[1,12] Also, it should be 211

paid attention that in functions with complete statements - where all statements are present - minimized function equals to 1. It is seen that minimized function (I) will be like function (III). (III) f(w,x,y,z) = + w'xz + wx'y Suppose that f v is a desire Boolean function. It could be adapted to graph data structure, if for each statement in it, create a vertex and show adjacencies by edges. For example, Fig.4 shows the graph of function (I). 0010 0101 0111 0110 1110 1011 1010 Fig.4 Graph of function (I) To minimize the function of this graph, first the biggest appropriate adjacencies should be found for each vertex. It has to be done regarding agreements 1 & 2. Now, you can find out the reason of making these agreements. Minimization is operated according to the adjacencies (not vertices), so for each alone vertex, an adjacency should be considered. For two adjacent vertices it has to be done, too. In mathematical definition of simple cycles in no directed graphs, simple cycles with less than 3 vertices are not defined.[2,6] Regarding condition (*), Table.1 shows the biggest simple cycles in graph of Fig.4 Vertex 0010 0101 0111 0110 1110 1011 1010 Simple cycle (*) 0010-0110-1110-1010-(0010) 0101-0111-(0101) 0111-0101-(0111) 0111-0110-(0111) 0110-1110-1010-0010-(0110) 1110-1010-0010-0110-(1110) 1011-1010-(1011) 1010-0010-0110-1110-(1010) Minimized w'xz w'xz w'xy wx'y Table.1 List of biggest cycles of graph Fig.4 regarding condition (*) for each vertex For vertices 0010, 0110, 1110, 1010 cycles are the same. Consequently, the minimized forms are similar, too. For vertex 0111 two appropriate adjacency is available. In other word, the biggest cycle is not unique. If both of them be involved in final minimized function, then one extra statement is imposed to it. So, one of them must be chosen as below: If vertex V has more than one biggest cycle regarding (*), choose the adjacency that its first vertex (next to proposed V) has less adjacent. In our example, vertex 0111 has two adjacent 0101 and 0110. First one has 1 adjacent vertex, and second has 3. So, first one has to be chosen and w'xz should appear in final minimized rather than w'xy. The reason is when you choose the path which its first vertex has less adjacent, probability for this vertex to be included in other adjacencies is less, and if it has no other adjacent vertices, it couldn't participate in minimization operation. So, to make sure that it never happens, choose the path with less. But, if the number of adjacent vertices for both of them was equal, then you can choose one randomly. Because, they have similar circumstances and it doesn't differ that which one is selected. 212

IV. MINIMIZATION ALGORITHM To implement the maximum minimization on the introduced graph, the algorithm in below is offered. Create Graph of Boolean function; If all the vertices and edges are present then return 1; Else For each vertex V Find biggest cycles with the condition (*); If biggest cycle is not unique then Find the number of adjacent vertices of first vertex next to V in path; If the numbers of adjacent vertices are equal then Choose one randomly; Else Select the path with lest adjacent vertices for its first vertex; Minimize (take the similar bits and reduce others); Store the minimized forms; Reduce the repeated minimized statements; Return the minimized function; First, it creates a graph according to Boolean function. Then, it checks whether the function is complete, return 1. Else, find the biggest cycles for each vertex, and if it wasn't unique, choose the appropriate one. After that, minimizes the adjacency by taking the similar bits and reduce others. Then, it stores the minimized form. When these steps were done for all the vertices, some statements will be created per vertices (as you see in Table.1). After reducing the repeated ones, final minimized function will be achieved and returned. V. CONCLUSION In this paper, we introduced a new heuristic algorithm to apply maximum minimization to SOP Boolean functions. Therefore, graph data structure as the essential base of this algorithm was defined, and two agreements were made which forked from the difference between mathematical definition of simple cycles and what we need for our object. Then, the method of minimization was talked, which used the concepts of Karnaugh map. Finally, the algorithm of minimization presented. REFERENCES [1] David Money Harris, Sarah L. Harris, Digital Design and Computer Architecture, Morgan Kaufmann, 2007, pp. 51-62. [2] Aviad Mintz, Martin Charles Golumbic, Factoring Boolean functions using graph partitioning, Discrete Applied Mathematics 149 (2005) 131 153 [3] Jan Hlaviča, Petr Fišer, A Heuristic Method of Two-Level Logic Synthesis, Karlovo nám. 13, 121 35 Prague 2. [4] Elis Horowitz, Sartag Sahni, Dinish Mehta, Fundamentals of Data Structures in C++, 2nd ed, Silicon Press, 2006. [5] John Adrian Bondy, U. S. R. Murty, Graph theory with applications, 9th ed, Elsevier Science Ltd, 1976, pp. 1-24. [6] Seymour Lipschutz, Schaum's outline of theory and problems of discrete mathematics, 3rd ed, McGraw-Hill, 2009, pp. 154-200. [7] M.C. Golumbic, Algorithmic Graph Theory and Perfect Graphs, Academic Press, New York, 1980. Annals of Discrete Mathematics, second ed., vol. 57, Elsevier, Amsterdam, 2004. [8] Sedgewick, Robert, Algorithms, Consulting Editor Harrison, Michael A., Addison-Wesley, 1984. pp. 373-455. [9] Seymour Lipschutz, Schaum's outline of theory and problems of data structures, Mcgraw-Hill, 1986. [10] Balch, Mark, Complete Digital Design, McGraw-Hill, 2003. pp. 3-32. [11] Popel, Denvis V., Information theoretic approach to logic function minimization (ebook), Technical University of Szczecin, 2000. [12] Victor Peter Nelson, Digital logic circuit analysis and design, 2nd sub ed, Prentice Hall, 1995, pp. 90-120. [13] T. Sasao. EXMIN2: A Simplication Algorithm for Exclusive-OR-Sum-of -Products Expression for Multiple-Valued-Input Two-Valued- Output functions. IEEE Trans. on Computer Aided Design 12 (1993) 621-632. [14] M.A. Thornton, R. Drechsler, and D.M. Miller. Spectral Techniques in VLSI CAD. Kluwer Academic Publ., 2001. [15] R. M. Karp Reducibility Among Combinatorial Problems. in R. E. Miller and J. W. Thatcher (editors): Complexity of Computer Computations. New York: Plenum Press (1972), 85103. 213

[16] Ian Parberry, Lecture notes on algorithm analysis and computational complexity (ebook), Department of Computer Science, University of North Texas. Pages 66 to 71. [17] Yuke Wang, Data structures, Minimization and complexity of boolean functions (ebook), A thesis of Ph.D degree, University of Saskatchewan, Canada (1995). Pages 8 to 20. [18] Martin Charles Golumbic, Algorithm graph theory and perfect graphs, second edition, Elsevier, 2004, pp. 31-37. [19] Morris M. Mano, Digital Design, 4th ed, Prentice Hall, 2006, pp. 36-110. 214