![]() |
The state description of the sequential system is:
Input: None other than clock.
Functions: Present | Next | Output s(t) | s(t+1) | z(t) A | B | 00 B | C | 01 C | D | 10 D | A | 11 |

Synchronous sequential systems change from the present state to the next state at discrete time intervals defined by a synchronizing clock signal. The state change occurs either on the rising or falling clock edge. The wave form above shows that the state and output changes with each rising clock edge.
Synchronous Systems in VHDL - The VHDL that would correspond
to the above diagram and produce the wave form is given below: Note
that clk'EVENT AND clk='1' means that a change occurred in the clk
signal and the clk signal is '1'.
| ENTITY Mod4 IS
PORT ( clk : IN BIT ; OUTPUT : OUT BIT_VECTOR(1 DOWNTO 0)); END MOD4; ARCHITECTURE behavioral OF MOD4 IS
PROCESS (clk)
-- Present to Next State
IF clk'EVENT AND clk = '1' THEN
PROCESS (nextS) -- present State becomes
next state
END behavioral; |
Synchronous Sequential Systems with Input - Most interesting sequential systems require some external input for control of which state is executed next. Synchronized systems change from the present state to the next state on an active clock. The next state is determined based upon the present state and the input at the the active clock edge.
![]() |
The state description of the sequential system is:
Input: x(t) element of {0,1}
Functions: Present | Next, Output s(t) | Input x(t) | 0 1 A | A,0 B,0 B | C,0 B,0 C | A,0 D,0 D | A,0 A,1 | s(t+1), z(t) |

An example where the input sequence is 1110... illustrates that the system stays in State B as long as in State B and the input remains 1. It is important to note that the input and present state determine the next state. The decision of the next state is made at the moment of the rising clock signal.

| ENTITY DetectSq IS
PORT ( CLK : IN BIT ; X : IN BIT; OUTPUT : OUT BIT); END DetectSq; ARCHITECTURE behavioral OF DetectSq IS
PROCESS (clk)
-- Present to Next State
IF clk'EVENT AND clk = '1' THEN
PROCESS (nextS) -- present State
becomes next state
END behavioral; |
| Unconditional transition from State A to State B, no output. | ![]() |
| Moore machine
Unconditional transition from State A to State B.
|
![]() |
| Moore machine
Conditional transfer from State A to State B when input is 1.
|
![]() |
| Mealy machine
Conditional transfer from State A to State B when input is 1, from A
to A when input is 0.
|
![]() |
![]() |
Input: x(t) element of {0,1}
Output: z(t) element of {0,1} State: s(t) element of {Even, Odd} Initial: s(0) = Even Function: z(t) = 1 if x(0,t) contains odd number of 1's otherwise 0 Present | Next, Output s(t) | Input x(t) | 0 1 Even | Even,0 Odd, 1 Odd | Odd,1 Even,0 | s(t+1), z(t) |
t | 0 1 2 3 4 5 6 7 8 x | 1 0 0 0 1 0 1 1 s | Even Odd Odd Odd Odd Even Even Odd Even z | 0 1 1 1 1 0 0 1 0 |
In the diagram below the output, z=00, 01, 10, 11, etc. is from the Mod-4 counter. When a comparator detects the 11 is output, a bell is rang, otherwise a light is turned on for the other counts. Additional logic determines when the output of the Mod-4 counter is z=11. The counter is unchanged but through its output acts as a controller. Alternatively, the Mod-4 counter could have an additional output that was true when in State D.
![]() |
![]() |
As a non-autonomous example, consider a Mod-4 counter that outputs a control signal true (1) when the count output z =11 and a pushbutton is down (true or 1), other logic of the system rings a bell. Otherwise the bell is silent.
![]() |
![]() |
| Input: PB(t) element of {0,1}
Output: Bell(t) element of {0,1} State: s(t) element of {A, B, C, D} Initial: s(0)=A Functions: Present | Next, Output s(t) | Input PB(t) | 0 1 A | B, 0 B, 0 B | C, 0 C, 0 C | D, 0 D, 0 D | A, 0 A, 1 | s(t+1), Bell(t) |
7.6 Equivalent Sequential Systems and Minimization of the Number of States
The key insight required for minimization is that if, given the same
inputs, two systems produce the same output, the systems are equivalent,
that is one can replace the other. A simplistic example is given in the
following diagram at left where State A and B produce the same output given
the same input, the more complex diagram may be functionally replaced by
the simpler at right.
![]() |
![]() |
Problem 7.15 Page 192 | Input PS| x=0 x=1 a | f,0 b,0 b | d,0 c,0 c | f,0 e,0 d | g,1 a,0 e | d,0 c,0 f | f,1 b,1 g | g,0 h,1 h | g,1 a,0 |NS, Output |
(a,b,c,e), (d,h), (f), (g) 1=(a,b,c,e), 2=(d,h), 3=(f), 4=(g) 1 2 3 4 P1|(a b c e)|(d h)|(f)|(g) x=0| 3 2 3 2 | 4 4 | 3 | 4 x=1| 1 1 1 1 | 1 1 | 1 | 2 1=(a,c), 2=(b,e), 3=(d,h), 4=(f), 5=(g) 1 2 3 4 5 P2|(a c)|(b e)|(d h)|(f)|(g) x=0| 4 4 | 3 3 | 5 5 | | x=1| 2 2 | 1 1 | 1 1 | | 1 2 3 4 5 P3|(a c)|(b e)|(d h)|(f)|(g) x=0| 4 4 | 3 3 | 5 5 | | x=1| 2 2 | 1 1 | 1 1 | | PS|x=0 x=1 a |f,0 b,0 b |d,0 a,0 d |g,1 a,0 f |f,1 b,1 g |g,0 d,1 |
PS|Input x(t) | a b S0| S1,p S2,q S1| S1,r S0,p S2| S1,p S2,s | NS, Output z(t) |
Using the encoding of:
Input: a=0, b=1
|
PS|Input x(t) | 0 1 00| 01,00 10,01 01| 01,10 00,00 10| 01,00 10,11 | NS, Output | z(t) |
The text example of Example 7.19 (page 187) demonstrates the implementation of a Mealy machine, one in which the output depends on the present state and input and can change while in a state of the FSM. The Moore machine differs in that output depends only upon the present state and does not change while in a state but remains fixed until another state is entered. The key difference is that Moore machine outputs change only when the present state changes, on the active clock edge. This has two desirable effects: 1) synchronizing the FSM outputs with the system clock and, 2) output is stable throughout the state.
Unfortunately, Moore machines are also generally more complex, requiring more states since the output cannot vary while in a given state. For example, a Mealy machine can in one state produce output based upon the binary value of two input variables a and b when ab=00, 01, 10, and 11. A Moore machine would require four states, one for ab=00, 01, 10, and 11.
The weakness of pure Mealy machines is they produce output based upon input that can change at any time without regard to the system clock. This undesirable since asynchronous inputs can lead to small or runt pulses on the outputs (the very short 01 output in the first simulation figure below) while the Moore machine guarantees that all outputs will be stable throughout the time between clock pulses.
To combine the simplicity of Mealy with the stability of outputs of the Moore machines we will use Mealy machines but enforce synchronized inputs. The general approach followed in the example at right below, is to assign input x to a signal synchX only when the clock signal is rising. When the present state is changed, the outputs are computed based upon the present state and the synchronized input.
In the wave form simulation below note the output for the Mealy machine with input that is not synchronized with the clock (asynchronous inputs) leading to a small or runt pulse on the outputs (the very short 01 output) while the Mealy with synchronized inputs or a Moore machine guarantees that all outputs will be stable throughout the time between clock pulses.
One additional artifact of synchronizing inputs is that state
changes are delayed by one clock after the inputs change. This is
due to the one active clock required to synchronize the input. The next
clock has the synchronized input for the state change. This is particularly
noticeable in the last simulation where the synchronized version stays
longer in state S0 because of the one clock delay. This form will be generally
used in this class due to its relative clarity of presentation.
PS|Input x(t) | 0 1 S0| S0,00 S1,00 S1| S2,01 S3,10 S2| S0,10 S1,01 S3| S2,11 S3,11 | NS, Output z(t) |
![]() |
|
||
Mealy Machine with Asynchronous Input x (Example 7.19)
![]() |
||
Mealy Machine with Synchronized Input x (Modified Example 7.19)
![]() |
||
| -- Mealy Machine with synchronized inputs and separate present
and next states
ENTITY synchFSM IS PORT( clk : IN BIT; x : IN BIT; z : OUT BIT_VECTOR(1 DOWNTO 0); END synchFSM; ARCHITECTURE behavioral OF synchFSM IS
PROCESS (nextS)
-- Change present State
|
The preferred implementation is the final example above. It is a Mealy
machine with synchronized inputs and uses separate present
and next state to more clearly distinguish the process of the FSM.
The following example illustrates how the clock can serve to synchronize
inputs. Notice that the x input occurs at any time relative to the
active clock edge but the synchronized x occurs in synchronization
with the clock.
| -- synchronized input
ENTITY synchIN IS PORT( clk : IN BIT; x : IN BIT; synchX : OUT BIT); END synchIN; ARCHITECTURE behavioral OF synchIN IS
|
![]() |