Suppose we want to design a synchronous circuit that processes a string of ’s and ’s. Given a string, it produces another string by replacing the first in any subsequence of consecutive ’s by a . Consider the following example.
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values and . We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables and respectively.
Assume the initial state of the Mealy machine is .
What are the Boolean expressions corresponding to and in terms of and ?
View worked solution
Answer: B
To design the Mealy machine, let us define the meaning of the two states represented by :
- State : The previous input bit was (or we are at the start). We are not currently inside a sequence of consecutive ’s.
- State : The previous input bit was . We are currently inside a sequence of consecutive ’s.
Using this state definition, let us construct the truth table for the next state and the output based on the current state and current input :
| Current State () | Input () | Next State () | Output () |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 (first replaced by ) |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 (subsequent remains ) |
From the truth table, we can derive the Boolean expressions:
- Next State (): is whenever , regardless of .
- Output (): is only when both and .
Thus, the correct expressions are and .
Free practice · Your answers on this page are not saved.
