Finite State Machine (FSM) Model of behaviour composed of a finite - - PowerPoint PPT Presentation

finite state machine fsm
SMART_READER_LITE
LIVE PREVIEW

Finite State Machine (FSM) Model of behaviour composed of a finite - - PowerPoint PPT Presentation

Finite State Machine (FSM) Model of behaviour composed of a finite number of states, input events, transitions between those states (rules or conditions), and actions. Inputs State conditionA S1 S0 / / !conditionB !conditionA value1


slide-1
SLIDE 1
slide-2
SLIDE 2

Finite State Machine (FSM)

  • Model of behaviour composed of a finite number of states,

input events, transitions between those states (rules or conditions), and actions.

conditionA Inputs State Outputs conditionB !conditionA !conditionB / value0 S0 / value1 S1

slide-3
SLIDE 3

Sequential systems

  • Sequential systems are synchronous, i.e. makes

use of a clock

  • Outputs are dependent on earlier and the current

state of inputs

Q clk D

Comb. logic

Synchronous logic Feedback / Sequential logic Outputs Inputs next current

slide-4
SLIDE 4

Finite State Machines in HW

  • Requires registers to store the current state, a block of

combinational logic to determine the next state (transition), and a block of combinational logic to determine the output of the FSM

NEXT STATE LOGIC STATE MEMORY OUTPUT LOGIC OUTPUTS CLK INPUTS CURRENT STATE (MEALY ONLY)

slide-5
SLIDE 5

Moore Machine

  • Outputs are a function of the current state only
  • Outputs are synchronous to the clock
  • Propagation delay through output logic may nevertheless

lead to hazards (glitches)

  • A Moore machine has a one clock period delay from input

to output.

NEXT STATE LOGIC STATE MEMORY OUTPUT LOGIC OUTPUTS CLK INPUTS CURRENT STATE

slide-6
SLIDE 6

Mealy Machine

  • Outputs are a function of the current state and the inputs
  • Outputs change immediately when the input change*

– Combinational path through FSM

  • Outputs of mealy machine is one clock cycle ahead of a Moore Machine (faster)
  • But has more complicated decoding of outputs

NEXT STATE LOGIC STATE MEMORY OUTPUT LOGIC OUTPUTS CLK INPUTS CURRENT STATE

*In an FPGA it is generally recommended to synchronize all signals to the system clock. I.e., it is expected that the inputs are synchronous to the same clock as the state memory. Essentially the outputs of a Mealy machine are therefore also synchronous to the clock. The main difference is that the output changes one clock cycle ahead of the current state, and therefore the Moore machine.

slide-7
SLIDE 7

Description of state machines

  • State diagrams
  • ASM diagram
  • State table

Graphic representation

  • f state machine
slide-8
SLIDE 8

State graph/diagram Moore

sS0/

value0

sS1/

value1

conditionA Inputs State conditionB !conditionA !conditionB Outputs

slide-9
SLIDE 9

State graph/diagram Mealy

sS0 sS1

conditionA / value1 Inputs State Outputs conditionB / value0 !conditionA / value0 !conditionB / value1

slide-10
SLIDE 10

ASM

condition

State box Decision box Conditional output box

false true

  • The state box represents the state in the FSM with a list of outputs values that are

assigned when entering the state.

  • The decision box checks input condition to determine exit path of current ASM block
  • A conditional output box lists output assignments that should take place when exiting

the state (Mealy outputs). Can only be placed after exit path of decision box.

slide-11
SLIDE 11

ASM

condition condition

State entry State exit State entry State exit ASM block ASM block

false true false true

  • Unique exit path for a given combination of inputs
  • Exit path of ASM block must always lead to state box.
slide-12
SLIDE 12

ASM diagram Moore

conditionA conditionB

True True False False

slide-13
SLIDE 13

ASM diagram Mealy

conditionA conditionB

True True False False

slide-14
SLIDE 14

State table Moore

Current state next state next state Current

  • utput

condiationA !conditionA conditionB !conditionB S0 S1 S0

  • value0

S1

  • S0

S1 value1

slide-15
SLIDE 15

State table Mealy

Current state conditionA !conditionA conditionB !conditionB

next state

  • utput

next state

  • utput

next state

  • utput

next state

  • utput

S0 S1 value1 S0 value0

  • S1
  • S0

value0 S1 value1