Skills101
← All practice quizzes

Quiz: Mealy and Moore Machines

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

A DFA only says yes or no. Mealy and Moore machines print an output at every step. Learn both definitions, build a remainder-mod-3 Moore machine and a "01" sequence detector as a Mealy machine, and convert each into the other, with Python simulators that check every step.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What is the main difference between a Moore machine and a Mealy machine?

  2. Question 2

    A Moore machine reads an input of length 6. How many output symbols does it produce?

  3. Question 3

    A Mealy machine reads an input of length 6. How many output symbols does it produce?

  4. Question 4

    What does this print?

    delta = {("r0", "0"): "r0", ("r0", "1"): "r1", ("r1", "0"): "r2",
             ("r1", "1"): "r0", ("r2", "0"): "r1", ("r2", "1"): "r2"}
    out = {"r0": "0", "r1": "1", "r2": "2"}
    state, result = "r0", out["r0"]
    for ch in "100":
        state = delta[(state, ch)]
        result += out[state]
    print(result)
    
  5. Question 5

    In a Moore machine diagram, a state labelled q2/1 means:

🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →