## 2 Preliminaries
### The MD Algorithm
\begin{table}
\begin{tabular}{c c} \hline \hline
**Symbol** & **Description** \\ \hline \(p\) & The check factor of the LAC \\ \hline n & The bit number of modulus M \\ \hline \(w\) & The word size of PE (\(w\)\(\in\)[8, 16,32,64]) \\ \hline \(e\) & The number of words in operands \(e=\lceil n/w\rceil\) \\ \hline \(X^{i}\) & The value of X at the \(i\)-th iteration of Algorithm 2 \\ \hline \(X_{k}\) & The k-th word of \(X\) (X can be A, B, R, or S) \\ \hline \(L(X_{k})\) & The least significant bit (LSB) of \(X_{k}\) \\ \hline \(L^{*}(X_{0})\) & Bits 1 to 0 from \(X_{0}\) \\ \hline \(H(X_{k})\) & Bits \(w-1\) to 1 from \(X_{k}\) \\



**Algorithm 2** Proposed word-oriented MD Algorithm with concurrent error detection
```
Input:\(X=\sum_{k=0}^{\ell-1}X_{k}2^{kw},\ Y=\sum_{k=0}^{\ell-1}Y_{k}2^{kw},M=\sum_{k=0}^{ \ell-1}M_{k}2^{kw}\) Output: R(RY N X mod M)
```

```
1:Initialization
2:\(i=0,\varnothing^{0}=1,\ \delta^{0}=1\)
3:\(\left\{A^{0},B^{0},R^{0},S^{0}\right\}\leftarrow\{Y,M,X,0\}\)
4:for\(\{k=0\ to\ k<e\}\)do
5:\(\left\{ \begin{matrix}\overrightarrow{A},\overrightarrow{B},\overrightarrow{R },\overrightarrow{R},\overrightarrow{S}\\ \overrightarrow{R},\overrightarrow{R},\overrightarrow{S}\end{matrix} \right\}= \left\{\left[Y_{k}\right]_{p},\left[M_{k}\right]_{p},\left[X_{k}\right]_{p},0\right\}\)
6:\(\left\{ \begin{matrix}\overrightarrow{A},\overrightarrow{B},\overrightarrow{R },\overrightarrow{R},\overrightarrow{S}\\ \overrightarrow{R},\overrightarrow{R},\overrightarrow{S}\end{matrix} \right\}= \left\{\left[Y_{k}\right]_{p},\left[M_{k}\right]_{p},\left[X_{k}\right]_{p},0\right\}\)
7:if\(\left\{ \begin{matrix}\overrightarrow{A},\overrightarrow{B},\overrightarrow{R },\overrightarrow{R},\overrightarrow{S}\end{matrix} \right\}=\left\{ \overrightarrow{A},\overrightarrow{B},\overrightarrow{R},\overrightarrow{R },\overrightarrow{S},\overrightarrow{S}\end{matrix}\right\}\)then exit
8:end for
9:\(\left.\right.\) //Modular division computation
10: While \(A^{i}\
eq\pm 1\)do
11:\(i=i+1\)
12:\(\left.\right.\) //Control Element
13:\(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\) \(\left.\right.\) \(\left.\right.\) \(\left.\right.\) \(\left.\) \(\left.\right.\) \(\left.\right.\) \(\left. \begin{tabular}{l l} \hline \hline
13: & \(\delta^{i}=\left\{\begin{array}{ll}1+\delta^{i-1}\text{ if }&\left(\lambda^{i}=0\right)\\ 1-\delta^{i-1}\text{ if }&\left(\lambda^{i}=1\right)\end{array}\right.\) \\
14: & \(CA_{-1}^{i}=\left(L(A_{0}^{i-1})+\alpha^{i}L(B_{0}^{i-1})\right)/2\) \\
15: & \(CR_{-1}^{i}=\left(L(R_{0}^{i-1})+\alpha^{i}L(B_{0}^{i-1})+\beta^{i}L(M_{0}) \right)/2\) \\
16: & for \(\left[k=0\text{ to }k<\epsilon\right]\text{ do}\) \\
17: & \(/\text{PE}_{\text{k}}\) Module \\
18: & \(/\text{Actual Check Part Generation }(\text{ACCP}_{\text{k}})\text{Module}\) \\
19: & \(/\text{Check Part Predictor }(\text{CP}_{\text{k}})\text{ Module}\) \\
20: & \(/\text{if }\left(\overline{A}_{-k}^{i},\overline{B}_{-k}^{i},\overline{S}_{-k}^{i},\overline{S}_{-k}^{i}\right)\right)\
eq\left(\overline{A}_{-k}^{i},\overline {B}_{-k}^{i},\overline{S}_{-k}^{i}\right)\) then exit \\
21: & end for \\
22: & end while \\
23: & if \(A^{i}=-1\) then \(R^{i}=-R^{i}\) \\
24: & \(R=R^{i}\) \\
25: & return \(R\) \\ \hline \hline \end{tabular}   
The EDM encompasses \(e\) sub-ED elements (\(\text{ED}_{\text{e}-1}\), \(\text{ED}_{\text{e}-2}\), \(\dots\), \(\text{ED}_{1}\), \(\text{ED}_{0}\)). Each of them detects the errors in a specific PE. Once an error is detected in one of the PEs, the EDM will issue an alarm immediately and terminate the MD process. The structure of \(\text{ED}_{\text{k}}\), shown as Figure 3, contains three components: \(\text{ACPG}_{\text{k}}\), \(\text{CPP}_{\text{k}}\), and \(\text{CMP}_{\text{k}}\).