summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-03-28 10:18:17 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-03-28 10:18:17 -0700
commite026f05ae3c436f825eb9b5f788a3c5f33e7bdad (patch)
treefc4b473bfab7613bf8f2b6afdd5280baff45b5ff
parent81b70c4d20ebe798a5440653ebd40e26bbe99f72 (diff)
downloadabc-e026f05ae3c436f825eb9b5f788a3c5f33e7bdad.tar.gz
abc-e026f05ae3c436f825eb9b5f788a3c5f33e7bdad.tar.bz2
abc-e026f05ae3c436f825eb9b5f788a3c5f33e7bdad.zip
Bug fix in truth table reading for funcs with less than 6 vars.
-rw-r--r--src/base/abci/abcDec.c2
-rw-r--r--src/base/abci/abcRpo.c2
-rw-r--r--src/bool/lucky/luckyRead.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/base/abci/abcDec.c b/src/base/abci/abcDec.c
index a495cefc..919a46de 100644
--- a/src/base/abci/abcDec.c
+++ b/src/base/abci/abcDec.c
@@ -91,7 +91,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit )
void Abc_TruthReadHex( word * pTruth, char * pString, int nVars )
{
int nWords = (nVars < 7)? 1 : (1 << (nVars-6));
- int k, Digit, nDigits = (nWords << 4);
+ int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4);
char EndSymbol;
// skip the first 2 symbols if they are "0x"
if ( pString[0] == '0' && pString[1] == 'x' )
diff --git a/src/base/abci/abcRpo.c b/src/base/abci/abcRpo.c
index 286ef80b..47c033b4 100644
--- a/src/base/abci/abcRpo.c
+++ b/src/base/abci/abcRpo.c
@@ -96,7 +96,7 @@ static inline void Abc_TruthWriteHexDigit(FILE * pFile, int HexDigit) {
static void Abc_TruthReadHex(word * pTruth, char * pString, int nVars) {
int nWords = (nVars < 7) ? 1 : (1 << (nVars - 6));
- int k, Digit, nDigits = (nWords << 4);
+ int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4);
char EndSymbol;
// skip the first 2 symbols if they are "0x"
if (pString[0] == '0' && pString[1] == 'x')
diff --git a/src/bool/lucky/luckyRead.c b/src/bool/lucky/luckyRead.c
index cf8e57d4..10c58170 100644
--- a/src/bool/lucky/luckyRead.c
+++ b/src/bool/lucky/luckyRead.c
@@ -56,7 +56,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit )
static inline void Abc_TruthReadHex( word * pTruth, char * pString, int nVars )
{
int nWords = (nVars < 7)? 1 : (1 << (nVars-6));
- int k, Digit, nDigits = (nWords << 4);
+ int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4);
char EndSymbol;
// skip the first 2 symbols if they are "0x"
if ( pString[0] == '0' && pString[1] == 'x' )