Moore State Machine

Moore machines are the simpler of the two standard types. The output is a function only of the current state of the machine.

Mealy State Machine

The outputs of Mealy machines are a function of the current state of the machine plus the inputs. This additional path provides more flexibility, but may complicate the understanding of the machine.

Glitch-Free State Machine

To make a better state machine:

– Synchronize all inputs, outputs and states.

– Coding FSMs with registered outputs eliminates combinational output logic.

– Coding FSMs with registered outputs insures that the outputs will be glitch-free.

– The one-hot output encoding style is an efficient technique for coding FSMs to drive registered outputs directly from the state register bits.

FSM Encoding Styles

  • Sequential Binary Encoding

    • State[1:0] : s0 – 00 , s1 – 01, s2 – 10, s3 – 11
    • ’n’ flip-flops used to store 2n states
    • Most efficient
    • Need to account for unused states
  • Gray Binary Encoding
    • State[1:0] : s0 – 00 , s1 – 01, s2 – 11, s3 – 10
    • ‘n’ flip-flops used to store 2n states
    • Most efficient
    • Need to account for unused states
  • One-hot Encoding
    • State[3:0] each state represented by a bit
    • One flip-flop is used to represent each state
    • Costly in terms of hardware, but trivial to design
  • Almost one-hot Encoding
    • One-hot with all-zero initial state