The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+22 votes
2.3k views

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$.

  1. $3$
  2. $4$
  3. $5$
  4. $6$
asked in Theory of Computation by Veteran (59.7k points)
edited by | 2.3k views

3 Answers

+30 votes
Best answer

From above table, we look at next state part

Whenever we reach state $00$ we get output $1$ [at row $1$,row $6$, row $8$], so we have state 00 with output 1

When we reach at state $01$, we get output $0$ [at row $3$, row $5$] and output $1$ [row $7$], so we have two state 01 with output 0, 01 with output 1.

When we reach at state $10$, we get output we get output $0$ [at row $2$, row $4$], so we have state 10 with output 0.

We don't reach at state $11$ [$11$ is not there in next state part], but we have state 11 with don't know (N) output.

If we draw the Moore Machine for above FSM [ from the table: present state x input symbol -> next state ]

It is clear from FSM from state $00$ to reach state $01$ with output $1$ i.e, $01/1$ with need minimum length input 101

Mminimum length of input $=$ length of $101$. That is 3.

answered by Veteran (55.3k points)
edited by
+1
The basic idea here is whenever we are trying to find shortest path from a node A to node B, we will never take cycle (loops) inbetween...
0
Sir I solved this question by looking at it as a mealy machine, not moore. Is that wrong approach?
0
How do we know that the two states A and B have to be considered as a single state in Moore machine?
+2
@Queenia .. No problem , Mealy and Moore are equivalent

@Matrix, You need to go though sequential logic circuits. It is just as 2 variable makes 4 different combinations
+19 votes
A = 0, B = 1, Output = 1 is given only by the second last transition in the table. So, we can go back from here.

Here, the previous state is A = 1, B = 0. So, see which state gives next state as this. (1 char is gone here)

The second and fourth transitions in the table gives this as next state. Previous state of second transition is  A = 0 and B = 1. Lets consider this first (2 chars gone).
The fifth transition gives A = 0 and B = 1 from A = 0, B = 0 which is our given initial state (3 chars). So, we needn't check any other possibility as 3 must be the minimum length of the input string.
answered by Veteran (367k points)
edited by
0 votes

Mealy Machine Approach.

answered by (145 points)
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,148 questions
49,639 answers
163,308 comments
65,807 users