GATE | GATE-CS-2009 | Question 27
Given the following state table of an FSM with two states A and B, one input and one output:
|
Present
State A |
Present
State B |
Input
|
Next
State A |
Next
State B |
Output
|
|
0
|
0
|
0
|
0
|
0
|
1
|
|
0
|
1
|
0
|
1
|
0
|
0
|
|
1
|
0
|
0
|
0
|
1
|
0
|
|
1
|
1
|
0
|
1
|
0
|
0
|
|
0
|
0
|
1
|
0
|
1
|
0
|
|
0
|
1
|
1
|
0
|
0
|
1
|
|
1
|
0
|
1
|
0
|
1
|
1
|
|
1
|
1
|
1
|
0
|
0
|
1
|
If the initial state is A=0, B=0, what is the minimum length of an input string which will take the machine to the state A=0, B=1 with Output = 1?
(A) 3
(B) 4
(C) 5
(D) 6
Answer: (A)
Explanation: //(0, 0) –1–> (0, 1) –0–>(1, 0) –1–> (0, 1) and output 1
According to the question we have to reach the states A=0, B=1 and output=1. This state is shown by green color. Thus to reach final states as A=0, B=1 and output=1 we have to reach previous states of A=1, B=0. Since initial states are A=0,B=0 (red); we provide input=1 (to reach A=0,B=1) Now this will give present states as A=0, B=1 and output=0. Now we provide (blue) input=0 (to reach A=1,B=0) with present states as A=0, B=1.
The present states will become A=1, B=0 and output=0. This is what is required. On providing input=1 we get final states as A=0, B=1 and output=1.
Hence an input string of 3 i.e. 101 leads to the desired output and states.
This solution is contributed by Kriti Kushwaha
Quiz of this Question
Recommended Posts:
- GATE | GATE-CS-2015 (Mock Test) | Question 17
- GATE | GATE-CS-2015 (Mock Test) | Question 16
- GATE | GATE-CS-2015 (Mock Test) | Question 2
- GATE | GATE-CS-2015 (Mock Test) | Question 17
- GATE | GATE-CS-2015 (Mock Test) | Question 4
- GATE | GATE-CS-2015 (Mock Test) | Question 5
- GATE | GATE-CS-2015 (Mock Test) | Question 10
- GATE | GATE-CS-2015 (Mock Test) | Question 10
- GATE | GATE-CS-2015 (Mock Test) | Question 8
- GATE | GATE-CS-2015 (Mock Test) | Question 9
- GATE | GATE-CS-2015 (Mock Test) | Question 10
- GATE | GATE-CS-2015 (Mock Test) | Question 11
- GATE | GATE-CS-2015 (Mock Test) | Question 17
- GATE | GATE-CS-2015 (Mock Test) | Question 13
- GATE | GATE-CS-2015 (Mock Test) | Question 14


