logo

Question detail

A Mealy machine starts in state S. Its transition table is: from S, input 0 leads to T and produces output 1; from S, input 1 leads to S and produces output 0; from T, input 0 leads to S and produces output 0; from T, input 1 leads to T and produces output 1. Trace the input sequence 0110. State the sequence of states visited after each input and the output sequence.

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

Question

Type

practice

Style

Topic

Regular languages

Exam-style question

Try this first

A Mealy machine starts in state S. Its transition table is: from S, input 0 leads to T and produces output 1; from S, input 1 leads to S and produces output 0; from T, input 0 leads to S and produces output 0; from T, input 1 leads to T and produces output 1. Trace the input sequence 0110. State the sequence of states visited after each input and the output sequence.

Model answer

What a good answer should say

  • The machine starts in S.
  • Input 0 takes S to T and produces 1.
  • Input 1 takes T to T and produces 1.
  • Input 0 takes T to S and produces 0.

Explanation

Why this works

The current state must be used before processing each input. Starting at S, the first 0 changes the state to T.

Both following 1 inputs keep the machine in T and produce 1. The final 0 changes T to S and produces 0.

Since this is a Mealy machine, each output is attached to the transition taken.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.