Top Banner
Finite State Machine By : Ali Mustafa
25

Finite State Machine - Digital Logic Design (EEE 241)

Mar 20, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Finite State Machine - Digital Logic Design (EEE 241)

Finite State Machine

By : Ali Mustafa

Page 2: Finite State Machine - Digital Logic Design (EEE 241)

So Far

• We have covered the memory elements issue and we are ready to implement the sequential circuits.

• We need to know how to Deal(analyze) with a sequential circuit?

Page 3: Finite State Machine - Digital Logic Design (EEE 241)

How could you describe circuit?

• Truth table• Logic function between input and output

F = A+B => if A= 1 and B= 0 F= 1if A =0 and B=0 F=0

(not depends on the pervious value of F)

How could you describe a sequential circuit?

• The sequential circuit output is now function in the inputs and past outputs

• So, we need a tool to help us describe the behavior of the circuit.

Page 4: Finite State Machine - Digital Logic Design (EEE 241)

Finite State Machine (FSM)

• Finite State Machine is a tool to model the desired behavior of a sequential system.

• The designer has to develop a finite state model of the system behavior and then designs a circuit that implements this model.

• A FSM consists of several states. Inputs into the machine are combined with the current state of the machine to determine the new state or next state of the machine.

• Depending on the state of the machine, outputs are generated based on either the state or the state and inputs of the machine.

Page 5: Finite State Machine - Digital Logic Design (EEE 241)

How to describe FSM?

1. State equation ( transition equation )

– input variables, present states, next states equation

2. State table

– input variables, present states ,next states, truth table

3. State diagram

Page 6: Finite State Machine - Digital Logic Design (EEE 241)

State tables• Table is another way to represent an FSM with an emphasis

on exploring all Event/State combinations

• Similar to the truth table

• Doesn’t contain the system clock when specifying its transitions (it is implicit that transitions occur only when allowed by clock)

• Unless different stated, all the transitions are occurring on the positive edge of the clock

Page 7: Finite State Machine - Digital Logic Design (EEE 241)

Design of Sequential Circuits

The procedure of designing synchronous sequential circuits can be summarized as follows:

1. From the word description and specs of the desired operation, derive a state diagram for the circuit

2. Assign binary values to the states.

3. Obtain the binary-coded state table

4. Choose the type of flip-flops to be used.

5. Derive the simplified flip-flop input and output equations.

6. Draw the logic diagram.

Page 8: Finite State Machine - Digital Logic Design (EEE 241)

State Transition Diagrams• Used to visually represent any Finite State Machine

• Emphasis is on identifying states and possible transitions

Circles represent States

Arrows represent Transitions

Page 9: Finite State Machine - Digital Logic Design (EEE 241)

Example

• Using T-type FFs, design a 3-bits binary counter that can count in binary from 0 to 7 with step 1

Page 10: Finite State Machine - Digital Logic Design (EEE 241)

1-Derive the state diagram

• As we need a 3 binary bits to represent the numbers from 0 to 7so we need 1 T-FF to generate 1binary bit

• We need 3 T-FF to implement this design

Page 11: Finite State Machine - Digital Logic Design (EEE 241)

2-Derive state table

Page 12: Finite State Machine - Digital Logic Design (EEE 241)

K-map for the FF output equations

Page 13: Finite State Machine - Digital Logic Design (EEE 241)

Draw Circuit logic diagram

Page 14: Finite State Machine - Digital Logic Design (EEE 241)

Analysis with D Flip Flop : Circuit, State Diagram, State Table

Input Equation = DA = A ɸ x ɸ y

Page 15: Finite State Machine - Digital Logic Design (EEE 241)

Example 1: Circuit, State Diagram, State Table

Page 16: Finite State Machine - Digital Logic Design (EEE 241)

Example 1: State Equation

• A(t+1) = A(t)x(t) + B(t)x(t)

• B(t+1) = A’(t)x(t)

• Y(t) = *A(t) + B(t)+x’(t)

Page 17: Finite State Machine - Digital Logic Design (EEE 241)

Example 2: Analysis with T Flip Flop

Characteristic equation of T is

Q(t+1) = T ɸ Q = T’Q + TQ’

Output Equation will be

TA = BX

TB = X

Y = ABNOTE : ɸ is exclusive

Page 18: Finite State Machine - Digital Logic Design (EEE 241)

Example 2: Analysis with T Flip Flop

Page 19: Finite State Machine - Digital Logic Design (EEE 241)

Types of State Machines

• Mealy Model for FSM

– Characterized by – Outputs are a function of both inputs and current state

Next

State

Logic

Output

Logic

State

Memory

(F/F)

CLOCK

Inputs Excitation

Current

StateOutputs

Page 20: Finite State Machine - Digital Logic Design (EEE 241)

Types of State Machines

• Moore Model for FSM

– Characterized by – Outputs are a function current state only

Next

State

Logic

Output

Logic

State

Memory

(F/F)

CLOCK

Inputs Excitation

Current

StateOutputs

Page 21: Finite State Machine - Digital Logic Design (EEE 241)

Problem : Already Discussed• Analyze the following sequential circuit• How to analyze any sequential circuit• You need to know :

– State equation – State diagram– State table

Page 22: Finite State Machine - Digital Logic Design (EEE 241)

Solution: 1-Determine State equation

Page 23: Finite State Machine - Digital Logic Design (EEE 241)

Solution:2-Create State table

Page 24: Finite State Machine - Digital Logic Design (EEE 241)

Solution :3-Construct the state diagram

Page 25: Finite State Machine - Digital Logic Design (EEE 241)

Self Study

1. Analysis of JK Flip Flop

2. Detail study of Mealy & Moore Models