Matrix and Vector Calculation with 8-, 16-, or 32-bit Modular Arithmetic
This project demonstrates that modular arithmetic with modulus
Therefore, we propose algorithms based on modular arithmetic as an alternative approach to processing data in a pseudo finite field.
The algorithms presented in this project perform faster than those for Galois Fields. However, there is an important trade-off:
- For
$a \times b = c$ , where$a, b, c \in \mathbb{Z}$ :-
If
$a$ is odd, there exists a$d$ such that$$d \times c = b, \quad \text{i.e.,} \quad d = a^{-1}$$ -
However, if
$a$ is even, there is no$d$ such that$$d = a^{-1} \quad \text{and} \quad d \times c = b$$
-
In other words, elements that are odd (i.e., coprime with
To arreviate this restriction, we included an example solution for an even
Herein, if we mulitply
Therefore,
holds. In other words,
This indicates that even if
However, there arises a question "What is the value of the highest bit of
To determine the correct value of the highest bit of
Then, we get
Thus for
You can clone the repository using:
git clone https://github.com/scopedog/mod_mtrx.gitand make the executable:
cd mod_mtrx
make