# Prospects for the Use of Quasi-Mersen Numbers in the Design of Parallel-Serial Processors
## 2 Results
### Scheme of a Trigger Adder Modulo a Quasi-Mersenne Number
Let us consider the operation of the circuit in Figure 3 in more detail, taking into account that the nature of its functioning depends on the specific value of the summation result, which corresponds to the signals generated at the output of adders (\(1_{i}\)). In particular, the case when two numbers corresponding to the binary representation of the form (4) are summed is exceptional. The logical AND element (3) takes this exceptional case into account. When two numbers of the form (16) are summed, a logical one is formed at the output of the adder carry bit (\(1_{k+1}\)). Accordingly, a logical one is also formed at the output of element (3), which is transferred to the second gatherings of adders in the second line with numbers from \(1\) to \(k\). The adder with number \(k+2\) is absent in the second line. Consequently, transferring a logical one to the inputs of the adders indicated above effectively means that the number \(2^{k+1}\) is subtracted from the number formed at the output of the first line of adders, and a number that contains exactly \(k\) ones in binary representation is added. We emphasize that the circuit in Figure 3 includes not \(k\), but \(k+1\) adders. This is necessary because there is an exceptional case when the output of the adder (\(2_{k+1}\)) differs from one. This case corresponds to the maximum number that can arise in calculations within the Galois field corresponding to a quasi-Mersenne number, i.e., a number that in binary representation has the form (16). Accordingly, when two numbers of the form (16) are summed modulo \(2^{k}+1\), the number \(2^{k}+1\) should be subtracted from the result of direct summation. This corresponds to subtracting the number \(2^{k+1}\), which is achieved by the absence of an adder numbered \(k+2\) in the circuit under consideration, followed by the addition of the number \(2^{k+1}-2^{k}-1=2^{k}-1\). In binary representation, the last number is displayed as follows: The number \(2^{k}\) in binary form is written similarly to Formula (16)  
The difference \(2^{k+1}-2^{k}=2^{k}\) is written as  
\[2^{k}=1\underbrace{00\ldots 0}_{k} \tag{17}\]  
Therefore, the number \(q=2^{k+1}-2^{k}-1\) is written as  
\[q=2^{k+1}-2^{k}-1=0\underbrace{11\ldots 1}_{k} \tag{18}\]  
This formula shows that technically, bringing the summation result to a value modulo \(2^{k}+1\) in the case under consideration essentially involves adding ones to all digits from the first to the digit with number \(k\). This is the operation performed by the circuit in Figure 3, or more precisely, by the adders in the second line (\(2_{i}\)). It is appropriate to emphasize that in this circuit, additional ones are fed to the inputs of adders with numbers \(1\) through \(k\), but are not fed to the adder numbered \(k+1\). As an example, let us consider the case when summation is performed modulo \(2^{2}+1=5\). In this case, both lines (\(1_{i}\)) and (\(2_{i}\)) of the adder in Figure 3 contain three single-digit adders. The maximum value of the numbers being summed is \(4\), or \(100\) in binary representation. Note again that in this case, the most significant digit with the number \(k+1\) (in this case, with the number \(3\)), is used only to represent this special case. When calculating in the Galois field \(GF(5)\), the two least significant digits are sufficient to represent the remaining elements. The sum of two numbers, \(4\), is equal to \(8\), or \(1000\) in binary representation. By discarding the most significant digit as a result of summation and adding the number \(3\) (written as \(11\) in binary representation), we exactly subtract the number \(5\), which gives the correct answer when summing modulo \(5\), i.e., \(3\). Thus, element (3) allows us to obtain an adequate answer in the special case considered above. All other summation results can be classified as follows. \[z:\left\{ \begin{array}{c}0\leq z<2^{k}\\ z=2^{k}\\ 2^{k}<z\leq 2^{k+1}-1\end{array} \right. \tag{19}\]  
In relation to the modulo 5 adder, this classification looks like this:  
\[z:\left\{