Decision Tables and Trees
The required system responses are sometimes difficult to describe. A finite state machine might not be able to easily show all responses. What are we then to do? Decision trees and tables have been around for decades. They allow you to visually construct the system.
To construct a decision table draw a row for each stimulus that will be used in the process of making a decision. Next draw a column for every possible combination of outcomes of those conditions. If there are n conditions and each has a binary result, then there will be 2n columns. Last, add rows on the bottom of the table for each response you want the system to perform. The following Figure shows an incomplete decision table, it lacks the last 8 columns, for a hypothetical machine.
Time limit exceeded |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
|
|
|
|
|
|
|
|
Open vent command |
x |
x |
x |
x |
x |
x |
x |
x |
|
|
|
|
|
|
|
|
x |
x |
x |
x |
x |
x |
x |
x |
Close vent command |
x |
x |
x |
x |
|
|
|
|
x |
x |
x |
x |
|
|
|
|
x |
x |
x |
x |
|
|
|
|
Vent is closed |
x |
x |
|
|
x |
x |
|
|
x |
x |
|
|
x |
x |
|
|
x |
x |
|
|
x |
x |
|
|
Vent is open |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
x |
|
--------------------------------- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
-- |
Open vent |
|
|
|
x |
|
|
|
x |
|
|
|
|
|
|
|
|
|
x |
|
|
|
x |
|
|
Close vent |
|
|
|
|
|
|
|
|
|
|
x |
x |
|
|
|
|
|
|
x |
|
|
|
|
|
Impossible |
x |
|
x |
|
x |
x |
|
|
x |
|
|
|
x |
|
|
|
x |
|
|
x |
x |
|
|
x |
Do nothing |
|
x |
|
|
|
|
x |
|
|
x |
|
|
|
x |
x |
x |
|
|
|
|
|
|
x |
|
A decision tree is graphical rather than tabular. It is a flow chart without loops and fan-in. The decision tree takes up more room then the table but shows the order of evaluating the conditions. Below is the decision tree to match the table.

|