Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.

Similar presentations


Presentation on theme: "COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University."— Presentation transcript:

1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University pursuant to Part VB of the Copyright Act 1968 (the Act). The material in this communication may be subject to copyright under the Act. Any further reproduction or communication of this material by you may be the subject of copyright protection under the Act. Do not remove this notice.

2 Mealy and Moore Machines CSE2303 Formal Methods I Lecture 8

3 Overview Moore Machines Mealy Machines Sequential Circuits

4 A Moore Machine q 0 /1 q 1 /0 q 2 /0 q 3 /1 a a a bb b a,b

5 Definition of a Moore Machine A finite set of states –q 0, q 1, q 2, etc. –q 0 is the start state Alphabet of input letters Alphabet of output letters Transitions –A unique one for each letter and each state Output Table –A letter for each state

6 Moore Machine for aba q 3 /1 aab a b b a,b q 0 /0q 1 /0q 2 /0 q 4 /0

7 Defining a Language To change a FA into a Moore machine which accepts the same language –Name each state –Name the Start state q 0 –Output 0 in all non-final states –Output 1 in all Final states. A string is accepted if after it has been completed read in the last letter printed is 1.

8 A Mealy Machine q0q0 q1q1 q2q2 b/0 a/0 a/1 a/1, b/1 b/0

9 Definition of a Mealy Machine A finite set of states –q 0, q 1, q 2, etc. –q 0 is the start state Alphabet of input letters Alphabet of output letters Transitions –A unique one for each letter and each state –Each transition also has one output letter

10 Equivalence of Machines Every Moore machine can be turned into a Mealy machine. Every Mealy machine can be turned into a Moore machine. Every regular language can be defined by Moore machine or a Mealy machine. All languages defined by a Moore machine or a Mealy machine are regular.

11 Sequential Circuits The output depends on the sequence of past inputs. The circuits consist of –a logic gates i.e. AND, OR, NOT, NAND, NOR –storage elements i.e. flip-flops, latches.

12 Clocked Synchronous Sequential Circuits Clocked –Means all the flip-flops employ a clock input. Synchronous –Means all the flip-flops use the same clock signal. These circuits only change state when a triggering edge or “tick” occurs on the clock signal.

13 Logic Gates AND NOT OR A B A B A

14 D Flip-Flop Stores one bit of information new value of Q = old value of D Q* = D DQ Q CLK NOT Q

15 Moore Circuit Next State Logic Circuit State Memory Output Logic Circuit clock input clock signal input output

16 Moore Machine q 0 /1 q 1 /0 q 2 /0 q 3 /1 a a a bb b a,b

17 Mealy Circuit Next State Logic Circuit State Memory Output Logic Circuit clock input clock signal input output

18 Mealy Machine q0q0 q1q1 q2q2 b/0 a/0 a/1 a/1, b/1 b/0

19 IN AND OUT OR D 1 = IN D 2 = IN OR ((Q 1 AND Q 2 ) OR (NOT Q 2 )) OUT = Q 1 AND Q 2 Q 1 * = D 1 Q 2 * = D 2 D2D2 clock signal OR D1D1 Q1Q1 Q2Q2 Q2Q2

20 D 1 = IN D 2 = IN OR ((Q 1 AND Q 2 ) OR (NOT Q 2 )) OUT = Q 1 AND Q 2 Q 1 * = D 1 Q 2 * = D 2

21

22 q0q0 q3q3 q2q2 q1q1 0/0 1/0 0/11/0 0/0 1/0 0/0 1/1

23 q0q0 q1q1 q2q2 1/0 0/0 0/1 0/1, 1/1 1/0 Exercise Find the corresponding sequential circuit for the following Mealy Machine.

24 q0q0 q1q1 q2q2 1/0 0/0 0/1 0/1, 1/1 1/0 Choose an unique binary code for each state.

25 q0q0 q1q1 q2q2 1/0 0/0 0/1 0/1, 1/1 1/0 Choose an unique binary code for each state.

26 A * = (  A   B  IN )  (A   B  IN ) B * = (A  B   IN )  (  A  B   IN ) OUT = (  A   B   IN )  (  A  B  IN )  (  A  B   IN )

27 A * = IN  (  B ) B * =  A * OUT = (  A )  (  IN  B )

28 A*A* A AND IN AND OUT Delay NOT Delay B B*B* NOT OR NOT A * = IN  (  B ) B * =  A * OUT = (  A )  (  IN  B )

29 Preparation Read –Chapters 12 of the Text BookRevision Know what the following machines are and how to use them. Moore Machine Mealy Machine Be able to find the equations for a sequential circuit corresponding to a Mealy machine.


Download ppt "COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University."

Similar presentations


Ads by Google