Figures
Abstract
An alternating representation of integers in binary form is proposed, in which the numbers -1 and +1 are used instead of zeros and ones. It is shown that such a representation creates considerable convenience for multiplication numbers modulo p = 2n+1. For such numbers, it is possible to implement a multiplication algorithm modulo p, similar to the multiplication algorithm modulo the Mersenne number. It is shown that for such numbers a simple algorithm for digital logarithm calculations may be proposed. This algorithm allows, among other things, to reduce the multiplication operation modulo a prime number p = 2n+1 to an addition operation.
Citation: Suleimenov IE, Vitulyova YS, Matrassulova DK (2023) Features of digital signal processing algorithms using Galois fields GF(2n+1). PLoS ONE 18(10): e0293294. https://doi.org/10.1371/journal.pone.0293294
Editor: Pierluigi Vellucci, Roma Tre University: Universita degli Studi Roma Tre, ITALY
Received: March 10, 2023; Accepted: October 10, 2023; Published: October 25, 2023
Copyright: © 2023 Suleimenov et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Data Availability: There is no additional data, all data is available in the article itself.
Funding: This research has been/was/is funded by the Science Committee of the Ministry of Higher Education and Science of the Republic of Kazakhstan (Grant No. AP14870281) The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript. All authors receive a salary from the received research grant.
Competing interests: The authors have declared that no competing interests exist.
Introduction
Currently, non-binary Galois fields are increasingly used in information technologies [1, 2], in particular, in information security systems [3, 4]. The example is a variety of Galois fields GF(p), which are residue classes of the ring of integers modulo some prime number p. The advantages of using such fields for digital signal processing were clearly demonstrated in [5, 6].
There is also a number of reports devoted to the development of electronic circuits that perform addition and multiplication operations modulo in current literature, for example, [7, 8]. Such reports are closely related to research in the field of practical use of Galois fields, since the operations of addition and multiplication modulo an integer can be considered as operations on the elements of the Galois field. The interest is connected, among other things, with the fact that such operations are of significant interest for cryptography [9, 10].
The development of electronic circuits operating in Galois fields is also of interest from the point of view of improving artificial intelligence (AI) systems. Namely, as it was shown in the reports [11, 12] the further development of AI, assuming its gradual approach to the biological prototype, cannot exclude the transition to multivalued logic, since human thinking is irreducible to binary logic. It is appropriate to emphasize that the problem of creating of AI approaching a biological prototype is of considerable interest, including from the point of view of revealing the essence of intelligence as such [13, 14].
Multivalued logic, dating back to the works of Jan Lukasiewicz [15], has been actively developing recently [16–19], but the level of its practical use obviously does not meet the existing potential [11]. If the number of values accepted by variables of multivalued logic is equal to an integer power of some prime number, these values can be put in one-to-one correspondence to the elements of the Galois field. Consequently, any operations in this case are reduced to addition and multiplication, i.e., the improvement of electronic circuits that perform addition and multiplication modulo an integer is also of interest from this point of view. The possibilities arising in this case are disclosed, in particular, in [20].
In turn, among the simple Galois fields GF(p), a special place is occupied by fields for which the number p is equal to the Mersenne prime number. Such numbers are representable as
(1)
where n are specifically selectable integers, the first of which are, 2, 3, 5, and 7.
Such numbers are used, in particular, to generate pseudorandom numbers [19]. Specifically, a pseudorandom number generator called the Mersenne twister is known, developed in 1997 by Japanese scientists M. Matsumoto and T. Nishimura [21], directly based on the use of Mersenne numbers.
There are works in which the expediency of using such numbers for data transmission is justified [21, 22], etc.
A very remarkable feature of the Mersenne numbers pm is the fact that Galois fields GF(pm) allows one to implement fairly simple electronic circuits that perform addition and multiplication operations modulo pm, i.e., those operations to which any other operations performed on the elements of the field GF(pm) are reduced. Examples of such systems and algorithms of their functioning are reflected in the current literature, for example [23].
In this paper, it is shown that Galois fields, GF(p), for which p = 2n+1., are also of considerable interest for digital signal processing. One of these fields is the GF(257) field, which is advisable to use for digital signal processing with a standard number of levels equal to 256. Thus, it can be argued that for this case there is a very specific Galois field, which, among other things, allows you to bring signals that meet existing standards [24], to logical operations.
Advantages of Mersenne numbers for computing systems modulo an integer
In relation to digital signal processing, the following property of Mersenne numbers is of interest. Multiplication of a number a written in binary form by 2 modulo the Mersenne number is recused to cyclic permutation of characters takes place. For example, for calculations in the field GF(7), next equality is true
(2)
where ai are binary characters.
The convenience of using such a property for digital signal processing in Galois fields is as follows. Let us consider the field GF(127) whose characteristic is a Mersenne number with n = 7. Note that this example is also important from a practical point of view, since a scale with 127 levels is often used in digital signal processing too. In binary form, any of the elements of the GF(127) field can be represented as
(3)
We emphasize that the number of elements represented in the form (3) when calculating in terms of ordinary integers is 128, but
(4)
Consequently, the number of field elements given by Formula (3) is indeed 127.
Let the element A, represented in the form (3), be multiplied modulo 127 by the element B, represented in the same form.
Then the result of the product is the sum of the following terms
(6)
Grouping the terms at the same powers of two, we get
(7)
We emphasize that although Formula (7) include only quantities taking the values 0 or 1, no such restrictions are imposed on the summation result itself, i.e., the sum is calculated in the sense of the original field GF(127).
The algorithm based on Formula (7) allows for a fairly simple circuit implementation, therefore, it makes sense to consider whether there is no way to implement its analogue for fields GF(2n+1), in particular, for the field GF(257). This is due to an obvious consideration: the signal digitization scale, which provides for the use of 256 levels, is one of the most common [24].
Algorithms of calculations modulo in the special case of the field GF(17)
Let’s start from the consideration of one of the simplest fields of type GF(2n+1), specifically from the field GF(17).
This field, as well as other Galois fields, is a ring of residue classes of the ring of integers, in this case modulo 17. Traditionally, positive integers are used when representing field elements, however, this is not mandatory at all. In particular, as emphasized in [25], it is advisable to use a set of elements {−1,0,1} to represent the field GF(3), where the use of curly brackets emphasizes that the set is being considered.
Similarly, the field GF(17) can be considered as a set of elements
(8)
The selection of the representing elements is arbitrary up to the modulo comparison operation, for example,
(9)
The advantages of such a choice for the purposes of this work are demonstrated by Tables 1 and 2. In these tables, the degrees of the elements of the field under consideration are counted in the usual representation through positive integers and in the representation (8), respectively.
Both tables demonstrate the fact that all nonzero elements of the field under consideration, as follows from the general theory of Galois fields, obey the equation
(10)
From this relation, in particular, it follows that any element of the field under consideration can be represented as
(11)
where si = 0; 1.
We show this by first revealing the meaning of the formal notation using Tables 1 and 2.
The ratio (10) can be rewritten in the form
(12)
Formula (12) emphasizes that there are only two different values of the element z = x8. This corresponds to the fact that in the fourth column of Tables 1 and 2 there are only two different elements.
There are two other similar forms of representation of the relation (10).
Formula (13) emphasizes that there are four different values of the element z = x4, which are found in the third columns of Tables 1 and 2. Similarly, as the ratio (14) shows, there are eight different elements z = x2, which are found in the second columns of these tables.
Accordingly, formally we can write
(15)
(16)
(17)
The eight remaining y elements highlighted in Tables 1 and 2 in color represent primitive elements. They have the property that ym = 1 if and only if m = 16. We have
(18)
The proved relation (11) follows directly from Formulas (15)–(18), and the choice of elements is determined by the following considerations. Any nonzero element of the field under consideration represents some degree of one of the primitive elements y listed in the right part of Formula (18). This follows from the general theory of Galois fields, and for clarity it can be demonstrated as follows.
All the degrees of the primitive element y of the field under consideration from 0 to 15 are different. At the same time, all these degrees are the roots of Eq (10), i.e., they exhaust the elements of the field.
Consider the power of ym and represent the number m, where 0≤m≤15 in binary form
(19)
where mi are binary characters.
Therefore, the degree ym is representable as
(21)
This expression coincides with (11) if we put the corresponding root of unity equal to one of the powers of the primitive element appearing in (21).
For further it is essential that when moving to the representation of the elements of the field under consideration in the form (8), the roots of unity (15)–(18) acquire a symmetrical form that and shows Table 2.
This determines the convenience of representation in the form (8): all elements of the field under consideration, with the exception of primitive ones, are representable as powers of two, which is also emphasized by Table 2.
This fact generates another efficient algorithm for multiplying field elements, de facto based on the digital logarithm method. Digital logarithm has been considered in many reports, in particular in [26, 27], but this problem, if put in a general form, remains unresolved.
However, for practical needs, it can be limited to solving it for specific Galois fields. In particular, within the framework of this work, it is solved in relation to Galois fields of the form GF(2p+1), which, as noted above, also includes the field GF(257), which corresponds to the number of digital signal levels that is often used in practice.
In relation to the GF(17) field, the digital logarithm algorithm can be constructed as follows.
- The field element is identified as belonging to a set of primitive elements.
- If this element belongs to the specified set, then the value of m1 in Formula (21) is chosen to be 1, if not, then zero.
- If m1 = 1, then the element in question is multiplied by 3 modulo 17. As a result of the representation in the form (8), the element is reduced to the power of two. When using binary notation, this means that the logical unit will stand only on one of the positions, which identifies the exponents m2, m3 and m4.
- The set of exponents of degrees mi completes the procedure of digital logarithm.
Solving the digital logarithm problem, in turn, makes it possible to significantly simplify the algorithm for multiplying field elements on each other. Indeed, in this case, the operation is reduced to the addition of numbers (20) modulo 16. Carrying out such an operation by circuit means does not cause difficulties, since it boils down to the usual addition of binary numbers with the rejection of the highest digit.
The described algorithm really makes it possible to significantly simplify the multiplication operation in the GF(17) field, but, firstly, the question of the circuit identification of primitive elements remains open, and secondly, this algorithm is very specific. Indeed, it is built on the fact that any of the primitive elements is reduced to the power of two (with a positive or negative sign) by multiplying by a fixed element (for example, by 3). This situation is not realized for other Galois fields of the type under consideration, in particular, for the field GF(257), which is of primary interest from the point of view of practical applications.
Alternating binary encoding
We show that the indicated problem is solved using alternating encoding of elements of Galois fields of the type under consideration.
Again, let’s start from the example of the field GF(17). Consider an expression of the form (3), but only now we will understand by ai the numbers taking the values +1 and -1.
It can be easily shown that the result of calculations by Formula (3) in this case will certainly give an odd number.
In total, there are 24 such combinations of the form (3), and the maximum number is
(27)
and, accordingly, Amin = −15.
Otherwise, the set of numbers given by Formula (26) coincides with the set of odd numbers in the range from -16 to +16. We exclude zero from consideration, which is quite justified, since the multiplication operation is being considered. Then the number of combinations of the form (26) in the case under consideration coincides with the number of non-zero elements of the field GF(17).
All possible combinations are listed in Tables 3 and 4. Table 3 refers to the elements of the field that are not primitive, Table 4 –vice versa. The first four columns of these tables display the numbers ai appearing in expressions (26), the fifth column displays the result of summation in terms of ordinary integers A1, the sixth–displays the result of reduction modulo 17 to the form (8) A.
It can be seen that the modulo reduction field of the numbers represented in the form (26) exhaust the set of nonzero elements of the field GF(17). Consequently, such a representation can be used along with any other, especially if we take into account that representatives of the residue classes of the ring of integers modulo a prime number can be chosen arbitrarily.
As applied to the field under consideration, a representation of the form (26) in which ai = ±1 has a property similar to the property possessed by Mersenne primes. Namely, the multiplication of the number written in the representation (26), which hereafter we will call alternating, by two can be displayed as the following operation
(28)
This follows from the fact that the element -1 is the root of Eq (12) considered at z = x8 or from the fact that in the field under consideration 24≡−1(17).
Consequently, the operation of multiplication by two when using an alternating binary representation of a number is reduced to a cyclic permutation of binary elements in the entry resulting from (18) with a change in the sign of the element being rearranged. We have
(29)
It can be seen that this property is indeed analogous to the property possessed by the operation of multiplication by two in fields formed using Mersenne numbers (2).
Property (29), in particular, allows you to implement an algorithm for multiplying two elements of the field GF(17), represented in alternating binary form, similar to the algorithm given by Formulas (6), (7).
Indeed, the result of multiplying the number A, represented in alternating form (26), by the number B, represented in the same form
(30)
it is the sum of the following terms
(31)
(32)
(33)
(34)
Grouping elements at powers of two, we obtain the following expressions for the coefficients ci, that arise when multiplying two elements of the field
(35)
(36)
(37)
(38)
It can be seen that in Formulas (35)–(38) the coefficients ai are rearranged cyclically with a sign change, which corresponds to the specifics of the field under consideration. We also emphasize that the coefficients ci are not necessarily equal to ±1, i.e., they are not coefficients in the representation of the form (26). These are the weights with which the powers of two are added when calculating the result of the product.
The algorithm based on Formulas (35)–(38) can be implemented quite simply schematically, moreover, it admits an obvious generalization to any fields of GF(2n+1). However, the fact that the coefficients ci are not coefficients in binary alternating representation makes us consider further simplifying the circuit implementation of multipliers in fields of the type under consideration.
Algorithmic basis of digital logarithm in the GF(2n+1) field
A significant simplification of the circuit implementation of the multiplier in the field under consideration can be achieved by using the digital logarithm operation, as noted above.
In relation to the field GF(17) under consideration, the operation of digital logarithm is reduced to the operation of circuit identification of primitive elements. As can be seen from Table 2, multiplication by a primitive element leads to the fact that the number becomes equal to the power of two, which is easily identified schematically when using binary representation.
To identify primitive elements, you can use the following technique, which follows from the property of a cyclic permutation with a change in the sign of the element being rearranged. In the Table 5 presents examples of continuation of the sequence of characters ai, appearing in the alternating binary representation of the elements of the field GF(17). Each of these sequences may include one additional element -a3, as illustrated in Table 5.
Let’s form the function Qj,j−1, which provides counting the number of sign variables in sequences similar to those presented in Table 5. This function is defined as follows
(39)
The values of qi values for non–primitive field elements are shown in Table 6, and for primitive elements—in Table 7.
The table data show that the sums ∑qi are invariants for the set of primitive elements of the field GF(17) (all of them, when using the alternating binary representation of the elements of this field, are formed by a cyclic permutation with a sign change), as well as for the set of elements that are not primitive. In one case, the invariant is 1, in the other– 3.
This approach, based on the calculation of invariants, can easily be generalized to other fields of GF(2n+1), which directly follows from the fact that multiplication by two reduces to a cyclic permutation with a sign change. In particular, the nonzero elements of the field GF(257) decompose into 16 subsets, each of which is formed by cyclic permutations of the type under consideration. This, in turn, follows from the fact that in the field GF(257) there is
(40)
Conclusions
Thus, along with a direct algorithm for multiplying numbers in alternating binary representation, given by Formulas (35)–(38), we can propose the following algorithm for performing the multiplication operation for fields GF(2n+1), in particular, for the field GF(17).
- The multiplied numbers are translated into binary alternating representation. This is provided by direct recalculation using the formula A = 2A0+1, where A0 is the original number, followed by the representation of the resulting odd number in the form (26).
- Using binary alternating coefficients of the number A = 2A0+1, the invariants ∑qi are calculated, which determine the division of the field into subsets, each of which corresponds to multiplication by a power of two.
- Multiplication is performed by the element corresponding to the invariant ∑qi. As a result, an element is formed that represents the power of two (taking into account the sign). This degree sets the digital logarithm of the field element in question.
- The exponents are added modulo the power of two, which schematically corresponds to the usual operation of adding binary numbers with dropping the highest digit.
- The reverse transition from the exponent to the non-zero element of the field GF(2n+1) is carried out.
In general, the paper shows that the use of alternating binary representation for elements of fields GF(2n+1) allows them to realize all the same advantages that occur when working with Galois fields corresponding to Mersenne primes.
The most important type of fields of this type is the GF(257) field, since it corresponds to the number of levels of the digitized signal, which is often used in practice. For example, the most commonly used analog-to-digital converters assume the use of 256 levels.
References
- 1. Lehnigk-Emden T., When N. Complexity evaluation of non-binary Galois field LDPC code decoders. 2010 6th International Symposium on Turbo Codes & Iterative Information Processing, IEEE, 53–57 (2010).
- 2. Isla H., Prakash O. New Quantum and LCD Codes over Finite Fields of Even Characteristic. Defence Science Journal, 71(5) (2021).
- 3. Kuo Y. M., Garcia-Herrero F., Ruano O., Maestro J.A. RISC-V Galois Field ISA Extension for Non-Binary Error-Correction Codes and Classical and Post-Quantum Cryptography, IEEE Transactions on Computers (2022).
- 4. Matsumine T., Ochiai H. A design of non-binary turbo codes over finite fields based on Gaussian approximation and union bounds, in 2018 IEEE 87th Vehicular Technology Conference (VTC Spring), 1–5 (2021).
- 5. Moldakhan I., Matrassulova D. K., Shaltykova D. B., Suleimenov I. E. Some advantages of non-binary Galois fields for digital signal processing, Indonesian Journal of Electrical Engineering and Computer Science, 23(2), 871–877 (2021).
- 6. Vitulyova E. S., Matrassulova D. K., Suleimenov I. E. New application of non-binary Galois fields Fourier transform: Digital analog of convolution theorem, Indonesian Journal of Electrical Engineering and Computer Science, 23(3), 1718–1726 (2021).
- 7. Kalimoldayev M., Tynymbayev S., Gnatyuk S., Ibraimov M., Magzom M. The device for multiplying polynomials modulo an irreducible polynomial, News of the National Academy of Sciences of the Republic of Kazakhstan Series of Geology and Technical Sciences, 2(434), 199–205 (2019).
- 8. Dey S., Ghosh R. 4-bit crypto S-boxes: Generation with irreducible polynomials over Galois field GF (24) and cryptanalysis, Cryptology ePrint Archive (2018).
- 9. Kuppuswamy P., Al-Khalidi S. Q. Implementation of security through simple symmetric key algorithm based on modulo 37, International Journal of Computers & Technology, 3(2), 335–338 (2012).
- 10. Verkhovsky B. S. Enhanced Euclid Algorithm for Modular Multiplicative Inverse and Its Application in Cryptographic Protocols, Int. J. Commun. Netw. Syst. Sci., 3(12), 901–906 (2010).
- 11. Gabrielyan O.A., Vitulyova Ye. Suleimenov S., I. E. Multi-valued logics as an advanced basis for artificial intelligence, Wisdom, 1(21), 170–181 (2022).
- 12. Vitulyova Y.S., Bakirov A.S., Baipakbayeva S.T., Suleimenov I.E. Interpretation of the category of complex in terms of dialectical positivism, IOP Conference Series: Materials Science and Engineering, 946(1), 012004. (2020).
- 13. Gabrielyan O.A., Vitulyova Ye. S., Suleimenov I. E. Multi-valued logics as an advanced basis for artificial intelligence, Wisdom, 1(21), 170–181 (2022).
- 14. Suleimenov I. E., Matrassulova D. K., Moldakhan I., Vitulyova Y. S., Kabdushev S. B., Bakirov A. S. Distributed memory of neural networks and the problem of the intelligence’s essence, Bulletin of Electrical Engineering and Informatics, 11(1), 510–520 (2022).
- 15.
Lukasiewicz J. “On Three-Valued Logic,” Jan Lukasiewicz. Selected Works / Ed. by Borkowski L., Amsterdam: North-Holland, 87–88 (1970).
- 16. Zamansky A. On recent applications of paraconsistent logic: an exploratory literature review, Journal of Applied Non-Classical Logics, 29(4), 382–391 (2019).
- 17. Hernández-Tello A., Macías V. B., Coniglio M. E. Paracomplete Logics Dual to the Genuine Paraconsistent Logics: The Three-valued Case, Electronic Notes in Theoretical Computer Science, 354, 61–74 (2019).
- 18. Nakayama Y., Akama S., Murai T. Deduction System for Decision Logic Based on Many-valued Logics, International Journal on Advances in Intelligent Systems, 11(½), 115–126 (2018).
- 19. Suleimenov I. E., Vitulyova Y. S., Kabdushev S. B., Bakirov A. S. Improving the efficiency of using multivalued logic tools, Scientific Reports, 13(1), 1108 (2023). pmid:36670172
- 20. Shahov V.V. Review and comparative analysis of pseudo-random number generator libraries, Problems of computer science, 2, 66–74.
- 21. Matsumoto M., Nishimura T. Mersenne Twister: A 623-dimensionally equidistributed uniform pseudorandom number generator, ACM Trans. Model. Comput. Simulat., 8(1), 3–30 (1998).
- 22. Smirnov A. A., Bondar V. V., Rozhenko O. D., Mirzoyan M. V., Darjania A. D. Mersenne Numbers in the Bases of Systems of Residual Classes when Transmitting Data in Serial Communication Channels, Journal of Mathematical Sciences, 260, 241–248 (2022).
- 23. Kumar R., Jaiswal R. K., Mishra R. A. “Perspective and Opportunities of Modulo 2n−1 Multipliers in Residue Number System: A Review,” Journal of Circuits, Systems and Computers, 29(11), 2030008 (2020).
- 24.
Elaskary, R. M., Mehana, A. H., Fahmy, Y., El-Ghoneimy, M. Performance of digital predistorter in system with analogue to digital converter, IET Communications. https://doi.org/10.1049/cmu2.12443 (2022)
- 25. Suleimenov I., Bakirov A., Moldakhan I. Formalization of Ternary Logic for Application to Digital Signal Processing, In Energy Management of Municipal Transportation Facilities and Transport Springer, Cham, 26–35 (2019).
- 26. Moldovyan D. N. New form of the hidden logarithm problem and its algebraic support, Bul. Acad., Stiin¸te Repub. Mold. Mat. (2020).
- 27. Cheng T., Masuda Y., Chen J., Yu J., Hashimoto M. Logarithm-approximate floating-point multiplier is applicable to power-efficient neural network training, Integration, Elsevier, 74, 19–31 (2020).