abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
dauDivs.c File Reference
#include "dauInt.h"
#include "misc/util/utilTruth.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Vec_Int_t
Dau_DsdDivisors (word *pTruth, int nVars)
 DECLARATIONS ///. More...
 
void Dau_DsdTest000 ()
 

Function Documentation

ABC_NAMESPACE_IMPL_START Vec_Int_t* Dau_DsdDivisors ( word pTruth,
int  nVars 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [dauDivs.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [DAG-aware unmapping.]

Synopsis [Divisor computation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
dauDivs.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file dauDivs.c.

47 {
48  word Copy[DAU_MAX_WORD];
49  int nWords = Abc_TtWordNum(nVars);
50  int nDigits = Abc_TtHexDigitNum(nVars);
51  int i, j, k, Digit, Counter[5];
52 
53  printf( " " );
54  printf( " !a *!b" );
55  printf( " !a * b" );
56  printf( " a *!b" );
57  printf( " a * b" );
58  printf( " a + b" );
59  printf( "\n" );
60 
61  for ( i = 0; i < nVars; i++ )
62  for ( j = i+1; j < nVars; j++ )
63  {
64  Abc_TtCopy( Copy, pTruth, nWords, 0 );
65  Abc_TtSwapVars( Copy, nVars, 0, i );
66  Abc_TtSwapVars( Copy, nVars, 1, j );
67  for ( k = 0; k < 5; k++ )
68  Counter[k] = 0;
69  for ( k = 0; k < nDigits; k++ )
70  {
71  Digit = Abc_TtGetHex( Copy, k );
72  if ( Digit == 1 || Digit == 14 )
73  Counter[0]++;
74  else if ( Digit == 2 || Digit == 13 )
75  Counter[1]++;
76  else if ( Digit == 4 || Digit == 11 )
77  Counter[2]++;
78  else if ( Digit == 8 || Digit == 7 )
79  Counter[3]++;
80  else if ( Digit == 6 || Digit == 9 )
81  Counter[4]++;
82  }
83  printf( "%c %c ", 'a'+i, 'a'+j );
84  for ( k = 0; k < 5; k++ )
85  printf( "%7d", Counter[k] );
86  printf( "\n" );
87  }
88  return NULL;
89 }
static int Abc_TtGetHex(word *p, int k)
Definition: utilTruth.h:154
int nWords
Definition: abcNpn.c:127
static int Abc_TtHexDigitNum(int nVars)
Definition: utilTruth.h:171
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
Definition: utilTruth.h:221
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static int Counter
#define DAU_MAX_WORD
Definition: dau.h:44
static int Abc_TtWordNum(int nVars)
Definition: utilTruth.h:169
static void Abc_TtSwapVars(word *pTruth, int nVars, int iVar, int jVar)
Definition: utilTruth.h:1228
void Dau_DsdTest000 ( )

Definition at line 90 of file dauDivs.c.

91 {
92 // char * pDsd = "!(!(abc)!(def))";
93 // char * pDsd = "[(abc)(def)]";
94  char * pDsd = "<<abc>d(ef)>";
95  word t = Dau_Dsd6ToTruth( pDsd );
96 // word t = 0xCA88CA88CA88CA88;
97 // word t = 0x9ef7a8d9c7193a0f;
98  int nVars = Abc_TtSupportSize( &t, 6 );
99  return;
100 // word t = 0xCACACACACACACACA;
101  Dau_DsdDivisors( &t, nVars );
102 }
ABC_NAMESPACE_IMPL_START Vec_Int_t * Dau_DsdDivisors(word *pTruth, int nVars)
DECLARATIONS ///.
Definition: dauDivs.c:46
word Dau_Dsd6ToTruth(char *p)
Definition: dauDsd.c:445
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static int Abc_TtSupportSize(word *t, int nVars)
Definition: utilTruth.h:986