# Finite Automata With Output

**Definition: **A finite-state machine *M *= (*Q*, S,*O*,d, l, *q *) 0 consists of a finite set *Q *ofstates, a finite input alphabet S, a finite output alphabet *O*, a transition functiond that assigns to each state and input pair a new state, an output function l thatassigns to each state and input pair an output, and an initial state *q*0.

Let *M *= (*Q*, S,*O*,d, l, *q *) 0 be a finite state machine. A state table is used to denote the values of the transition function d and the output function l for all pairs of states and input.

**Mealey Machine**: Usually the finite automata have binary output, i.e., they accept the string or do not accept the string. This is basically decided on the basis of whether the final state is reached by the initial state. Removing this restriction, we are trying to consider a model where the outputs can be chosen from some other alphabet.

The values of the output function *F*(*t*) in the most general case is a function of the present state *q*(*t*) and present input *x*(*t*).

*F *(*t*) = l(*q*(*t*), *x*(*t*))

where l is called the output function.

This model is called the “Mealey machine”.

A “Mealey machine” is a six-tuple (*Q*, S,*O*,d, l, *q *) 0 where all the symbols except l have the same meaning as discussed in the sections above. l is the output function mapping S ´*Q *into *O*.

**Moore Machine**: If the output function *F*(*t*) depends only on the present state and is independent of the present input *q*(*t*), then we have the output function *f*(*t*) given by

*F *(*t*) = l(*q*(*t*))

A Moore machine is a six-tuple (*Q*, S, *O*, d, l, *q *) 0 with the usual meanings for symbols.