diff options
Diffstat (limited to 'src/misc/extra/extraUtilFile.c')
-rw-r--r-- | src/misc/extra/extraUtilFile.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index 0af78ac4..eb1b7dce 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -656,6 +656,24 @@ void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars ) } // fprintf( pFile, "\n" ); } +void Extra_PrintHex2( FILE * pFile, unsigned * pTruth, int nVars ) +{ + int nMints, nDigits, Digit, k; + + // write the number into the file + //fprintf( pFile, "0x" ); + nMints = (1 << nVars); + nDigits = nMints / 4 + ((nMints % 4) > 0); + for ( k = nDigits - 1; k >= 0; k-- ) + { + Digit = ((pTruth[k/8] >> (k * 4)) & 15); + if ( Digit < 10 ) + fprintf( pFile, "%d", Digit ); + else + fprintf( pFile, "%c", 'A' + Digit-10 ); + } +// fprintf( pFile, "\n" ); +} void Extra_PrintHexReverse( FILE * pFile, unsigned * pTruth, int nVars ) { int nMints, nDigits, Digit, k; |