VFSM: Calculator

VFSM type: Calculator(user vfsm)

Prefix: Dig

IOid name: MyCmd (type: CMD-IN)

IOid name: Ofu_Calculate (type: OFUN)
-->Virtual Input: Error (12)
-->Virtual Input: ErrorClear (13)
-->Virtual Input: Ok (11)
-->Virtual Output: AddToNumber (7)
-->Virtual Output: Calculate1Op (12)
-->Virtual Output: CalculateAll (5)
-->Virtual Output: CalculateLast (6)
-->Virtual Output: CalculateT (10)
-->Virtual Output: ChangeOperation (14)
-->Virtual Output: ChangeSign (9)
-->Virtual Output: Clear (13)
-->Virtual Output: DeleteLastDigit (8)
-->Virtual Output: DisplayClearMsg (3)
-->Virtual Output: DisplayResetMsg (4)
-->Virtual Output: Reset (15)
-->Virtual Output: Unexpected (1)

IOid name: Ofu_Expression (type: OFUN)
-->Virtual Input: ExprEmpty (0)
-->Virtual Input: ExprNotEmpty (1)
-->Virtual Output: CheckExpression (1)

IOid name: Ofu_Parse (type: OFUN)
-->Virtual Input: 1OpMatched (5)
-->Virtual Input: AckMatched (2)
-->Virtual Input: AddSubMatched (3)
-->Virtual Input: BackspaceMatched (11)
-->Virtual Input: ClearMatched (7)
-->Virtual Input: DigitMatched (1)
-->Virtual Input: EqualsMatched (6)
-->Virtual Input: MulDivMatched (4)
-->Virtual Input: NOT_AckMatched (~2)
-->Virtual Input: NOT_ClearMatched (~7)
-->Virtual Input: NOT_ResetMatched (~8)
-->Virtual Input: ResetMatched (8)
-->Virtual Input: SignMatched (9)
-->Virtual Output: ClearDisplay (2)
-->Virtual Output: MatchKey (1)
-->Virtual Output: PrepareExpressionT (3)

IOid name: Expression (type: DAT)
-->Virtual Input: Expression_CHANGED (CHANGED)

IOid name: Key (type: DAT)
-->Virtual Input: Key_CHANGED (CHANGED)

Always: input actions valid in each state:
Key_CHANGED
MatchKey
Expression_CHANGED
CheckExpression

State transition table, state ' Init ':
Init
EntryAction:
ExitAction:
ClearDisplay
Idle
always

State transition table, state ' Idle ':
Idle
EntryAction:
ExitAction:
DigitMatched
ClearDisplay
ExprNotEmpty and ( MulDivMatched or AddSubMatched )
ChangeOperation
MulDivMatched and ExprEmpty
CalculateLast
AddSubMatched and ExprEmpty
CalculateAll
ClearMatched
Clear
ResetMatched
Reset
1OpMatched
Calculate1Op
EqualsMatched and ExprNotEmpty
PrepareExpressionT
BackspaceMatched or SignMatched
Unexpected
AddToNumber
DigitMatched or ClearMatched
CalculateT
EqualsMatched
Idle_Busy
BackspaceMatched or SignMatched or MulDivMatched or ResetMatched or 1OpMatched
Calculate
AddSubMatched or MulDivMatched

State transition table, state ' AddToNumber ':
AddToNumber
EntryAction:
AddToNumber
ExitAction:
Number
Ok and AckMatched

State transition table, state ' Calculate ':
Calculate
EntryAction:
ExitAction:
Idle
Ok and AckMatched
Error
Error and AckMatched
ErrorClear
ErrorClear and AckMatched

State transition table, state ' Number ':
Number
EntryAction:
ExitAction:
AddSubMatched or EqualsMatched and ExprNotEmpty
CalculateAll
MulDivMatched
CalculateLast
BackspaceMatched
DeleteLastDigit
ClearMatched
Clear
ResetMatched
Reset
1OpMatched
Calculate1Op
SignMatched
ChangeSign
AddToNumber
DigitMatched
CalculateT
EqualsMatched and ExprEmpty
Calculate
AddSubMatched or MulDivMatched or ResetMatched or EqualsMatched
Num_Busy
SignMatched or BackspaceMatched or ClearMatched or 1OpMatched

State transition table, state ' Error ':
Error
EntryAction:
ExitAction:
ResetMatched
Reset
NOT_ResetMatched and NOT_AckMatched
DisplayResetMsg
Idle_Return
ResetMatched

State transition table, state ' ErrorClear ':
ErrorClear
EntryAction:
ExitAction:
ClearMatched
Clear
ResetMatched
Reset
NOT_ResetMatched and NOT_ClearMatched and NOT_AckMatched
DisplayClearMsg
Idle_Return
ClearMatched or ResetMatched

State transition table, state ' CalculateT ':
CalculateT
EntryAction:
CalculateT
ExitAction:
Idle
Ok and AckMatched

State transition table, state ' Idle_Busy ':
Idle_Busy
EntryAction:
ExitAction:
Idle
Ok and AckMatched
Error
Error and AckMatched
ErrorClear
ErrorClear and AckMatched

State transition table, state ' Num_Busy ':
Num_Busy
EntryAction:
ExitAction:
Number
Ok and AckMatched
Num_ErrorClear
ErrorClear and AckMatched
Error
Error and AckMatched

State transition table, state ' Num_ErrorClear ':
Num_ErrorClear
EntryAction:
ExitAction:
ClearMatched
Clear
ResetMatched
Reset
NOT_ResetMatched and NOT_ClearMatched and NOT_AckMatched
DisplayClearMsg
Num_Return
ClearMatched
Idle_Return
ResetMatched

State transition table, state ' Num_Return ':
Num_Return
EntryAction:
ExitAction:
Number
Ok and AckMatched

State transition table, state ' Idle_Return ':
Idle_Return
EntryAction:
ExitAction:
Idle
Ok and AckMatched
Total number of states: 14