Controlling the states in an ASM

The current state is stored in a register (a set of D flip-flops)

The next state is the result of combining the previous state with the inputs lines and status lines of the ASM.

We can draw up a table of current state / inputs / status / next state

**Current
state Next state Condition**

**AB
AB**

0 00 1 01 Z

2 10

1 01 0 00 -

2 10 0 00 -

In state 0 the B flip-flop -> Z

the A flip-flop ->

In state 1 the B flip-flop -> 0

the A flip-flop -> 0

In state 2 the B flip-flop -> 0

the A flip-flop -> 0

We could use a combination of logic gates to generate our new state - but this gets very messy for large numbers of states / inputs.

A
very neat way of solving the problem is to use **table look-up**

Given our present state look it up in a table and read off the new state.

A
**multiplexor** acts as a table look up.

We will need to include the Z input for the 0 state:

Our complete look up table looks like this:

Notice that although state 3 doesn’t exist we make it go to state 0.

Inputs will in general be some combination of logic symbols.

Output signals

There are two standard ways of generating output signals from an ASM.

One way or the other will normally involve less chips.

**Use
one mux chip for each output.**

Feed the current state into the mux. For each of the possible states use the correct inputs to give the desired output signal.

**Use
a decoder chip on the current state.**

159.233 Lecture 8 -