Implementation and Operation
Input Encoding and Input Alphabet
Output Encoding and Output Alphbet
State Code and State Symbol Products
Application Comments
Implementation and Operation
There is hardly any direct connection between programs and the behavior of a process that is illustrated as a state graph
The complete behavior i.e., the transport, the software, the state returns, interrupts, etc., are represented by the state graph
There is no easy connection among the lines of code and the states
However, the stat table forms the basis for the program
Usually, four tables are involved for a program
INPUT_CODE_TABLE- Input code table encodes the input values into a compact list
TRANSITION_TABLE- Transition table specifies the next state for every transition
OUTPUT_TABLE- Output table specifies the output values or code, if any, that are associated with every state input combination
DEVICE_TABLE- Device table stores the present state of every device or process that uses the same state table
The operation of the routine is as follows, where # means concatenation
BEGIN
PRESENT_STATE:= DEVICE_TABLE (DEVICE_NAME)
ACCEPT INPUT VALUE
INPUT_CODE := INPUT_CODE_TABLE (INPUT_VALUE)
POINEER := INPUT_CODE#PRESENT STATE
NEW_STATE := TRANSITION_TABLE (POINTER)
OUTPUT_CODE := OUTPUT_TABLE (POINTER)
CALL OUTPUT_HANDLER (OUTPUT_CODE)
DEVICE_TABLE (DEVICE_NAME) := NEW_STATE
END
The present state is fetched form memory
The present input value is fetched, If the value is a numerical, one can directily use it, otherwise, one must encode it into a numeerical values.
The present exiting state and the input code are joined to generate a pointer of the transition table and its logical image (the output table)
The output table consits of a pointer to the routine to be executed (the output) for that state-input combination
The same pointer is used to fetch the new state value, which is then stored
Input Encoding and Input Alphabet
The inputs can be directly used only by the simplest finest-state machines
The input encoding can be represented with a table consisting codes
An alternative to input encoding is a vast state graph and table as, in every state, there must be out link for every input
"Input alphbet" is the different set of encoded input values
Output Encoding and Output Alphbet
there can be many different, incompatible, kinds of outputs for transitions for a finite state machine- A single character output is rare in actual applications
There exist only a finite number of distinct actions that can be encoded in to a suitable "output alphabet"
A hypthetical or real output processor invokes the action appropriate to the output code
State Code and State Symbol Products
'State' and 'State codes' in finite state machine mean the hypothetical integer used to represent the state and not the exact form of the state code that can result from the process of encoding
The term 'state symbol product' refers to the concatenation used to join the state and input codes
Application Comments
For Designers- when the control function is likely to change in future or when the system has similar but slightly different control functions, an explicit state table is advantageous, It results in fast response time
For Testers- One need to be concerned about the type of bugs that are inherrent in the implementation. A suitable finite state machine implementation can be attained by making aware of the kinds of tests developed from a state graph description to the programmes
0 comments:
Post a Comment