Corner case bug in deriving truth table from SOP.

This commit is contained in:
Alan Mishchenko 2011-11-08 11:36:35 -08:00
parent 9a89e3f9f5
commit 55e9c4d0fa
1 changed files with 1 additions and 1 deletions

View File

@ -954,7 +954,7 @@ char * Abc_SopFromTruthHex( char * pTruth )
// get the number of variables
nTruthSize = strlen(pTruth);
nVars = Extra_Base2Log( nTruthSize ) + 2;
nVars = (nTruthSize < 2) ? 2 : Extra_Base2Log(nTruthSize) + 2;
if ( nTruthSize != (1 << (nVars-2)) )
{
printf( "String %s does not look like a truth table of a %d-variable function.\n", pTruth, nVars );