# Transforming Group Codes in Mealy Finite State Machines with Composite State Codes
## 3 Peculiarities of FSMs Based on Composite State Assignment  
Composite state assignment is proposed in paper [11]. As follows from [11], using CSCs may improve the main characteristics of FPGA-based FSM circuits: the resulting circuits occupy a smaller chip area and provide a higher operating frequency than their counterparts based on MBCs, OHCs and JEDI. To execute the composite state assignment, it is necessary to split the set of states \(A\) by \(KC\) groups of compatible states, \(G^{k}\subseteq A\). This leads to a partition, \(\Pi_{AC}=\{G^{1},\ldots,G^{KC}\}\), with the minimum possible number of groups. The groups \(G^{k}\in\Pi_{AC}\) are encoded by maximum binary codes, \(CG(G^{k})\), with \(R_{G}\) bits:  
\[R_{G}=\lceil log_{2}KC\rceil. \tag{5}\]  
The groups are encoded using elements of the set \(\tau_{G}=\{\tau_{1},\ldots,\tau_{RC}\}\). Maximum partial state codes encode states \(a_{m}\in G^{k}\) inside each group, \(G^{k}\in\Pi_{AC}\). If a group, \(G^{k}\in\Pi_{AC}\), includes \(NS_{k}\) elements, then the width of the partial codes is determined as  
\[R_{k}=\lceil log_{2}NS_{k}\rceil. \tag{6}\]  
To create partial state codes, \(R_{S}\) variables are necessary. The value of \(R_{S}\) is determined as  
\[R_{S}=max(R_{1},\ldots,R_{KC}). \tag{7}\]The partial state variables determine the set \(\tau_{5}=\{\tau_{RG+1},\ldots,\tau_{RG+RS}\}\). So, the total number of group and partial state variables, \(R_{CC}\), is determined as  
\[R_{CC}=R_{G}+R_{S}. \tag{8}\]  
Expression (8) also determines the number of IMFs generated (and the number of flip-flops in the RG). The concatenation of codes \(CG(G^{k})\) and \(CS(a_{m})\) determines a composite state code, \(CC(a_{m})\), of the state \(a_{m}\in G^{k}\). So, the composite state codes are determined by the following expression:  
\[CC(a_{m})=CG(G^{k})*CS(a_{m}). \tag{9}\]  
In (9), we use the symbol \(*\) to show the concatenation of two binary vectors. To implement a CSC-based FSM circuit, it is necessary to find three sets representing each group, \(G^{k}\in\Pi_{AC}\). The partial set of inputs \(X^{k}\subseteq X\) includes inputs determining transitions from the states \(a_{m}\in G^{k}\). This set includes \(L_{k}\) elements. The partial set of outputs \(Y^{k}\subseteq Y\) includes FSM outputs, \(y_{n}\in Y\), generated during transitions from the states \(a_{m}\in G^{k}\). The set of IMFs \(D^{k}\subseteq D\) includes input memory functions generated during transitions from the states \(a_{m}\in G^{k}\). Each group, \(G^{k}\in\Pi_{AC}\), should satisfy the following condition:  
\[R_{S}+L_{k}\leq S_{L}. \tag{10}\]  
To create the partition \(\Pi_{AC}\), it is possible to use the method proposed in [32]. This approach allows us to find a partition, \(\Pi_{AC}\), with the minimum possible number of groups, \(KC\). So, each group determines the following PBFs:  
\[D^{k}=D^{k}(\tau_{5},X^{k}); \tag{11}\]  
\[Y^{k}=Y^{k}(\tau_{5},X^{k}). \tag{12}\]  
To obtain the final values of functions \(f_{i}\in D\cup Y\), it is necessary to assemble the corresponding partial functions. This is achieved using group codes. Each partial function should be multiplied by a conjunction, \(G_{k}\), corresponding to the code \(CG(G^{k})\). So, the final values of SBFs (2) and (3) are determined by the following systems:  
\[D=D(G_{1},\ldots,G_{KC},D^{1},\ldots,D^{KC}); \tag{13}\]  
\[Y=Y(G_{1},\ldots,G_{KC},Y^{1},\ldots,Y^{KC}). \tag{14}\]  
As shown in [11], the functions (13) and (14) could be generated using the dedicated multiplexers of CLBs [23; 33]. So, there should be two levels of logic blocks in the circuit of the CSC-based Mealy FSM \(U_{2}\). The architecture of this circuit is determined by systems (11)-(14). The architecture of FSM \(U_{2}\) (Figure 2) is proposed in article [11]. In FSM \(U_{2}\), LUT-based blocks, _LUTer1_-_LUTerKC_, form the first logic level of the FSM circuit. The block _LUTerk_ generates partial functions (11) and (12), representing the group \(G^{k}\in\Pi_{AC}\). The function assembler is represented by the block _LUTerY_\(\tau\).