topic : types of fsm

14
Module : FSM Topic : types of FSM

Upload: warren-hines

Post on 01-Jan-2016

35 views

Category:

Documents


0 download

DESCRIPTION

Topic : types of FSM. Module : FSM. Two types of FSM. The instant of transition from the present to the next can be completely controlled by a clock; additionally, changes in the inputs may also dictate such transitions. FSMs can be broadly classified into two categories – - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Topic : types of FSM

Module : FSM

Topic : types of FSM

Page 2: Topic : types of FSM

Two types of FSM

The instant of transition from the present to the next can be completely controlled by a clock; additionally, changes in the inputs may also dictate such transitions. FSMs can be broadly classified into two categories –

Moore machines and Mealy machines.

Page 3: Topic : types of FSM

Moore machine

Two aspects characterizes Moore machine :Next state of the output is decided fully by

the present state.All changes in the output are brought about

only at the active edge of the clock. Hence the Moore machine is inherently synchronous.

Edge-triggered flip flops, synchronous counters , etc, are typical example of Moore machines.

Moore machine are also known as synchronous machine.

Page 4: Topic : types of FSM

Generate a state diagram from the problem statement.

Minimize the number of statesSelect a binary encoding for the states.Generate an encoded state table.Select the memory device – T flip-flop or D

flip-flopGenerate a next-state K map for each

memory device.Generate a K map for each output.Implement memory and combinational

logic using PLAs or other devices.

Page 5: Topic : types of FSM

Example of sequence detector

A sequence generator is to sequence through eight distinct states. The states are represented by a set of four binary variables – W, X, Y and Z. the states and the sequence are as follows ( the 4 bits represent values of W, X, Y and Z, respectively) :1000 1100 0100 0110 0010 0011 0001 1001 1000 …

Each transition is to take place at the positive edge of the clock. Since the scheme has no external primary input to affect the output, it is realized as a Moore machine.

Page 6: Topic : types of FSM

Example 1 : solution

A 3-bit state machine suffices to generate the eight independent states specified.

Continued to next page….

Page 7: Topic : types of FSM
Page 8: Topic : types of FSM

Test Bench

Page 9: Topic : types of FSM

Mealy Machine

Mealy machine differs from the Moore machine at the output stage.

The inputs can affect the outputs directly in Mealy Machine.

The changes in the input reflect as corresponding changes in the outputs without the clock being directly involved : to that extent the behavior is asynchronous.

Counters with asynchronous preset and clear and shift registers with preset are examples of Mealy machines.

A Mealy machine has to respond to changes in input in addition to the response to the active edges of the clock.

Page 10: Topic : types of FSM

Example of Mealy machine

A sequence generator is to have four binary outputs designated W, X, Y, and Z. they are to follow either of two sequences depending on the value of a Boolean variable A:

If A = 0, the sequence to be followed is 1000 1100 0100 0110 0010 0011

0001 1001 1000 …where, W is the most significant bit and Z the least significant bit.

If A=1, the sequence to be followed is : 1001 0001 0011 0010 0110 0100 1100 1000 1001 ….

Page 11: Topic : types of FSM

Example 2 : Solution

Page 12: Topic : types of FSM
Page 13: Topic : types of FSM

Example 2 : Solution

Page 14: Topic : types of FSM

Diagram for Moore & mealy machine

Moore machine Mealy machine