CS E6831  04f   S. H. Unger   9/21/04

NOTES ON MACHINE STRUCTURE AND STATE ASSIGNMENTS.

1. INTRODUCTION
An objective here is to learn how to generate state assignments such
that the output and next-state functions are independent of some of
the input- and/or state-variables.  This is likely to result in
simpler logic.  Another objective is to develop methods for
decomposing sequential machines into interconnections of smaller
machines.

Partition
Given a set of n elements, a partition is a collection of subsets of
that set, such that every member of the set is in EXACTLY one of the
subsets (i.e., no two subsets overlap, and the union of all the
subsets is the complete set of elements).  The subsets of a partition
are called blocks.

Example 1.  given the set of integers from 1 thru 7, we could define a
partition, (14, 235, 67).

A partition corresponds to an equivalence class, since we can consider
that elements in the same block of a partition are equivalent.  In the
example, 1=4, 2=3=5, 6=7.

We will consider partitions of the states of a finite-state sequential machine.

Partitions can be related to partial state assignments, in that a
subset of state variables can be used to distinguish among the blocks
of the partition.
Example 2.  For the flow table below, consider the partition (124, 35, 6).

           X

        0     1     y1   y2

       ----------

   1   3,0   6,1    0    0  

   2   5,0   4,1    0    0

   3   2,1   5,0    0    1

   4   1,0   3,1    0    0

   5   1,1   3,0    0    1

   6   2,1   5,0    1    1

        ---------
We can associate the pair of y-variables y1, y2 with this partition, by assigning states of y1y2 to partition blocks as shown below.

00: 124,

01:  35

11:  6

Look back now at the flow table to observe the y-columns, which
correspond to this (partial) assignment.  So, given the values of y1
and y2, we can determine which block of the partition the state is in.

2. OUTPUT CONSISTENT PARTITION
An output consistent partition is one such that, given the block of
the partition and the input state, the output state is determined.
For the flow table of Example 2 (above), note that the partition (124,
35, 6) meets this specification.  For example, if a state is in the
124 block, and the input is 0, then the output is 0.  If the input is
changed to 1, then the output will change to 1.

3. CLOSED PARTITIONS
A partition p is closed if the block containing the next state is a
function only of the block containing the present state and the input.

Example 3: For the flow table below, (12,34) is closed.  For example,
if the present state is in the 12-block and A=B=1, then the next state
is in the 12-block.  If the block containing the present state is 12
and either A or B =0, then the next-state is in the 34-block.

               AB

        00   01  11  10

        ----------------

    1   3    4    1    4

    2   4    4    2    3

    3   2    1    1    4

    4   1    2    2    4

        ----------------

4. INPUT CONSISTENT PARTITION
A partition p is input consistent if the block of p containing the
next state is independent of the input state.  A partition is
partially input consistent if the block containing the next state is
independent of a proper subset of the input variables.

Example 4;

For the table below, (12, 34) is input consistent.  Given the present
state, the block of (12, 34) containing the next state can be
determined without knowing the input.  If the present state is state-1,
the next state will be in block 34 (regardless of the value of
X), and if the present state is 3, the next state will be in 12.
Note that (12, 34) is also CLOSED, so we need only know the BLOCK of
the current state to determine the BLOCK of the next state.

         X

       0   1

       ------

   1   3   4

   2   4   3

   3   1   1

   4   2   1

        -----
Example 5: For the table below, the partition (12, 34) is NOT closed,
but it IS input consistent.  Depending only on the present state, the
next state will be in either 12 or 34, regardless of the input.

         X

       0   1

       ------

   1   3   4

   2   1   2

   3   3   4

   4   1   1
       -----



Example 6: For the table below, the closed partition (12, 34) is
partially input consistent, since the block containing the next state
is independent of B.  For example, if the present block is in 12, the
next state is in 34 if A=0 and in 12 if A=1, independent of B.
 
               AB

        00   01  11  10

        ----------------

    1   3    4    1    2

    2   4    4    2    2

    3   2    1    1    1

    4   1    2    2    2

        ----------------

5. Operations on partitions
A partition p is greater than or equal to a partition q, p>=q (>= is a
crude symbol for "greater than or equal to".), if every block of q is
included in a block of p.  For example, (1234, 56, 78)>=(13, 24, 5, 6,
78), but (1234, 56, 78) is NOT greater or equal to (124, 356, 78).

The largest partition w such that p>=w and q>=w is referred to as the
greatest lower bound (glb) of p and q, and is written as pxq (as in
ordinary multiplication we omit the x-sign where no confusion would
result and write the glb of p and q as simply pq).  It is not hard to
prove that elements e and f are in the same block of pq iff (if, and
only if) they are in the same block of p AND in the same block of q.
For example, (1234, 56, 78)(13, 245677, 8)=(13, 24, 56, 7, 8).

Given two partitions p and q, p+q is the smallest partition r such
that r>=p and r>=q.  That is, if there is any other partition w such
that w>=p and w>=q, the w>=r.  We also refer to r as the least upper
bound (lub) of p and q.  For example, if p=(12, 34, 56, 78) and

 q=(13, 25, 4, 6, 7, 8),  then p+q=(123456, 78).

It can be shown that i and j are equated under p+q (i.e., i and j are
in the same block of p+q) iff there is a chain of equalities, each
being under p or q, of the form i=i1=i2=...=j

In the preceding example, 1 and 6 are equated by the partition
(123456, 78), even tho neither p nor q equates them.  The chain
involved is 1=2 (under p), 2=5 (q), and 5=6 (p).

REFERENCES

Hartmanis, J., & R. E. Stearns, "Algebraic Structure Theory of
Sequential Machines", Prentice Hall, 1966

Kohavi, Zvi, "Switching and Finite Automata Theory", McGraw-Hill, 2nd
Ed., 1978.