Adaptation of the Two Sources of Code and One-Hot Encoding Method for Designing a Model of Microprogram Control Unit with Output Identification

This article presents a proposal for a model of a microprogram control unit (CMCU) with output identification adapted for implementation in complex programmable logic devices (CPLD) equipped with integrated memory modules [1]. An approach which applies two sources of code and one-hot encoding has been used in a base CMCU model with output identification [2] [3]. The article depicts a complete example of processing for the proposed CMCU model. Furthermore, it also discusses the advantages and disadvantages of the approach in question and presents the results of the experiments conducted on a real CPLD system.


Introduction
Nowadays, complex programmable electronic systems are applied for implementing logic circuits of control units [4]- [9].However, the issue of reducing the size of a control unit is still a subject of current interest [10] [11].Reducing the size of used resources makes it possible to improve such indicators as: the speed of performance, power consumption and the size of the realised unit [12] [13].One of the methods for reducing the size of the control unit is the realization of the control algorithm with the use of the CMCU (compositional microprogram control unit) project methodology [14].The application of CMCU makes it possible to implement a much smaller number of logical functions realising the task of the control system.The existing project methods based on the CMCU are not dedicated to the solutions realized with the use of programmable devices (CPLD).CPLDs include macrocells of programmable array logic (PAL) with a limited number of terms.To reduce the amount of hardware in the logic circuit of a control unit, the peculiarities of the CPLD and the features of a control algorithm to be implemented should be taken into account.Some of the CPLD family devices are equipped with integrated memory.For example, Altera CPLD devices are equipped with user flesh memory (UFM) [15], whereas Cypress CPLD devices are equipped with cluster memory blocks (CMB) [16].This article presents a mathematical model and a design algorithm with two sources of code and one hot encoding which has been adopted to CMCU model with output identification [1].

Background of the CMCU with Output Identification
It is assumed that the graph-scheme of the algorithm (GSA) is represented by sets of vertices B where { } and a set of arcs E where B is a set of conditional vertices.A vertex contains a microinstruction ( ) . A set C of operational linear chains (OLC) for the GSA shall be formed, where each OLC is a sequence of operator vertices and each pair of its adjacent components corresponds to an arc of the GSA.
Each OLC i α has only one output i O and an arbitrary number of inputs j i I .The i α elements are unders- tood as a state of the system which is identified by i O elements.OLC outputs make up the collection i CMCU and it has an address ( ) t A b .The microinstructions can be addressed using R bits, where and the bits are represented by variables from the set T: The project methodology of the microprogram control unit with output identification offers specific positioning of microinstructions in the memory, so as to make it possible to determine the state of the unit, using possibly the smallest number of address signals.The algorithm of positioning microinstruction in the memory consists of the following steps: 1.First, all microinstruction addresses are coded with the use of natural encoding.

The value of
3 C α α ∈ , where j i > belong to the same column and neither of the outputs is connected with the end vertex of the network of operations Γ , then the data are moved to the right, beginning with the first vertex of the chain i α .The released cells are determined as "in- significant" with the symbol * .The operation of moving to the right is repeated until the outputs i O and j O are placed in separate columns of the table.5.If all the output vertices are uniformly represented by OI R , then the algorithm moves to step 7. 6.If the address of any vertices reaches beyond the range of the current addressing, then : 1 Next, the algorithm returns to step 4. 7. The end.
The codes for each microinstruction are formed as a concatenation of the table's columns and lines.In such a case, the outputs of the OLC chain are uniformly encoded using variables from the set T ′ where: . , The algorithm for designing a model of the CMCU with output identification consists of the following steps: 1. Formation of the set of OLCs. 2. Addressing microinstructions (with shifting operation) and encoding OLC elements.3. Formation of the control memory content.4. Formation of the transition table of the CMCU. 5. Formation of the excitation function for the counter.6. Synthesis of the logic circuit of CMCU.
Figure 1 shows a logical scheme of the CMCU with output identification.The pulse Start causes loading of the first microinstruction address into a counter CT and set up of a fetch flip-flop TF.If 1 Fetch = , then mi- croinstructions can be read out of the control memory CM.If a current microinstruction does not correspond to an OLC output, then a special variable 0 y is formed together with microoperations q Y Y ⊆ .If 0 0 y = , then content of the CT is incremented according to the addressing mode.Otherwise, the block of CC generates functions Φ .If E y equals 1, then the CMCU stops and new data from the CM will be not loaded.

Main Idea behind the Proposed Method
It shall be pointed out that the logic for the CC and CT is implemented as parts of the CPLD.An external PROM chip or memory integrated with the CPLD may be applied to implement the CM.The memory has t outputs, where 2, 4,8,16,32 t = [18].Some information can be implemented using free outputs of the CM.It is assumed that one-hot encoding of microoperations is used.The word of the CM has The 2 R outputs of the CM are free: The 2 R bits are represented by variables from the collection P: take place, the method can be used.As for encoding additional information used by excitation functions for the CT, one-hot encoding will be applied.In such a case, the amount of information that can be stored in free CM is: Next, an occurrence table is created, with columns i O and i g .The i O column contains the OLC elements, whereas the i g column shows the number of occurrences of an OLC element while making an excitation func- tion for the CT.The number of occurrences of the i O element is counted on the basis of a transition table, where a number of high bits is counted in addresses corresponding to i O .Using the occurrence table, it is now possible to transfer the one hot I − of the most frequently used i O elements to a new collection: .
It shall be noted that the collection .
For the CMCU model with output identification and two sources of code, the memory CM is a source of variables i p P ∈ used for encoding the elements i B O ∈ Π through codes ( ) The OI R of the oldest output bits from the counter CT is a source of variables from the set T ′ used for encoding the elements It shall be highlighted that the maximum length of the logical expressions used for making excitation functions which use the information from the source C Π for the base method of the CMCU with output identifica- tion is: .
For the proposed model with one hot encoding, the maximum length of the logical expressions built on the basis of the information from the collection A Π does not change and equals: .
The maximum length of logical expressions for the model with one hot encoding, built on the basis of the information from the collection B Π , is reduced and equals: 1.
As a result, the value of the CM and the transition table have been modified on the basis of the occurrence table.
The modified algorithm for designing a model of the CMCU with output identification consists of the following steps: 1. Formation of the set of OLCs. 2. Addressing microinstructions (with shifting operation) and encoding OLC elements.3. Formation of the control memory content.4. Formation of the transition table of the CMCU. 5. Formation of the occurrence table.6. Modification of the control memory content.7. Modification of the transition table of the CMCU.8. Formation of the excitation function for the counter and minimization.9. Synthesis of the logic circuit of CMCU.
Figure 2 presents a modified structure of the CMCU with output identification and the applied method of two sources of code.

An Example of the Proposed Method
, , , , , , , , , Y y y =  , 4 N = .First, an initialization Table 1 of microin- struction addresses is formed.Next, the shift operation takes place, resulting in a new address Table 2. Thanks to the shift operation, all the elements g C O ∈ Π may be identified using OI R of older address bits:

, , T T T T ′ =
. With the use of Table 2, Table 3 is created, containing encoding for operation chains, as well as Table 4, with the content of the CM.Finally, a transition Table 5 is created.
Let us assume that we have a memory module in which 8 t = .Following the above-presented modification, the calculations may be put forward as: 0 2 6 R is the number of free CM bits which will be represented by a set of variables On the basis of Table 5, an occurrence Table 6 is created.For the purpose of this example, high values in address bits (there are 7 of them) corresponding to the element 1 O have been bolded and underlined in Table 5.The collection ( ) 5 contains modified encoding for the OLC elements with a second source of information about the state of the unit, which is a CM module.Table 4 is modified with additional data informing about the state of the unit.These data have been marked with an underlining and bolding in columns 1 p and 2 p .The last step is the construction of an excitation function based on the modified data from columns 3 and 4 of Table 5: , , T T T

Results and Conclusions
Figure 5 presents the results of the implementation of the model in real hardware.The Alter, a family MAX II device EPM1270 F256C5 equipped with UFM, has been used for tests.Figure 5 depicts the relationship between the obtained reduction in the size of the system (in percentage) and the participation of the source of data B Π in generating the excitation functions (in percentage).The results of conducted experiments indicate that the ability to reduce the length of the terms make it possible to reduce the size of the system.In the analyzed model, in some cases, the deterioration of the possibility of minimizing the functions has a greater impact than reducing the length of the terms, which results in an increase in the size required for the realization of the designed system.With such scenarios, an algorithm consisting of the following steps might serve as an alternative: Taking the OLC elements, which do not undergo minimization to the collection B Π will make it possible to avoid the effect of degradation of minimization possibilities in excitation functions.This effect appears in the scenarios with minor participation of the B Π source in the construction of the excitation functions.The solu- tion presented in this paper requires formalization of mathematical descriptions and adaptation to specific CMCU models.This proposal also requires conducting implementation experiments based on real reprogrammable devices.Future studies will focus on designing mathematical models based on the above-presented algorithm and comparing the results obtained with the results for the models using the method of two sources of code [2] [3] [19]- [21].

Figure 3 and
Figure 3 and Figure 4 present an exemplary algorithm used for the realization by the control unit.This algorithm employs the following variables:

Figure 2 .
Figure 2. Modified structural diagram of the CMCU with output identification U 2 .

Figure 3 .
Figure 3.An example of the algorithm used for the realisation of T 1 .

Figure 4 .
Figure 4. Operation chains for the algorithm T 1 .

Π
are encoded with the use of variables from the set P. As a result:

Figure 5 .
Figure 5. Reduction in the size of the system due to the participation of the source.1. Formation of the set of OLCs. 2. Addressing microinstructions (with shifting operation) and encoding OLC elements.3. Formation of the control memory content.4. Formation of the transition table of the CMCU. 5. Construction of excitation functions for the CT and RG. 6. Minimization of excitation functions.7. Finding logical expressions-OLC elements which have not undergone minimization-in the minimized excitation functions.8. Formation of the occurrence table containing most frequently occurring OLC elements which have not undergone minimization.9. Modification of the control memory content.10.Modification of the transition table and CM of the CMCU.11.Formation of the excitation function for the counter and minimization.12. Synthesis of the logic circuit of CMCU.Taking the OLC elements, which do not undergo minimization to the collection . An address table is created.The table consists of 2 OI

Table 1 .
Initial table of addressing.
Table of addressing after shift operation.