In automata theory and sequential logic, a state transition table is a table showing what state (or states in the case of a nondeterministic finite automaton) a finite semiautomaton or finite state machine will move to, based on the current state and other inputs. A state table is essentially a truth table in which some of the inputs are the current state, and the outputs include the next state, along with other outputs.
A state table is one of many ways to specify a state machine, other ways being a state diagram, and a characteristic equation.
Contents

Common forms 1

Onedimensional state tables 1.1

Twodimensional state tables 1.2

Other forms 2

Example 3

Transformations from/to state diagram 4

See also 5

References 6

Further reading 7
Common forms
Onedimensional state tables
Also called characteristic tables, singledimension state tables are much more like truth tables than the twodimensional versions. Inputs are usually placed on the left, and separated from the outputs, which are on the right. The outputs will represent the next state of the machine. A simple example of a state machine with two states and two combinational inputs follows:
A

B

Current State

Next State

Output

0

0

S_{1}

S_{2}

1

0

0

S_{2}

S_{1}

0

0

1

S_{1}

S_{2}

0

0

1

S_{2}

S_{2}

1

1

0

S_{1}

S_{1}

1

1

0

S_{2}

S_{1}

1

1

1

S_{1}

S_{1}

1

1

1

S_{2}

S_{2}

0

S_{1} and S_{2} would most likely represent the single bits 0 and 1, since a single bit can only have two states.
Twodimensional state tables
State transition tables are typically twodimensional tables. There are two common forms for arranging them.

The vertical (or horizontal) dimension indicates current states, the horizontal (or vertical) dimension indicates events, and the cells (row/column intersections) in the table contain the next state if an event happens (and possibly the action linked to this state transition).
State Transition Table
Events
State

E_{1}

E_{2}

...

E_{n}

S_{1}



A_{y}/S_{j}

...



S_{2}





...

A_{x}/S_{i}

...

...

...

...

...

S_{m}

A_{z}/S_{k}



...



(S: state, E: event, A: action, : illegal transition)

The vertical (or horizontal) dimension indicates current states, the horizontal (or vertical) dimension indicates next states, and the row/column intersections contain the event which will lead to a particular next state.
State Transition Table
next
current

S_{1}

S_{2}

...

S_{m}

S_{1}





...

A_{x}/E_{i}

S_{2}

A_{y}/E_{j}



...



...

...

...

...

...

S_{m}



A_{z}/E_{k}

...



(S: state, E: event, A: action, : impossible transition)
Other forms
Simultaneous transitions in multiple finite state machines can be shown in what is effectively an ndimensional state transition table in which pairs of rows map (sets of) current states to next states.^{[1]} This is an alternative to representing communication between separate, interdependent state machines.
At the other extreme, separate tables have been used for each of the transitions within a single state machine: "AND/OR tables"^{[2]} are similar to incomplete decision tables in which the decision for the rules which are present is implicitly the activation of the associated transition.
Example
An example of a state transition table for a machine M together with the corresponding state diagram is given below.
State Transition Table
Input
State

1

0

S_{1}

S_{1}

S_{2}

S_{2}

S_{2}

S_{1}



State Diagram

All the possible inputs to the machine are enumerated across the columns of the table. All the possible states are enumerated across the rows. From the state transition table given above, it is easy to see that if the machine is in S_{1} (the first row), and the next input is character 1, the machine will stay in S_{1}. If a character 0 arrives, the machine will transition to S_{2} as can be seen from the second column. In the diagram this is denoted by the arrow from S_{1} to S_{2} labeled with a 0.
For a nondeterministic finite automaton (NFA), a new input may cause the machine to be in more than one state, hence its nondeterminism. This is denoted in a state transition table by a pair of curly braces { } with the set of all target states between them. An example is given below.
State Transition Table for an NFA
Input
State

1

0

ε

S_{1}

S_{1}

{ S_{2}, S_{3} }

Φ

S_{2}

S_{2}

S_{1}

Φ

S_{3}

S_{2}

S_{1}

S_{1}

Here, a nondeterministic machine in the state S_{1} reading an input of 0 will cause it to be in two states at the same time, the states S_{2} and S_{3}. The last column defines the legal transition of states of the special character, ε. This special character allows the NFA to move to a different state when given no input. In state S_{3}, the NFA may move to S_{1} without consuming an input character. The two cases above make the finite automaton described nondeterministic.
Transformations from/to state diagram
It is possible to draw a state diagram from the table. A sequence of easy to follow steps is given below:

Draw the circles to represent the states given.

For each of the states, scan across the corresponding row and draw an arrow to the destination state(s). There can be multiple arrows for an input character if the automaton is an NFA.

Designate a state as the start state. The start state is given in the formal definition of the automaton.

Designate one or more states as accept state. This is also given in the formal definition.
See also
References

^ Breen, Michael (2005), "Experience of using a lightweight formal specification method for a commercial embedded system product line" (PDF), Requirements Engineering Journal 10 (2),

^ Leveson, Nancy; Heimdahl, Mats Per Erik; Hildreth, Holly; Reese, Jon Damon (1994), "Requirements Specification for ProcessControl Systems" (PDF), IEEE Transactions on Software Engineering 20 (9),
Further reading

Michael Sipser: Introduction to the Theory of Computation. PWS Publishing Co., Boston 1997 ISBN 053494728X
This article was sourced from Creative Commons AttributionShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, EGovernment Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a nonprofit organization.