Commit 110bac43 by Alan Mishchenko

Improvement in truth table printout.

parent c899a4cb
...@@ -1396,30 +1396,45 @@ static inline void Abc_TtPrintHex( word * pTruth, int nVars ) ...@@ -1396,30 +1396,45 @@ static inline void Abc_TtPrintHex( word * pTruth, int nVars )
{ {
word * pThis, * pLimit = pTruth + Abc_TtWordNum(nVars); word * pThis, * pLimit = pTruth + Abc_TtWordNum(nVars);
int k; int k;
assert( nVars >= 2 ); if ( nVars < 2 )
for ( pThis = pTruth; pThis < pLimit; pThis++ ) printf( "%c", Abc_TtPrintDigit((int)pTruth[0] & 15) );
for ( k = 0; k < 16; k++ ) else
printf( "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) ); {
assert( nVars >= 2 );
for ( pThis = pTruth; pThis < pLimit; pThis++ )
for ( k = 0; k < 16; k++ )
printf( "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) );
}
printf( "\n" ); printf( "\n" );
} }
static inline void Abc_TtPrintHexRev( FILE * pFile, word * pTruth, int nVars ) static inline void Abc_TtPrintHexRev( FILE * pFile, word * pTruth, int nVars )
{ {
word * pThis; word * pThis;
int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2)); int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2));
assert( nVars >= 2 ); if ( nVars < 2 )
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- ) fprintf( pFile, "%c", Abc_TtPrintDigit((int)pTruth[0] & 15) );
for ( k = StartK - 1; k >= 0; k-- ) else
fprintf( pFile, "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) ); {
assert( nVars >= 2 );
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
for ( k = StartK - 1; k >= 0; k-- )
fprintf( pFile, "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) );
}
// printf( "\n" ); // printf( "\n" );
} }
static inline void Abc_TtPrintHexSpecial( word * pTruth, int nVars ) static inline void Abc_TtPrintHexSpecial( word * pTruth, int nVars )
{ {
word * pThis; word * pThis;
int k; int k;
assert( nVars >= 2 ); if ( nVars < 2 )
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- ) printf( "%c", Abc_TtPrintDigit((int)pTruth[0] & 15) );
for ( k = 0; k < 16; k++ ) else
printf( "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) ); {
assert( nVars >= 2 );
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
for ( k = 0; k < 16; k++ )
printf( "%c", Abc_TtPrintDigit((int)(pThis[0] >> (k << 2)) & 15) );
}
printf( "\n" ); printf( "\n" );
} }
static inline int Abc_TtWriteHexRev( char * pStr, word * pTruth, int nVars ) static inline int Abc_TtWriteHexRev( char * pStr, word * pTruth, int nVars )
...@@ -1427,10 +1442,15 @@ static inline int Abc_TtWriteHexRev( char * pStr, word * pTruth, int nVars ) ...@@ -1427,10 +1442,15 @@ static inline int Abc_TtWriteHexRev( char * pStr, word * pTruth, int nVars )
word * pThis; word * pThis;
char * pStrInit = pStr; char * pStrInit = pStr;
int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2)); int k, StartK = nVars >= 6 ? 16 : (1 << (nVars - 2));
assert( nVars >= 2 ); if ( nVars < 2 )
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- ) *pStr++ = Abc_TtPrintDigit((int)pTruth[0] & 15);
for ( k = StartK - 1; k >= 0; k-- ) else
*pStr++ = Abc_TtPrintDigit( (int)(pThis[0] >> (k << 2)) & 15 ); {
assert( nVars >= 2 );
for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
for ( k = StartK - 1; k >= 0; k-- )
*pStr++ = Abc_TtPrintDigit( (int)(pThis[0] >> (k << 2)) & 15 );
}
return pStr - pStrInit; return pStr - pStrInit;
} }
static inline void Abc_TtPrintHexArrayRev( FILE * pFile, word * pTruth, int nDigits ) static inline void Abc_TtPrintHexArrayRev( FILE * pFile, word * pTruth, int nDigits )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment