1lytics

Creating K-Maps from Analytical Form

Creating functions set is the your first step in the Gorgeous Karnaugh K-Maps minimization software. To create function set and enter functions from analytical form choose “File” — “New” — “From analytic form” menu item. Next dialog appears on the screen:

Input from Analytic Form Dialog

In the dialog you can see: 1) main input text field; 2) Buttons to show/paste/load data; 3) property grid with creation options. Buttons are intended for:

  • Show - replace the content of data input field with predefined sample;
  • Paste - paste clipboard content to data input field;
  • Load - load data from the text file with “Open File” dialog.

When You Enter Analytical Functions Text Use the Following Rules

  1. Enter expressions line by line and separate them from each other with “;” (semicolon). This allows you to enter long expressions in multiple lines each one;
  2. Enter functions in form: FN = A&B|C;, where FN - function name, A,B,C - input variables;
  3. Function and variable names use form: NAME[INDEX][ACCENT], where NAME is the variable or function name (this is mandatory part), consists from letters and “_” symbols; INDEX - variable or function index, consists from digits; ACCENT - accent symbol - “`” or “'”
  4. The “#” symbol in begining of the line marks that line as comment (comment ends at the end of line)

Symbols for Logical Operations

  • !” or “~” - for negation (high priority operation);
  • &”, “*”, “&&” or “ ” (space) - for conjunction (normal priority operation);
  • |”, “+” or “||” - for disjunction (low priority operation);
  • (” and “)” - use parentheses to clarify or override operator precedence.

Special “$” Directives

When you enter the functions, you can use special directives started with “$”:

  • $INORDER or $INPUTORDER - sets the input variables order to build the truth table, overwise the inputs will be placed to truth table in order in which they are positioned in expressions;
  • $FNORDER, $OUTORDER, $OUTPUTORDER or $FUNCTIONORDER - sets the functions order to build the truth table;
  • $SUBSTEXPR or $SUBSTEXPRESSION - sets the substitution expression to format results for programming languages.

Input Sample

Next listing demonstrates all of features, descibed above:

$INORDER = A,B,C;
$FNORDER = y1, y2, y2', y2'';
# “i==33” is an expression with destination
# programming language syntax - C/C++
$SUBSTEXPR A = i==33;  
$SUBSTEXPR B = j<5;
$SUBSTEXPR C = j>=22;

# If $INORDER directive not taken, 
# the C, B, A variables order will be applied
y2'  = C | B&A; 
y1   = (A+C) && B | (B*A);
y2'' =  A
     || B
     || C;
y2   = A B C;

Output for C/C++

After minimization, you got the next code for C/C++:

/* New set - Coverage by 1 */
/* y1 */
if ((j<5)&&(j>=22) || (i==33)&&(j<5))
    {
    /* true branch */
    }
else
    {
    /* false branch */
    }
/* y2 */
if (ABC)
    {
    /* true branch */
    }
else
    {
    /* false branch */
    }
/* y2_ */
if ((i==33)&&(j<5) || (j>=22))
    {
    /* true branch */
    }
else
    {
    /* false branch */
    }
/* y2__ */
if ((i==33) || (j<5) || (j>=22))
    {
    /* true branch */
    }
else
    {
    /* false branch */
    }