You have a mechanical procedure for transforming one formalism into another, so there is no structural difference between them.
Speaking of differences in implementation, the two formalisms differ only in the output function, which tells you which character should be output. In particular:
- In Moore, the output depends only on the current state.
- On a Miles machine, the output depends on the current state and current input.
The Moore machine might be a little easier to implement, because you have less information to track when it comes to generating output, but the difference will be very small.
Here's what a simple Moore machine looks like in C:
int state = INITIAL; while (!isTerminal(state)) { char input = nextInputSymbol(); fprintf(output, "%c", nextOutputSymbol(state)); state = nextState(state, input); }
and here’s Miley’s car:
int state = INITIAL; while (!isTerminal(state)) { char input = nextInputSymbol(); fprintf(output, "%c", nextOutputSymbol(input, state)); state = nextState(state, input); }
as you can see, the only difference is the definition of nextOutputSymbol() . Whether the implementation of this function is simpler for one or another formalism, it really depends on the particular application.
nextInputSymbol is just a procedure for getting a new character (maybe scanf or the like), and nextState will depend on the particular machine, but its complexity will not change much between Mealy and the Moore equivalent.
In particular, both nextOutputSymbol and nextState down to finding a table or chain of switch or if/else without real implementation complexity. Actually, it's just boring to write.
NOTE I skipped error checking in code snippets so that we focus on the main point of the discussion. Real world code would perform additional checks, such as handling EOF on nextInputSymbol or break on error conditions.