Factoring Logic Functions Using Graph Partitioning Aviad Mintz - - PowerPoint PPT Presentation

factoring logic functions using graph partitioning
SMART_READER_LITE
LIVE PREVIEW

Factoring Logic Functions Using Graph Partitioning Aviad Mintz - - PowerPoint PPT Presentation

Factoring Logic Functions Using Graph Partitioning Aviad Mintz Martin C. Golumbic University of Haifa Outline of Talk Introduction Proposed Method Read Once Functions Clusters and Cluster Intersection Graph Separability


slide-1
SLIDE 1

Aviad Mintz Martin C. Golumbic

Factoring Logic Functions Using Graph Partitioning

University of Haifa

slide-2
SLIDE 2

Outline of Talk

 Introduction  Proposed Method  Read Once Functions  Clusters and Cluster Intersection Graph  Separability function and partition algorithms  Form Conversions - P2SS2P  Factoring Algorithm - Xfactor  Results  Analysis of Xfactor’s parameters  Best Combination Group versus Best Average List  Run Time  Summary

slide-3
SLIDE 3

Introduction

 Factoring Boolean Functions: Deriving a minimal factored form from a sum

  • f products representation.

Example.

 Complexity: NP - Hard.  Known Algorithms: Algebraic methods (QF and GF), Boolean methods. All algorithms work with a kind of division.

d c b a d ac ab F       ) (

slide-4
SLIDE 4

Proposed Method

 Use Graph Partitioning rather than division.

 Exploiting locality of the literals.

 Identify Read Once Functions and factor them separately.

 Fast to factor, and frequently appears in lower

levels of logic.

slide-5
SLIDE 5

Read Once Functions

 Definition: Read Once Function - A function that has a factored form in which each variable appears exactly

  • nce.

Example:

 Remarks:

 Read Once functions are subset of Unate

Functions.

 Read Once Functions frequently appear at lower

levels of Logic Design (PP 95).

 The complexity of identifying and factoring Read

Once functions has almost linear complexity (in the input size).

)) ( ( g d c b a g c a d c a b a F      

slide-6
SLIDE 6

Clusters

 Definition: A Cluster is the set of literals in a prime implicant of an SOP representation or prime explicant in a POS representation. Example:

Clusters of F:

cg acd abg abd F    

    

g c d c a g b a d b a , , , , , , ,

slide-7
SLIDE 7

Cluster Intersection Graph

 Definition: G(C,E) an undirected weighted graph where:

C - clusters of the function

  • the number of common literals

Example:

 

 

    Cj Ci j i E ,

cg acd abg abd F    

{a,b,d} {a,c,d} {c,g} {a,b,g} 2 1 2 1 1

) , ( j i

W

slide-8
SLIDE 8

Separability Function

 Measure separability of the cluster intersection graph by a graph partitioning algorithm.  Try to partition the graph evenly (to minimize the number of stages).  Choose the minimal separabilty and return its value and partitions ( - sets of vertices).

B A,

slide-9
SLIDE 9

Form Conversions – P2S and S2P Functions

 P2S - convert sum of product to product of sums  S2P - convert product of sums to sum of products  P2SS2P – a shortcut for both

slide-10
SLIDE 10

Factoring Algorithm Using Graph Partitioning - Xfactor

Input: Parse tree T of the Boolean function being factored. Xfactor(T).

 If T is a Read Once function - Construct the Read Once

tree and exit.

 Otherwise, Construct the Cluster Intersection Graph G

corresponding to T and Calculate the Separability.

 If the Separability of G is not 0 - Build T* by P2SS2P,

Construct the Cluster Intersection Graph G* and Calculate the Separability.

 If the Separability of G is lower than the Separabilty of

G* - Partition T accordingly and Call Xfactor with each part.

 Otherwise, Partition T* and Call Xfactor with each part.

slide-11
SLIDE 11

Factoring Algorithm - Example cg acd abg abd F    

{a,b,d} {a,c,d} {c,g} {a,b,g} 2 1 2 1 1 G(C,E):

slide-12
SLIDE 12

Factoring Algorithm - Example (Cont. 1)

) )( )( )( ( * g d c b g a c a F     

{a,g} {d,g} {b,c} {a,c} 1 1 1

Xfactor chooses the second option and partitions G* evenly.

) )( ( ) )( (

2 1

c b c a F g d g a F      

G*(C*,E*):

slide-13
SLIDE 13

Factoring Algorithm - Example (Cont. 2)

F1 and F2 are Read Once functions. Thus. Algebraic factoring (GF) produces worse result: Boolean factoring produces same result as. Xfactor.

c ab c b c a F g ad g d g a F           ) )( ( ) )( (

2 1

) )( ( c ab g ad F    cg cd g d b a F     ) ) ( ( (

slide-14
SLIDE 14

Results #1

Factoring Results 1

5 10 15 20 25 30 Ofactor Pfactor Qfactor Rfactor Sfactor Tfactor Boolean Functions Literals QF GF BF XF

slide-15
SLIDE 15

Results #2

Factoring Results2

50 100 150 200 250 300 350 400 5xp1 f51m misex1 rd53 sao2 vg2 z4ml Boolean Functions Literals QF GF BF XF

slide-16
SLIDE 16

Results #3

Factoring Results3

50 100 150 200 250 300 350 400

9 symml alu 2 _ k alu 2 _ l alu 2 _

  • alu

4 _

  • alu

4 _ p alu 4 _ v b 9 _ a 1 b 9 _ d 1 b 9 _ i 1 b 9 _ z c 8 _ r c 8 _ s c 8 _ t cm 150 a cm 162 a _

  • cm

162 a _ p cm 162 a _ q cm 162 a _ r cm 163 a _ q cm 163 a _ r cm 163 a _ s cm 163 a _ t cm 85 a _ l cm 85 a _ m cm 85 a _ n frg 1 _ d i 2 majority mux pcle _ y pcle _ z pcle _ a pcle _ b pcler 8 _ r sct _ d term 1 _ r term 1 _ s

Boolean Functions Literals GF XF

slide-17
SLIDE 17

Results - Summary

Algorithm

Total # of Literals QF 3630 GF 3408 XF 2586

slide-18
SLIDE 18

Xfactor’s Parameters

Parameter Description Option

C CI Graph’s Type (1) VCI, (0) LCI W Weight Balancing (1) Use or (0) no use of weight balancing P Partition Cut Value (1) Use or (0) no use of modified cut size F FM Refinement (1) Use or (0) no use of FM I Initial Search Vertex (0) arbitrary, (1) min., (2) max., (3) random L LSP Stopping (1) 50% of vertices, (0) completing the 50% level M IBM90 Merge Function (1)maximum, (0) addition

slide-19
SLIDE 19

Parameters of Cluster Intersection Graph

 Type of cluster intersection graph (C parameter): variable (VCI) or literal (LCI) Example: No edge in LCI, edge in VCI  Edges weight (W parameter): number of common literals or balance function result

Balance function:

Example: LCI graph : VCI graph :

|) || /(|

2 ) , ( ) , ( j i C C C C

C C w z

j i j i

 b a C ab C

j i

 

abdh C c b a C

j i

 

1/12 1/4 * 1/3

) , (

 

j C i C

z 1/3 2/4 * 2/3

) , (

 

j C i C

z

slide-20
SLIDE 20

Separability Function Parameters

 Separability value (P parameter): Regular cut size. Or. Modified cut size.

} , | ) ( { ) , (

) , (

B v A u w B A

v u

     

|) | * | | * 4 /( |) | | (| * ) , ( B A B A B A    

slide-21
SLIDE 21

Partition Algorithms

 Use of 4 different partition algorithms

 Level structure partitioning (LSP)  Greedy graph growing partitioning (GGGP)  Max grow partitioning (MGP)  Ibm90

 Refinement algorithm (F parameter ):

Use or no use of the Fiduccia-Mattheyses refinement algorithm

slide-22
SLIDE 22

Partition Algorithm 1 – Level Structure Partitioning (LSP)

General structure

 Choose a starting vertex v  Partition the graph vertices into levels by using

breadth first search (BFS) LSP stopping parameter (L parameter): Stop the BFS after covering 50% of the graph’s vertices

  • r

Stop the BFS after completing the remainder of the level k where the 50% vertex occurs Initialize parameter (I parameter): Possible values: an arbitrary vertex 0, a minimum connected vertex, a maximum connected vertex and a random vertex

slide-23
SLIDE 23

Partition Algorithm 2 – Greedy Graph Growing Partitioning (GGGP)

General structure -.

 Divide the graph’s nodes to two sets, the growing

region and the other region.

 Nodes move only from the other region to the

growing region until there are no nodes in the other region.

 The order of the movement is greedy; The next

node that will be moved is the one that will reduce the connectivity between the regions by the maximum amount.

 First node moving to the growing region is

selected by the I parameter.

slide-24
SLIDE 24

Partition Algorithm 3 – Max Grow Partitioning (MGP)

General structure -.

 Divide the graph’s nodes to two sets, the growing

region and the other region.

 Nodes move only from the other region to the

growing region until there are no nodes in the other region.

 The order of the movement is by the heaviest

edge, the node connected to the heaviest edge in the cut, will be moved to the growing region.

 First node moving to the growing region is selected

by the I parameter.

slide-25
SLIDE 25

Partition Algorithm 4 – IBM90

General structure.  At each step the algorithm chooses two vertices u and v which are connected by the heaviest edge (e = (u,v)) and merges them to one new vertex (uv).  During the merge, the edge e=(u,v) connecting the two vertices is eliminated and each pair of edges ((u.X),(v,x)) connecting these two vertices to another vertex x are merged.  This process stops when there are exist two vertices and one edge which represents the bipartition of the whole graph.  Weight of the merged edge (M parameter): Sum of its originals or max of its originals.

) , ( ) , ( ) , ( x v x u x uv

w w w  

) , (

) , ( ) , ( ) , ( x v x u x uv

w w Max w 

slide-26
SLIDE 26

Analysis of Xfactor’s Parameters

Parameter Preferred Value Condition C Literal Type Graph (LCI) Always W Balanced Edge’s Wight Most of the Time P Modified Cut Size Always F Using Refinement Most of the Time I None No Clear Answer L None No Clear Answer M Maximum Value Always

slide-27
SLIDE 27

Factoring Algorithms of Best Combination Group

Algorithm Parameters % Achieving Best Total Literals IBM90 W0C0F0P1M1 69 3913 IBM90 W1C0F0P1M1 66 3574 MGP W0C0F0P1I3 60 3072 GGGP W0C0F0P1I0 58 3070 GGGP W1C0F0P1I0 57 2985 LSP W1C0F1P1L1I0 52 2786 LSP W0C0F1P1L0I3 52 3333 LSP W0C0F1P1L0I2 52 3520 LSP W1C0F1P1L1I3 51 2776 LSP W1C0F1P1L1I2 51 2790 GGGP W1C0F0P1I3 51 3058

slide-28
SLIDE 28

List of Best Average Factoring Algorithms

Algorithm Parameters Total Literals % Achieving Best LSP W1C0F1P1L1I3 2776 51 LSP W1C0F1P1L1I0 2786 52 LSP W1C0F1P1L1I2 2790 51 GGGP W1C0F1P1I1 2800 55 MGP W1C0F0P1I1 2890 55 MGP W1C0F1P1I3 2900 53 GGGP W1C0F1P1I3 2906 50 GGGP W1C0F1P1I0 2912 51 MGP W1C0F1P1I0 2918 51 MGP W1C0F1P1I2 2918 51 LSP W1C0F1P1L1I1 2923 49 GGGP W1C0F0P1I1 2940 51

slide-29
SLIDE 29

Analysis

 Most of the factoring algorithms which belong to the Best Combination Group do not belong to the Best Average List.  The parameters values of the Factoring algorithms in the Best Average List follows the majority of all factoring algorithm. While parameters values of the Factoring algorithms in the Best Combination Group are exceptional.  Factoring strategy-.

 General case – use the best factoring algorithm from

the best average list.

 Local optimization – use one from the best

combination group (maybe more then one).

slide-30
SLIDE 30

Does Better Partitioning Yield Better Factoring

 An Open Question.  In general, we believe it does, but counterexamples are easy to construct.

slide-31
SLIDE 31

Run Time

 Xfactor consumes 2 to 12 times more CPU time than Algebraic methods and quite comparable to Boolean factoring.  Most of the CPU time is spent on P2SS2P conversions (30%-80%).  20% to 50% of P2SS2P conversions are redundant.  New techniques to eliminate redundant P2SS2P runs yield better run time.

slide-32
SLIDE 32

Summary

 We have presented a new method of factoring logic functions using Graph Partitioning.  The method is optimal on Read Once Functions.  The empirical results show that our method is better than Algebraic Factoring and competitive with Boolean Factoring.