Specifics of Statechart Implementation

Specifics of Statechart Implementation

 

The calculation for the size of The StateInfo data type will be named StateInfo_<Controller Name> - for example, might be StateInfo_A11_CTRLcnt1. The data type will be defined as an unsigned type of either 8, 16 or 32 bits. The size depends on the topology of the Statechart. A general method for calculating the required size is:

1.
2.
To calculate the bits required for each level in the state hierarchy, take the maximal number of states in that level, add one and calculate how many bits are required to count, in binary, to that number:

(log 2 (number_states))

Note: For And-States, perform the calculation for each of the And-state descendants, and take the largest.