Commit 55e9c4d0 by Alan Mishchenko

Corner case bug in deriving truth table from SOP.

parent 9a89e3f9
......@@ -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 );
......
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