diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-09-26 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-09-26 08:01:00 -0700 |
commit | 7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2 (patch) | |
tree | 353d49651b06530ce1a4b1884b2f187ee3957c85 /src/aig/kit/kitTruth.c | |
parent | d62ee0a90d14fe762015906b6b3a5ad23421d390 (diff) | |
download | abc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.tar.gz abc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.tar.bz2 abc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.zip |
Version abc70926
Diffstat (limited to 'src/aig/kit/kitTruth.c')
-rw-r--r-- | src/aig/kit/kitTruth.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/aig/kit/kitTruth.c b/src/aig/kit/kitTruth.c index 65389ef9..5360ad7f 100644 --- a/src/aig/kit/kitTruth.c +++ b/src/aig/kit/kitTruth.c @@ -1634,6 +1634,33 @@ int Kit_TruthCountMinterms( unsigned * pTruth, int nVars, int * pRes, int * pByt /**Function************************************************************* + Synopsis [Prints the hex unsigned into a file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Kit_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars ) +{ + int nDigits, Digit, k; + // write the number into the file + nDigits = (1 << nVars) / 4; + for ( k = nDigits - 1; k >= 0; k-- ) + { + Digit = ((Sign[k/8] >> ((k%8) * 4)) & 15); + if ( Digit < 10 ) + fprintf( pFile, "%d", Digit ); + else + fprintf( pFile, "%c", 'a' + Digit-10 ); + } +// fprintf( pFile, "\n" ); +} + +/**Function************************************************************* + Synopsis [Fast counting minterms for the functions.] Description [Returns 0 if the function is a constant.] @@ -1665,7 +1692,7 @@ void Kit_TruthCountMintermsPrecomp() uWord |= (bit_count[i & 0x33] << 16); uWord |= (bit_count[i & 0x0f] << 24); printf( "0x" ); - Extra_PrintHexadecimal( stdout, &uWord, 5 ); + Kit_PrintHexadecimal( stdout, &uWord, 5 ); printf( ", " ); } } |