Mealy-to-Moore Transformation-A state stable design of automata

M. Oezguel et al. / Advances in Science, Technology and Engineering Systems Journal Vol. 2, No. 6, 162-174 (2017) concluded, the feedback should be moved over λ , making the output y the feedback. In order to set the correct state z for the transfer function δ , a function λ−1 is realized. This function generates the reduced state z from the feedback y. This equivalent transformation is outlined in figure 2.


Introduction
A Synchronous circuits entail several benefits. Firstly performance advantages, e.g. faster system perfomance, no clock synchronization, fewer power consumption and fewer electromagnetic emission. Secondly asynchronous circuits also have safety advantages, e.q. no clock skew. Asynchronous circuits can also lead to simplicity, by connecting different parts modularly [1,2]. On the other hand asynchronous circuits provide risks, such as faults like hazards, glitches and so on [3]. Therefore it is very important to design asynchronous circuits correctly, especially in safety critical applications such as in automotive, where human lives are at stake. To prevent faults like hazards, a mealyto-moore transformation will be presented, which creates a function stable asynchronous machine. The Mealy machine with the state transfer function δ and the output function λ , see figure 1 be given. Each Mealy machine can be transformed into an equivalent Moore machine [3] for example by increasing the arity of δ by |x| and coding it with x, z = (z, x) with δ (z , x) → (δ (z, x), x), and the output function is only dependent on the new state variable z with µ : (z ) → µ(z ). By comparing the two machines the pros and cons can be shown. Therefore the idea of transforming the machines into each other to profit from the benefits of both is obvious. Mealy machines have the advantage of requiring less states since one state can produce a number of different outputs in combination with the input. A Moore machine's state on the other hand only produces one output. A Mealy machine is also faster by reacting directly to the input. This feature however is not always wanted, since it can lead to undesired outputs (e.g. hazards, glitches) when the input is variable. A Moore machine is more stable in this regard, since it only indirectly reacts to input changes. The output only changes when transferring into the next state. Transforming a Mealy machine into a Moore machine is therefore useful in case a direct dependence on the input is to be avoided [2]. In the paper the transformation of a Mealy machine into a Moore machine is presented. The machine will be designed under the use of dual-rail logic and the RS-buffer, and will stabilize itself. Firstly the transformation is made by breaking the feedback up and nesting it in the RS-buffer, secondly by encoding the inputs as states, so that the output function is only dependent on pseudo states. With the method presented in this article, function stable sequential circuit parts can be seen as combinational logic and moved over other blocks at will. With this method, individual machines can be strung together to realize complex circuits for safety relevant applications.

Theory
This paper describes the underlying theory of the transformation and provides an illustrative example. Figure 1 shows a fully asynchronous Mealy machine. The branches entering a node in the graph should end reflexively, so that only transient states are allowed which are conscious and triggered from the outside [2]. To consider all branches of the Mealy machine as locally reflexively concluded, the feedback should be moved over λ , making the output y the feedback. In order to set the correct state z for the transfer function δ , a function λ −1 is realized. This function generates the reduced state z from the feedback y. This equivalent transformation is outlined in figure 2. The following applies: The next stage of transformation shows at first sight no feedback. Only the RS-buffer, which is in δ , has a nested feedback. This transformation is outlined in figure 3. Transient states can be triggered via the input, while state stable states are being held via the RS-buffer. In order to set the correct state z to µ, the function δ must be well designed, which will be shown in the following sections. The following applies:

Dual-rail logic
For the implementation in dual-rail logic [4], the fully asynchronous circuit from figure 1 will be divided in the 1-and 0-share. This is done by partitioning the state transfer function and the output function, see figure 4. The functions δ and λ are each w.l.o.g. realized in two blocks δ = (δ z , δ z ) and λ = (λ z , λ z ). In order to guarantee this secure dual rail structure, RS-buffers are used. The mode of operation corresponds in a certain manner to the Celement [4,5]. The function δ of figure 3 will be designed by appropriate coding according to the RS-buffer, showing a general structure as outlined in figure 5. The stabilized 1-states, ∆ z c s z, are transformed into 1-outputs, Λ y c s y. The corresponding Venn diagram of the stabilized 1-states in 1-outputs can be seen in figure  6. 1-states that appear as 0-outputs are declared as Λ z , 0states which appear as 1-outputs are declared as Λ z . The 1-partition is composed of: To understand the coding, first the RS-buffer has to be understood.

RS-Buffer
The RS-Buffer used and its circuit symbol are represented in figure 8 and 9 and  The RS-buffer is used to synchronize a dual-rail signal by only letting a state tranfer happen, if both incoming signals are disjoint (how it is desired) to each other. This means that there is no overlaying of signal, which could lead to fatal faults. The RS-buffer consists of the tri-state driver, which is the first state and the second stage the so called babysitter. The driving structure now provides 3 functions. Firstly the setting signal, which means the output is in the logical 1-state. Secondly the resetting signal, which means the output is in logical 0-state and least the hold state which holds the last state at the output by keeping the signal in the babysitter and having a high impedance state at the tri state. The babysitter consists of two complementary loops. The formula for the output B is therefore

Design of the reduced state transfer function δ
As you can see the RS-buffer is coded via a 3-partitioning. There is the setting signal S= [1], the resetting signal R= [1] and 1-share, that means independent of the state the next state will be at logical 1, secondly the transient 0-share, that means output at logical 0 independent of the state, thirdly the state stable share of the state transfer function, that means the share, which is at constant input dependent on the value of the last state and the state instable state, which means a permanent change of the state at constant input, see figure 10. The resulting 3 parts, which are left, can now be easily compared to the 3-partitition of the RS-buffer. The transient 1-share δ z is realized by the setting signal of the RS-buffer, similar the transient 0-share δ z is realized by the resetting signal and the state stable share is realized by the hold signal of the RS-buffer. To understand the transformation, first a few compositions must be defined: This work only concentrates on function stable machines, so that state instable parts are not allowed. State instable parts can be deduced via Functions must not exhibit these parts. The other parts can be deduced by the following expressions This leads to the genereal formula for δ i for n states:

Design of the output function
The detailed description of the Venn-diagrams given in figure 11 and 12 is reported in [6]. (z, y) The dual-rails y and y for y are now: The seperate parts of the machine have now been deduced and can simply be strung together to get the form of figure 5.

Use-Case
To get a better insight, three examples will be presented.

1-dimensional example
For x = (x 1 , x 0 ), y = (y) and z = (z) the transformation of the Mealy machine (X,Y, Z, δ , λ ) with the state transfer function and output function will be executed. The automaton before the transformation can be seen in figure 13.
x 1 x 0 x 1 x 1 x 1 x 0 y Figure 13: Mealy machine before the transformation

Design of δ
The KV-diagram of the state transfer function can be seen in figure 14.  The parts of the state transfer function can easily be seen and the KV-diagrams for δ z and δ z can be deployed, see figure 16. For δ z 0 is coded as 1 and 1 is coded as 0 respectively, because of the dual-rail structure. Figure 16: δ z and δ z For the next steps of the transformation, first the complement of δ has to be calculated: The parts of the state transfer function are: It has to be checked, if there are any instable parts: The functions δ z and δ z can now be calculated via The coding for δ of the RS-buffer is as follows: Now δ can be derived: Figure 17: Output function λ The stabilized state transfer function has now been designed, now the output function must be designed. Therefore the output function has to be layed over the state transfer function and the parts have to be specified: The parts are: This leads to the output function: The resulting automaton has the form of figure 19 with the determined functions y = A ∨ B and y = C ∨ D.

2-dimensional example
For x = (x 1 , x 0 ), y = (y) and z = (z 1 , z 0 ) the transformation of the Mealy machine (X,Y, Z, δ , λ ) with the state transfer functions and output function  With the compacted KV-diagram the RS-buffer for δ z 0 can be coded by specifying the functions δ z 0 and δ z 0 , see www.astesj.com figure 23. The partial function δ z 0 delivers the 1's of δ z 0 as 1's, while δ z z 0 delivers the 0's of δ z 0 as 1's. In this state transfer function, there is no state stable part only transient parts. Making the stable δ z 0 a normal dual-rail structure.
Figure 23: δ z 0 and δ z 0 State instable parts are not allowed in the state transfer function: Now the resulting z 0 can be calculated: First δ z 1 is checked for instable parts: No instable parts, so the RS-buffer can be coded for δ z 1 by determining the functions δ z 1 and δ z 1 :

Design of λ
The KV-diagram of λ can be seen in 27. Because of the two-dimensional state, λ has to be divided into eight parts. They exist as follows: The parts of λ are set up in the KV-diagram, see figure  28. The output functions y and y can be inferred from this: The resulting automaton can be seen in 30. As you can see in table 3, situation 7 leads to a cycle, by stepping to configuration 11, which steps back to configuration 7, and so on. So to have a state stable design in multistate machines, it is also necessary to regard the transitions between the states. A rule has to be found, to filter these race conditions. In the following transformation the auomaton of subsection b is stabilized, by changing δ z 1 .

Stable 2-dimensional example
The state transfer function δ z 1 has now been changed, to make it a stable automaton. For x = (x 1 , x 0 ), y = (y) and z = (z 1 , z 0 ) the transformation of the Mealy machine (X,Y, Z, δ , λ ) with the state transfer functions and output function will be executed. The machine before the transformation is outlined in figure 29.
x 1 x 0 x 1 x 0 x 1 x 1 x 0 x 1 y Figure 29: Automaton before the transformation  State instable parts are not allowed in the state transfer function: Now the resulting z 0 can be calculated: www.astesj.com First δ z 1 is checked for instable parts: No instable parts, so the RS-buffer can be coded for δ z 1 by determining the functions δ z 1 and δ z 1 :

Design of λ
The KV-diagram of λ can be seen in 37. Because of the two-dimensional state, λ has to be divided into eight parts.
They exist as follows: The parts of λ are set up in the KV-diagram, see figure  38. The output functions y and y can be inferred from this:

Test of Theory
To confirm the theory presented in the article, the state transfer function of the one dimensional example was analyzed making it a Medvedev. To simulate the circuit it was modelled with NAND gates and simulated in LT-Spice. The modeled NAND structure then was realized on the circuit board and the output was captured via an oszilloscope. The Medvedev machine (X,Y, Z, δ , 1) with x = (x 1 , x 0 ), y = (y) and z = (z) with the state transformation function and output function be given: The    The graph of the automaton: 0 1 x 1 x 1 x 1 ∨ x 0 x 1 x 0 Figure 41: Graph of the automaton NAND gates have been used to realize the structure. Therefore the DNF was transformed into a NAND strucutre by twice negating the DNF.  Figure 43 shows two asynchronous feedbacks, which can lead to a race. On transition of x 1 from logical 1 to 0, while x 0 stays on logical 1, the feedback, which is first on logical 0, will make the other to a stable logical 1. Therefore on this transition, it can not be forecasted, whether the output will be on logical 1 or 0.
∧ ∧ x 1 0 → 1 To simulate the race condition, the circuit was modelled and simulated in LT Spice. The simulation shows a race. The circuit was realized in reality and the race was captured via an oscilloscope. Figure 48: Race situation in reality Then the transformation, which was presented in this journal, was made leading to the following structure, which does not have any contending feedbacks anymore. The only feedback this structure needs is nested in the RS-Buffer. Figure 49: Transformed Moore This structure does not show a race problem. To prove this statement the race condition of the old automaton has been set to the inputs. In figure 50 the state z and the rising edge of x 1 is shown. It's clearly to see that the state doesn't change, not even a fluctuation of the signal can be recognized. Therefore the transformed machine is determined and stable.

Conclusion and Future Work
An asynchronous function stable Mealy was transformed into a state stable Moore under the use of the RS-buffer with suitable coding. The transformation provides general asynchronous design rules, e.q. the isolation of critical situations via the hold function. Due to the stabilisation by RS-buffer with the hold function, no races will be propagated through the circuit. In this journal three examples have been presented, a 1-dimensional and two 2-dimensional. Although the stable 2-dimensional transformation has produced an asynchronous feedback, this feedback leads either to a confirmation or a hold of the RS-buffer. The feedback has to be seen as a starting condition which gets triggered by the input and a change of the feedback will only affect the RSbuffer if the input changes. This design guideline can be used for all circuit designs, to create a stable, reliable system. The goal of the design is to remove the outer feedback and nest it in the RS-buffer. The inputs have been coded as pseudo states and stabilized via the RS-buffer. The output function has also been designed in dual-rail. This leads to a circuit, that looks at first sight as a combinational circuit. With this method you can simplify complex automata and combine them. The results have to be simulated to get a detailed look at the behavior of the transformed Moore. As it was shown, one dimensional machines get stabilized by this design, but for more dimensional machines it is necessary to design stable functions and regard the transitions between the states, not only concentrating on one state. So a rule has to be found, which can check for instabilities between states and stabilize machines in these constellations. Additionally the formula for the Transformation can be programmed, to create an automated process of transformation. Additionally the output function λ has to be checked for functional Hazards and addapted to guarantee that they are no longer existing.