HDL & Verification

What characterizes a Mealy state machine?

  1. AOutputs depend only on the state and do not change until the next clock
  2. BOutputs depend on both current state and inputs, so input changes appear at the output within the same cycle
  3. CIt is combinational logic with no state
Show answer and explanation

Answer: B. Outputs depend on both current state and inputs, so input changes appear at the output within the same cycle

In a Mealy machine the output logic looks at inputs as well as the current state, so outputs change with inputs without waiting for a clock, reacting one cycle sooner. It may also need fewer states. But a combinational path runs from inputs to outputs, so input glitches can appear at outputs and timing paths get longer. Outputs are sometimes re-registered through flip-flops.

  • A. That describes a Moore machine.
  • B. Correct. It reacts faster but passes input glitches to outputs more easily.
  • C. It is sequential logic with state.
Practice this topic Back to topic

More HDL & Verification questions

  1. What is a characteristic of one-hot encoding for state machine states?
  2. For a state machine with three states, how many flip-flops are needed to store the state (binary encoding / one-hot encoding)?
  3. In the 4-bit counter above, when count is 15 and a rising clock edge arrives, what does count become?
  4. In Verilog, two 8-bit signals a and b are added and assigned to an 8-bit signal s (assign s = a + b;). What should be watched for?
  5. Intending a to be signed -1, someone wrote the code above, and gt became 1. Why?