• edited by
343 views
3 3 votes

Consider a sequential circuit that detects the input sequence $\mathbf{101}$ on a serial input line $x$ (one bit per clock cycle) and produces an output $z$ as follows:

  • In a Moore machine implementation, $z=1$ when the circuit is in a state indicating that the previous three bits were $\mathbf{101}$.
     
  • In a Mealy machine implementation, $z=1$ when the current input completes the sequence $\mathbf{101}$.
     

If the input stream is:

$$
x: 0~1~0~1~0~1~0~1
$$
(clocks $t_0$ to $t_7$ ), which of the following is true about the output $z$ in the same clock cycles $t_0$ to $t_7$ ?
 

  1. The Mealy machine output has exactly the same sequence as the Moore machine.
     
  2. The Mealy machine output is the Moore machine output shifted left by $1$ cycle.
     
  3. The Mealy machine output leads the Moore machine output by $1$ cycle.
     
  4. The Moore machine output leads the Mealy machine output by $1$ cycle.

1 Answer

1 1 vote

1. Understanding the detection task

We're detecting the sequence $\mathbf{101}$:

  • Moore machine: Output depends only on the current state.

    So when the sequence $\mathbf{101}$ ends at clock cycle $t$, the output $z=1$ occurs at cycle $t+1$ (because the state after receiving the last bit is the "detected 101" state, and output is associated with that state for the full cycle).
     
  • Mealy machine: Output depends on current state and current input.

    So when the last bit (1) of 101 is read at cycle $t$, output $z=1$ occurs immediately at cycle $t$.
 

2. Input stream and detection times

Input:

$$
t_0: 0, ~t_1: 1, ~t_2: 0, ~t_3: 1, ~t_4: 0, ~t_5: 1, ~t_6: 0, ~t_7: 1
$$


Sequence $\mathbf{101}$ occurs ending at:
 

  • $t_3$ (bits $t_1=1, ~t_2=0, ~t_3=1)$
     
  • $t_5$ (bits $t_3=1, ~t_4=0, ~t_5=1)$
     
  • $t_7$ (bits $t_5=1, ~t_6=0, ~t_7=1)$
     

At $t_3$ : input $=1$ completes $101 \rightarrow z=1$

At $t_5$ : input $=1$ completes $101 \rightarrow z=1$

At $t_7$ : input $=1$ completes $101 \rightarrow z=1$

Else $z=0$.
 

So Mealy output:

$$
t_0: 0, ~t_1: 0, ~t_2: 0, ~t_3: 1, ~t_4: 0, ~t_5: 1, ~t_6: 0, ~t_7: 1
$$


Detection at $t_3 \rightarrow$ output at $t_4$

Detection at $t_5 \rightarrow$ output at $t_6$

Detection at $t_7 \rightarrow$ output at $t_8$ (not in our range $t_0-t_7$, so ignore $t_8$ )

 

So Moore output:

$$
t_0: 0, ~t_1: 0, ~t_2: 0, ~t_3: 0, ~t_4: 1, ~t_5: 0, ~t_6: 1, ~t_7: 0
$$


Mealy: $0~0~0~1~0~1~0~1$

Moore: $0~0~0~0~1~0~1~0$


Observation: Mealy output is Moore output shifted left by $1$ cycle (with last bit different because Moore's last $1$ would be at $t_8$ ).

That matches option C: "The Mealy machine output leads the Moore machine output by $1$ cycle."

Answer:
Position:
Show:

Related questions

5 5 votes
1 1 answer
361
361 views
GO Classes asked Nov 22, 2025
361 views
Define the language:$L=\{\langle M\rangle \mid M \text{ is a TM and there exists an input } w \text{ of length at most 100 such that} ~M \text{ halts on } w\}$.Which of t...
3 3 votes
1 1 answer
394
394 views
GO Classes asked Nov 22, 2025
394 views
Let $L$ be the language over $\Sigma=\{0,1\}$ defined by:$$L=\{w \mid \text { the binary number represented by } w \text { is divisible by } 11\} .$$(Interpret $w$ as a b...
5 5 votes
1 1 answer
272
272 views
GO Classes asked Nov 22, 2025
272 views
Let $G=(\{S, A, B\},\{a, b\}, R, S)$ be a context-free grammar, where the rules $R$ are:$$S \rightarrow a B|b A, \quad A \rightarrow a| a S|b A A, \quad B \rightarrow b| ...
3 3 votes
1 1 answer
325
325 views
GO Classes asked Nov 22, 2025
325 views
Let $G=(\{S\},\{(,)\}, R, S)$ be a context-free grammar, where the set of rules $R$ is$$S \rightarrow(S) S \mid \epsilon$$Which of the following statements is true? $G$ i...