Open In App

GATE | GATE-CS-2009 | Question 27

Like Article
Like
Save
Share
Report

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.  

 



Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 11 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads