HDL & Verification
What is the basic structure of a state machine written in an HDL?
- AOnly memory to remember the state, with no logic
- BOnly output logic, with no memory of state
- CA register holding the current state, combinational logic choosing the next state, and combinational logic producing outputs
Show answer and explanation
Answer: C. A register holding the current state, combinational logic choosing the next state, and combinational logic producing outputs
A state machine keeps the current state in a flip-flop register, determines the next state from the current state and inputs with combinational logic, and updates the state at the clock edge. Outputs are produced from the current state (and inputs) by combinational logic. Many circuits that follow a procedure, such as protocol controllers, vending machines and traffic lights, are written as state machines.
- A. Logic to determine the next state is needed.
- B. A state register is required.
- C. Correct. The state is updated by the clock.