Commit e026f05a by Alan Mishchenko

Bug fix in truth table reading for funcs with less than 6 vars.

parent 81b70c4d
...@@ -91,7 +91,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit ) ...@@ -91,7 +91,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit )
void Abc_TruthReadHex( word * pTruth, char * pString, int nVars ) void Abc_TruthReadHex( word * pTruth, char * pString, int nVars )
{ {
int nWords = (nVars < 7)? 1 : (1 << (nVars-6)); 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; char EndSymbol;
// skip the first 2 symbols if they are "0x" // skip the first 2 symbols if they are "0x"
if ( pString[0] == '0' && pString[1] == 'x' ) if ( pString[0] == '0' && pString[1] == 'x' )
......
...@@ -96,7 +96,7 @@ static inline void Abc_TruthWriteHexDigit(FILE * pFile, int HexDigit) { ...@@ -96,7 +96,7 @@ static inline void Abc_TruthWriteHexDigit(FILE * pFile, int HexDigit) {
static void Abc_TruthReadHex(word * pTruth, char * pString, int nVars) { static void Abc_TruthReadHex(word * pTruth, char * pString, int nVars) {
int nWords = (nVars < 7) ? 1 : (1 << (nVars - 6)); 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; char EndSymbol;
// skip the first 2 symbols if they are "0x" // skip the first 2 symbols if they are "0x"
if (pString[0] == '0' && pString[1] == 'x') if (pString[0] == '0' && pString[1] == 'x')
......
...@@ -56,7 +56,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit ) ...@@ -56,7 +56,7 @@ static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit )
static inline void Abc_TruthReadHex( word * pTruth, char * pString, int nVars ) static inline void Abc_TruthReadHex( word * pTruth, char * pString, int nVars )
{ {
int nWords = (nVars < 7)? 1 : (1 << (nVars-6)); 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; char EndSymbol;
// skip the first 2 symbols if they are "0x" // skip the first 2 symbols if they are "0x"
if ( pString[0] == '0' && pString[1] == 'x' ) if ( pString[0] == '0' && pString[1] == 'x' )
......
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