summaryrefslogtreecommitdiffstats
path: root/src/misc/extra/extraUtilFile.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-10-30 22:25:45 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-10-30 22:25:45 -0700
commit0fafe786aed1f5977b204cc3ca490659a5c182fb (patch)
tree0fcdc74b55233adb4dc1b3030618cd746068c189 /src/misc/extra/extraUtilFile.c
parent77fde55b1b87e7e8f92edde61d25f951a9b40c33 (diff)
downloadabc-0fafe786aed1f5977b204cc3ca490659a5c182fb.tar.gz
abc-0fafe786aed1f5977b204cc3ca490659a5c182fb.tar.bz2
abc-0fafe786aed1f5977b204cc3ca490659a5c182fb.zip
Improvements to the truth table computations.
Diffstat (limited to 'src/misc/extra/extraUtilFile.c')
-rw-r--r--src/misc/extra/extraUtilFile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index c0810e4b..721cbb12 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -561,6 +561,24 @@ void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars )
}
// fprintf( pFile, "\n" );
}
+void Extra_PrintHexReverse( 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;
+ for ( k = 0; k < nDigits; 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" );
+}
/**Function*************************************************************