Correct Overspecified and Underspecified Truth Tables

Truth tables implement combinatorial logic design in a concise, tabular format. Truth tables are supported only in Stateflow® blocks in a Simulink® model. For more information, see Reuse Combinatorial Logic by Defining Truth Tables.

Example of an Overspecified Truth Table

An overspecified truth table contains at least one decision that never executes because a previous decision specifies it in the Condition Table. The following example shows the Condition Table of an overspecified truth table.

The decision in column D3 (-TT) specifies the decisions FTT and TTT. These decisions are duplicates of decisions D1 (FTT) and D2 (TTT and TFT). Therefore, column D3 is an overspecification.

The following example shows the Condition Table of a truth table that appears to be overspecified, but is not.

In this case, the decision D4 specifies two decisions (TTT and FTT). FTT also appears in decision D1, but TTT is not a duplicate. Therefore, this Condition Table is not overspecified.

Example of an Underspecified Truth Table

An underspecified truth table lacks one or more possible decisions that require an action to avoid undefined behavior. The following example shows the Condition Table of an underspecified truth table.

Complete coverage of the conditions in the preceding truth table requires a Condition Table with every possible decision:

A possible workaround is to specify an action for all other possible decisions through a default decision, named DA:

The last decision column is the default decision for the truth table. The default decision covers any remaining decisions not tested in the preceding decision columns. See The Default Decision Column for an example and more complete description of the default decision column for a Condition Table.