Part VII. Applications of Finite Automata
Finite automata has several applications in many areas such as
special purpose hardware design,
protocol specification etc..
Some of the applications are explained below:
1. Compiler Design
Lexical analysis or scanning is an important phase of a compiler. In lexical analysis, a program such as a C program is scanned and the different tokens(constructs such as variables, keywords, numbers) in the program are identified. A DFA is used for this operation.
For example, finite automation to recognize the tokens, ’while’ keyword and variables are shown below:
The well known lexical analyser tool, Lex uses DFA to perform lexical analysis.
2. Hardware Design
In the design of computers, finite automation is used to design control unit of a computer. A typical sequence of operations of a computer consists of a repretition of instructions and every instruction involves the actions fetch, decode, fetch the operand, and execute. Every state of a finite automation represents a specific stage of instruction cycle.
3. Protocol Specification
A system is composed of an interconnected set of subsystems. A protocol is a set of rules for proper coordination of activities of a system. Such a protocol can be described using finite automations. An example of a bank is ahown below:
State 1 represents the entry of a customer.
After he wishes to credit some cash to his account, system is in state 2.
Then the cashier receives cash. It reaches state 3.
Then the cashier updates the acoount and reach the final state 4.
If the customer wants to withdraw cash, he submits the slip ans system reaches state 5.
Then the slip is verified to confirm that he has sufficient balance and reaches state 6.
Then the customer is paid cash and reaches state 7.
Then the customer account is updated and system reaches final state 4 of the transaction.