mealy and moore machines

10
Finite State Revisited A model of computation

Upload: grahamwell

Post on 01-Dec-2014

3.074 views

Category:

Education


11 download

DESCRIPTION

Exercises for the Finite State Machine unit

TRANSCRIPT

Page 1: Mealy and moore machines

Finite State Revisited

A model of computation

Page 2: Mealy and moore machines

What can a computer do?• Models of computation strip specific

approaches down to a logical core– Computable– Not Computable

• Finite state machines are a simplified, idealised model of a computing machine.

• Add permanent storage and you have a Turing machine, the simplest general computer

Page 3: Mealy and moore machines

Three types of FSM

• Without output (answer true or false)1.Finite State Automata• With output2.Mealy machine (output on transition)3.Moore machine (output on state)

Page 4: Mealy and moore machines

Software

Page 5: Mealy and moore machines

Mealy and Moore

• Both have:– No final state– Produce output from an input string– No non-determinism

• Mealy machines produce output on transition

• Moore machines produce output on state

Page 6: Mealy and moore machines

Challenge 1

• Mealy machine that inverts the input.• ie: if given 01101 outputs 10010

Page 7: Mealy and moore machines

Challenge 2

• Mealy machine that divides by 2• Ie: if given 0101 will give 0010

Page 8: Mealy and moore machines

Challenge 3

• A Moore machine that inverts the input

Page 9: Mealy and moore machines

Challenge 4

• Mealy Vending Machine• 5p, 10p, 20p – vends sweets at 15p –

gives change.

Page 10: Mealy and moore machines

Challenge 5

• Moore machine to divide a binary number by 2