wire / wire-format / finite-state-machine

Finite state machine (Mealy and Moore)

A finite state machine (FSM) has states, inputs, outputs, and transitions. Mealy machine: output depends on current state AND input. Moore machine: output depends only on current state. State encoding: binary (minimum bits), one-hot (one bit per state, simpler logic), Gray code (adjacent states differ by one bit, reduces glitches).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Finite state machine (Mealy and Moore)

wire format

spec: Digital logic design

A finite state machine (FSM) has states, inputs, outputs, and transitions. Mealy machine: output depends on current state AND input. Moore machine: output depends only on current state. State encoding: binary (minimum bits), one-hot (one bit per state, simpler logic), Gray code (adjacent states differ by one bit, reduces glitches).

fieldsizemeaning
Mealy machinemodelOutput = f(state, input). Output can change immediately on input change (faster). More outputs possible.
Moore machinemodelOutput = f(state). Output changes only on state transition (simpler, no glitches). Fewer outputs.
State registern bitsHolds the current state. n = ceil(log2(num_states)) for binary encoding.
Next state logiccombinationalComputes next state from current state + inputs.
Output logiccombinationalMealy: f(state, input). Moore: f(state).
One-hot encodingnum_states bitsOne bit per state. Simpler next-state logic (fewer gates) but more flip-flops.
Binary encodingceil(log2(n)) bitsMinimum flip-flops but complex next-state logic.
Gray codeceil(log2(n)) bitsAdjacent states differ by one bit. Reduces glitches in asynchronous outputs.

example:

00 00

FSM (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/finite-state-machine or /wire-format/finite-state-machine.json