lecture 5.ppt by 5th SEM LPU Lecture PPT

abcxyz19691969 31 views 52 slides Oct 07, 2024
Slide 1
Slide 1 of 52
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52

About This Presentation

CSe 322


Slide Content

CSE322
Mealy and Moore Machine
Lecture #4

Null Transition
•An NFA with null transition is allowed to make
transition not only on input from the alphabet
but also with null input, i.e. without any input
symbol. This transition without input is called
null transition.

Null Transition

Null Transition

1
q
2
q
3q
a
a
a
0q
Language accepted: }{aaL

Lambda Transitions
1
q
3
qa
0
q 
2
qa

aa
1
q
3
qa
0
q 
2
qa

aa
1
q
3
qa
0
q 
2
qa

aa
1
q
3
qa
0
q 
2
qa
(read head does not move)

aa
1
q
3
qa
0
q 
2
qa

aa
1
q
3
qa
0
q 
2
qa
“accept”
String is accepted
aa
all input is consumed

aa
1
q
3
qa
0
q 
2
qa
Rejection Example
a

aa
1
q
3
qa
0
q 
2
qa
a

aa
1
q
3
qa
0
q 
2
qa
(read head doesn’t move)
a

aa
1
q
3
qa
0
q 
2
qa
a
No transition:
the automaton hangs

aa
1
q
3
qa
0
q 
2
qa
“reject”
String is rejected
aaa
a
Input cannot be consumed

Language accepted: }{aaL
1
q
3
qa
0
q 
2
qa

Another NFA Example
0q 1q
2qa b 

3
q

How to accept a string

How to accept a string

ab
0q 1q
2qa b 

3
q

0q 2qa b 

3
q
ab
1
q

ab
0q 1q a b 

3
q
2
q

ab
0q 1q a b 

3
q
2
q
“accept”

0q
a b 

ab
Another String
ab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

0q
a b 

abab
1
q
2
q
3
q

abab
0q
a b 

1
q
2
q
3
q
“accept”

 




ab
ababababababL ...,,,
Language accepted
0q 1q
2qa b 

3
q

Another NFA Example
0
q 1
q
2
q
0
1
1,0

{ }
{}*10=
...,101010,1010,10,λ=)(ML
0
q 1
q
2
q
0
1
1,0

Language accepted
(redundant
state)

In finite Automata acceptability was decided on the basis of reach
ability of the final state by initial state.
This restriction are removed and new model is given in which
output can be chosen from some other alphabet.
The value of the output function Z(t) is a function of present state
q(t) and the present input x(t)
 Z(t) = λ(q(t), x(t)) Mealy Machine
 The value of the output function Z(t) is a function of present state
q(t) only and is independent of the current input
 Z(t) = λ(q(t)) Moore Machine
Mealy and Moore Model

Moore Machine is six-tuple (Q,∑,∆,δ,λ,q
0
):
(i)Q is a finite set of states
(ii)∑ is the input alphabet
(iii)∆ is the output alphabet
(iv)δ is the transition function from ∑ X Q into Q
(v)λ is the output function mapping Q into ∆ and
(vi) q
0 is the initial state
Moore Machine

Mealy Machine is six-tuple (Q,∑,∆,δ,λ,q
0
):
(i)Q is a finite set of states
(ii)∑ is the input alphabet
(iii)∆ is the output alphabet
(iv)δ is the transition function from ∑ X Q into Q
(v)λ is the output function mapping ∑ X Q into ∆ and
(vi) q
0 is the initial state
Mealy Machine

Example of Moore Machine

Example of Mealy Machine

Transforming Mealy to Moore Machine

Solution

Transforming Moore to Mealy Machine

Solution

Solution

Answer Justification
•Here there is no output associated with q1 so,
It will be ^.
•q2 is associated with 2 outputs z1 and z2 so 2
states will be considered q21,q22.
•q3 is associated with 2 outputs z1 and z2 so 2
states will be considered q31,q32

Answer

Solution

Convert it to Moore Machine

Convert it to mealy machine
Tags