Skip to content
Official PYQ · 2002

GATE CS 2002 Q2.5 — Regular Expressions and Finite Automata

Explain with AI

The finite state machine described by the following state diagram with AA as starting state, where an arc label is x/y,x/y, and xx stands for 11-bit input and yy stands for 22-bit output

Choose one option
View worked solution

Answer: A

Let us analyze the behavior of the finite state machine by interpreting the states as memory of the previous input bit:

  • State AA: Represents that the previous input bit was 00 (or we are at the start).
  • State BB: Represents that the previous input bit was 11.

Now, let's look at the transitions and their outputs (represented as x/yx/y, where xx is the input and yy is the 2-bit binary output):

  • From state AA (previous bit =0= 0):
    • On input 00: Transition to AA, output is 0000 (since present+previous=0+0=0\text{present} + \text{previous} = 0 + 0 = 0).
    • On input 11: Transition to BB, output is 0101 (since present+previous=1+0=1\text{present} + \text{previous} = 1 + 0 = 1).
  • From state BB (previous bit =1= 1):
    • On input 00: Transition to AA, output is 0101 (since present+previous=0+1=1\text{present} + \text{previous} = 0 + 1 = 1).
    • On input 11: Transition to BB, output is 1010 (since present+previous=1+1=2\text{present} + \text{previous} = 1 + 1 = 2).

In all cases, the 2-bit output yy is the binary representation of the sum of the present input bit and the previous input bit. Thus, option (A) is correct.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions