ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
dauDivs.c
Go to the documentation of this file.
1
20
21#include "dauInt.h"
22#include "misc/util/utilTruth.h"
23
25
29
30
34
46Vec_Int_t * Dau_DsdDivisors( word * pTruth, int nVars )
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}
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}
103
104
108
109
111
int nWords
Definition abcNpn.c:127
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
ABC_NAMESPACE_IMPL_START Vec_Int_t * Dau_DsdDivisors(word *pTruth, int nVars)
DECLARATIONS ///.
Definition dauDivs.c:46
void Dau_DsdTest000()
Definition dauDivs.c:90
#define DAU_MAX_WORD
Definition dau.h:44
word Dau_Dsd6ToTruth(char *p)
Definition dauDsd.c:445
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36