Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
MACHINES
By:
Prof K R Shobha,
M S Ramiah Institute of Technology, Bangalore
EXCITATION
INPUT (E)
VARIABLES
INPUT OUTPUT
LOGIC MEMEORY LOGIC
(f) (g)
CLOCK
Input variable: all the variables that originate outside the sequential machine are said to
be input variables.
Output variables: all the variables that exit the sequential machine are said to be output
variables.
State variable: the output of the memory (flip flops) defines the state of the sequential
machine. Decoded state variables (along with the input variables for a mealy machine )
produce the output variables.
Excitation variable: excitation variables are the inputs to the memory (flip flops). The
name excitation is used because the variable “excites” the memory to change. State
State: the state of the sequential machine is defined by the content of the memory. When
the memory is realized with flip-flops, the machine state is defined as the q outputs. Each
state of the sequential machine is unique and unambiguous. State variables and states are
related by the expression2 x = y where x= number of state variables.(Examples flip-flop )
and y = maximum number of states possible (example: 4 state variables can represent a
maximum of 16 states)
Present state: The status of all state variables, at some time,t, before the next clock edge,
represents a condition called present state. The present state or status of sequential circuit
memory is reference point with respect to time.
Next state: the status of all the state variables. At some time, t+1, represents a condition
called next state. The next state of a sequential machine is represented by the memory
status after a particular clock, t.
State machine represents a system as a set of states, the transitions between them, along
with the associated inputs and outputs. So, a state machine is a particular
conceptualization of a particular sequential circuit. State machines can be used for many
other things beyond logic design and computer architecture
Finite State Machine (FSM) is a special case of a sequential machine, which is just a
computational machine with memory. In FSM terminology, the “state” of the machine is
reflected in the contents of the memory and is used to determine the output of the
machine. In this, finite state machines and other sequential machines differ from simple
combinational circuits in which the output depends only on the input at the time with no
dependence on history or any information stored in memory. In simple, FSM and all
sequential machines have memory and combinational machines do not.
Excess 3 code is a self-complementing BCD code used in decimal arithmetic units. The
truth table above shows that the output code value is three greater than the value of the
input code.
Truth table
t0 t1 t2
t0
t0t1
State diagram
State A is represented with a circle with the letter A inside it. A directed arc connects
state A with state B in this example, the next state can be B or it could change to C,
depending on the input variable. Similarly the other states can be derived by seeing the
procedure indicated in the previous page figure 3.
State tables are the tabular forms of the state diagram. The present state (P.S.) column
lists all of the possible states in the machine. The series of next state columns exist, one
for each input combination. The purpose of the state table is to indicate the state
transition. The fifteen states, one input variable state diagram shown in the above figure 4
is converted to state table shown in figure 5.
Simplified state table.
S0
S1
S2
S3
S4
S5
S6
Figure 6: Simplified state table for BCD to EXCESS-3 converter
Guidelines for reducing the amount of logic required and deriving the
assignment map.
Assignment map : This table assigns binary values to different states depending on the
number of flip flops that are used for implementation.
Rule I. States which have the same next state (NS) for a given input should be given
adjacent assignments (look at the columns of the state table).
Rule III. States which have the same output for a given input should be given adjacent
assignments
I. (1,2) (3,4) (5,6) (in the X=1 column, S1 and S2 both have NS S4;in the X=0 column,
S3 & S4 have NS S5, and S5 & S6 have NS S0)
II. (1,2) (3,4) (5,6) (S1 & S2 are NS of S0; S3 & S4 are NS of S1; and S5 & S6 are NS of
S4)
Excitation table
Once the changes in the flip-flop outputs are known, the next step is to determine the
excitation inputs needed to cause the desired flip-flop output changes. This requires
deciding on the type of flip-flop to be used in realizing the state machine. T and D F/F
require only a single input. But JK and RS flip flop requires two inputs. In this example
we have implemented the code converter using D F/F whose characteristic table is as
shown below in figure 11.
D Present Next
Q Q+
0 0 0
1 0 1
0 1 0
1 1 1
D1 D2 D3
shobha Page 12 08/04/2005
Simplification
Figure 11 of the excitation
: Excitation table
table using using K-MAPs
D-F/F
VHDL code
Figure 12 fortoBCD
: BCD to excess-3
EXCESS-3 converter
code converter
library ieee ;
use ieee.std_logic_1164.all ;
entity SM1_2 is
port(X, CLK: in bit; Z: out bit);
end SM1_2;
architecture Table of SM1_2 is
signal State, Nextstate: integer := 0;
begin
process(State,X) --Combinational Network
begin
case State is
when 0 =>
if X='0' then Z<='1'; Nextstate<=1; end if;
if X='1' then Z<='0'; Nextstate<=2; end if;
when 1 =>
if X='0' then Z<='1'; Nextstate<=3; end if;
if X='1' then Z<='0'; Nextstate<=4; end if;
when 2 =>
if X='0' then Z<='0'; Nextstate<=4; end if;
shobha Page 14 end if;
if X='1' then Z<='1'; Nextstate<=4; 08/04/2005
when 3 =>
if X='0' then Z<='0'; Nextstate<=5; end if;
if X='1' then Z<='1'; Nextstate<=5; end if;
Output waveform for BCD to excess-3 code converter