IAE Academy

GATE 2020 EC Q.39: solution and answer

GATE 2020 · ECQ.39 · 2 marks · MCQ

The state diagram of a sequence detector is shown below. State is the initial state of the sequence detector. If the output is 1, then

GATE 2020 EC question 39: Mealy state diagram with five states S0, S1, S2, S3, S4.Tap to open full size
Figure from the GATE 2020 EC paper. It is part of the question.
Figure description

Mealy state diagram with five states S0, S1, S2, S3, S4. S0, S1, S2 and S3 sit in a row from left to right, and S4 sits below, between S2 and S3. Each edge is labelled input/output. Edges: S0 has a self-loop labelled 1/0; S0 -> S1 labelled 0/0; S1 has a self-loop labelled 0/0; S1 -> S2 labelled 1/0; S2 -> S3 labelled 0/0; S2 -> S0 labelled 1/0 (a curve running under the row back to S0); S3 -> S1 labelled 0/0 (a curve running over the top from S3 back to S1); S3 -> S4 labelled 1/0; S4 -> S3 labelled 0/1 (a curve from the lower-right side of S4 up to the lower-right of S3); S4 -> S0 labelled 1/0 (a long curve along the bottom back to S0).

  1. (A)

    the sequence 01010 is detected.

  2. (B)

    the sequence 01011 is detected.

  3. (C)

    the sequence 01110 is detected.

  4. (D)

    the sequence 01001 is detected.

Answer and solution

ANSWER

(A): the output is 1 when the sequence 01010 is detected.

Official answer: ASource: Official answer key, GATE 2020 EC (IIT Delhi)

  1. This is a Mealy machine. Each edge is labelled input/output, so the output depends on both the present state and the present input.

  2. Find the only edge whose output is 1. It is , so the output is 1 only when the input is 0 while the machine is in .

  3. Trace the route from into : . The machine can enter only from on a 1, and it can enter only on a 0 (from or from ), so the last four inputs before reaching are always .

  4. Add the final input 0 taken from . The sequence that makes the output 1 is , which is 01010.

  5. Check the other options by tracing each one from . (B) 01011: , then the input 1 takes , so the output is 0.

  6. (C) 01110: , then the input 1 takes , the next 1 keeps it in (self-loop), and the final 0 takes it to . The output is 0 throughout.

  7. (D) 01001: , then the input 0 takes and the input 1 takes . The output is 0 throughout.

  8. After a detection the machine goes to , the state that means "010 received". The last three bits of 01010 are 010, so this is an overlapping detector. For example, 0101010 gives output 1 at bit 5 and again at bit 7.

KEY IDEA

In a Mealy diagram, find the one edge that outputs 1 (). The detected sequence is the input path from into (0101) followed by that edge's input (0), which gives 01010.

WATCH OUT FOR

Reading the machine as Moore and taking the sequence that merely reaches (0101), then picking 01011 because it also passes through . In a Mealy machine the 1 is produced on the transition , so the last bit must be 0. A 1 from resets the machine to with output 0.

From the GATE 2020 EC paper. Every question of this paper · Download the full paper · All 30 Sequential questions, with notes

More Sequential questions