123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <html>
- <head>
- <title>Creating expressions</title>
- </head>
- <body bgcolor="FFFFFF">
- <h1>Creating expressions</h1>
- <p>For each output variable, the Combinational Analysis window
- maintains two structures - the relevant column of the truth table,
- and a Boolean expression - specifying how each output relates to its
- input. You can edit either the truth table or the expression; the other
- will automatically change as necessary to keep them consistent.</p>
- <p>As we will see on the next page, the Boolean expressions are
- particularly useful because the Combinational Analysis window will
- use these when told to build a circuit corresponding to the current
- state.</p>
- <p>You can view and edit the expressions using the window's last two
- tabs, the Expression tab and the Minimized tab.</p>
- <h2>The Expression tab</h2>
- <center><img src="../../../img-guide/analyze-expr.png" width="466" height="323"></center>
- <p>The Expression tab allows you to view and edit the current
- expression associated with each output variable. You can select the
- output expression you want to view and edit using the selector labeled
- "Output:" at the pane's top.</p>
- <p>Just below the selector will appear the expression formatted in a
- particularly common notation, where an OR is represented as addition,
- an AND is represented as multiplication, and a NOT is denoted with a bar
- above the portion affected by the NOT.</p>
- <p>The text pane below this displays the same information in ASCII form.
- Here, a NOT is represented with a tilde ('~').</p>
- <p>You can edit the expression in the text pane and click the Enter
- button to make it take effect; doing this will also update the truth
- table to make it correspond. The Clear button clears the text pane,
- and the Revert button changes the pane back to representing the
- current expression.</p>
- <p>Note that your edited expression will be lost if you edit the truth table.</p>
- <p>In addition to multiplication and addition standing for AND and OR, an expression
- you type may contain any of C/Java logical operators, as well as simply the words themselves.</p>
- <center><table>
- <tr><th>highest precedence</th><td align="center"><tt>~</tt> <tt>!</tt> <tt>'</tt></td> <th>NOT</th></tr>
- <tr><th></th><td align="center">(none) <tt>&</tt> <tt>&&</tt></td> <th>AND</th></tr>
- <tr><th></th><td align="center"><tt>^</tt></td> <th>XOR</th></tr>
- <tr><th>lowest precedence</th><td align="center"><tt>+</tt> <tt>|</tt> <tt>||</tt></td> <th>OR</th></tr>
- </table></center>
- <p>The following examples are all valid representations of the same expression. You could
- also mix the operators.</p>
- <table>
- <tr><td><tt>a' (b + c)</tt></td></tr>
- <tr><td><tt>!a && (b || c)</tt></td></tr>
- <tr><td><tt>NOT a AND (b OR c)</tt></td></tr>
- </table>
- <p>In general, parentheses within a sequence of ANDs (or ORs or
- XORs) do not matter. (In particular, when Logisim creates a
- corresponding circuit, it will ignore such parentheses.)</p>
- <h2>The Minimized tab</h2>
- <center><img src="../../../img-guide/analyze-min.png" width="466" height="323"></center>
- <p>The final tab displays a minimized expression
- corresponding to a column of the truth table. You can select which
- output's minimized expression you want to view using the selector
- at top, and you can indicate whether you want to derive a sum-of-products
- expression or a product-of-sums expression using the selector below.</p>
- <p>If there are four or fewer inputs, a Karnaugh map corresponding
- to the variable will appear below the selector. You can click the
- Karnaugh map to change the corresponding truth table values. The
- Karnaugh map will also display the currently selected terms for the
- minimized expression as solid semitransparent rounded rectangles.</p>
- <p>Below this is the minimized expression itself, formatted as in the
- Expression tab's display. If there are more than four inputs,
- the Karnaugh map will not appear; but the minimized expression will
- still be computed. (Logisim uses the Quine-McCluskey algorithm to
- compute the minimized expression. This is equivalent to a Karnaugh map,
- but it applies to any number of input variables.)</p>
- <p>The Set As Expression button allows you to select the minimized
- expression as the expression corresponding to the variable. This will
- generally not be necessary, as edits to the truth table result in using
- the minimized expression for the changed column; but if you enter an
- expression through the Expression tab, this can be a convenient way
- to switch to the corresponding minimized expression.</p>
- <p><strong>Next:</strong> <a href="gen.html">Generating a circuit</a>.</p>
- </body>
- </html>
|