Moore machine 2026-10-25
A Moore machine is a finite-state machine whose output depends only on the current state. In a clocked implementation, a state entered at a clock edge determines the following period's output. Specifying an initial state is necessary to define startup behavior.
Use a synchronous sequential circuit with four Moore machine states. is ready, is the one-cycle pulse state, is disabled with no qualifying final zero, and is disabled after one sampled zero. Reset into , so an initial sampled high generates a pulse immediately. The complete transition/output table is:
StateCode Next if Next if
A particularly small implementation uses two D flip-flops with the next-state equations
Both D flip-flops share the clock; their outputs feed the displayed logic gates. The output depends only on the stored state, not combinationally on the external input. At each edge, evaluate the right-hand sides using the old state and the sampled input, then update both flip-flops together. The resulting applies throughout the following clock period.
From , a high enters . The next edge always leaves , so the pulse lasts exactly one period. In the disabled states, a high leads to and erases progress towards rearming. A zero enters , and a second successive zero enters . A later high can then enter . This proves both the two-zero requirement and the startup exception. For example, sampled inputs yield outputs .
Figure 1.
Original Moore-state design and clocked example for the two-zero rearming pulse detector. State and output are shown after each sampling edge.
Details.
The construction is a synchronous pulse detector with two-zero rearming. Assume meets setup/hold requirements at the sampling edges. A genuinely asynchronous input would first require synchronization, with its associated latency; that is separate from this sampled-input specification.
The displayed two-register Moore machine, initialized to , generates a one-clock pulse on a sampled high when ready, then waits for two consecutive sampled zeros before it can generate another. The codes represent ready, pulse, disabled and one-zero-seen respectively. From ready a high enters pulse; from pulse the next edge leaves for disabled on a high or one-zero-seen on a low. Disabled enters one-zero-seen on a low. A second consecutive low returns to ready, whereas a high returns to disabled. This transition analysis proves the output rule, the one-period duration and the immediate first-edge response after reset. It assumes a synchronous input meeting setup and hold requirements.