## 2 Method of Sequential Control Program Conversion to Single-Cycle Computation Scheme  
One of the most popular programming languages for programmable logic controllers is ladder diagram (LD). The LD language has been inspired by schematic diagrams of relay control systems. It describes the energy flow from the left power rail to the right, utilizing switches and coils network. A diagram is analyzed sequentially, component by component, going from left to right, which accommodates it to sequential evaluation, via a PLC. In opposite to physical circuits, the analysis method constrains the signal flow that is unidirectional (left to right). Efficient hardware implementation requires transforming the given LD program to parallel operations, retaining the dependencies implied by the analysis process. The Single Cycle Ladder Diagram Implementation Method--FAST_LD  
The ladder diagram is built from an ordered sequence of rungs. There are two distinguished sets of variables: \(X_{I}\) and \(X_{Q}\). The set \(X_{I}\) consists of variables associated with inputs of the controlled system. The \(X_{Q}\) set consists of \(q_{i}\) variables associated with outputs and internal signals. The rungs are evaluated in the order of definition, and \(i\)-th rung works out the value of the \(q_{i}\) variable:  
\[q_{i}=f_{i}\big{(}X_{I},X_{Q}\big{)}:i=1\ldots n,q_{i}\in X_{Q} \tag{1}\]  
**Theorem 1**. : _Any ladder diagram network described with the use of switches and coils can be mapped to a digital circuit capable of completing the computation, described by a network in a single clock cycle, retaining properties of sequential analysis._  
Proof of Theorem 1.: The ladder diagram model, described by (1), for the \(k\)-th scan (the loop run) can be put down as follows:  
\[ \begin{split} q_{1}(k)&=f_{1}\big{(}X_{I},q_{1}(k- 1)\ldots q_{n}(k-1)\big{)}\\ q_{j}(k)&=f_{j}\big{(}X_{I},q_{1}(k)\ldots q_{j-1}( k),q_{j}(k-1)\ldots q_{n}(k-1)\big{)}:j=2\ldots n\end{split}  \tag{2}\]  
For computing, the \(q_{i}\) variable value corresponds to the \(i\)-th rung (2); all preceding variables \(q_{1}\ldots\)\(q_{i-1}\) should be already computed (propagated through). Let there be defined set \(X_{D}=\{d_{1}\ldots d_{n}\}\) of variables associated with flip-flop inputs, representing respective coils. When the active edge of the clock signal is applied, all variables are updated at once:  
\[q_{i}=d_{i}:i=1\ldots n \tag{3}\]  
The Equation (2) before updating the flip-flops can be put down, as follows:  
\[ \begin{split} d_{1}(k)&=f_{1}(X_{I},q_{1}(k-1) \ldots q_{n}(k-1))\\ d_{j}(k)&=f_{j}\big{(}X_{I},d_{1}(k)\ldots d_{j-1}( k),q_{j}(k-1)\ldots q_{n}(k-1)\big{)}:j=2\ldots n\end{split}  \tag{4}\]  
Replacing variable \(q_{j}(k)\) by \(d_{j}(k)\) in all functions corresponding to the computations, described by respective rungs of the ladder diagram, enables the simultaneous update of all variables associated with the coils to become possible. \(\square\)  
The illustration of Theorem 1 is shown in Figure 2. Case A depicts an exemplary ladder diagram. Dashed line arrows show \(q_{1}\) and \(q_{2}\) variable references. The \(q_{1}\) variable is referred to by rungs 1 and 3. The switch, referring \(q_{1}\) variable in the rung 1, uses the value coming from the previous cycle or in the first cycle as an initial value. The new value will be assigned after completing the analysis of all switches in the rung. In rung 3, when referring to the \(q_{1}\) variable, its value is already processed, and the new value is assigned. Using a single cycle update, the \(q_{1}\) variable still holds the value from the previous cycle, and the \(d_{1}\) variable is used instead. It holds the value of a new \(q_{1}\) value. It is used in place of the \(q_{1}\) variable, referenced by switches. The \(q_{2}\) variable is referred to by the preceding rung, so that the previous value stored in the \(q_{2}\) variable is used. The essential issue in building a single cycle computation model via the ladder diagram is the variable reference, depending on the value assignment.