Addition and multiplication on numbers are the prototypical example of an operation that combines two elements of a set to produce a third.
Implement this Class to your project and call the method that you would to use, see examples below.
-
Download Jar File.
-
Using Intellij: File -> Project Structure -> Libraries -> (+) symbol -> From Jar ... Import just downloaded file.
/*
public static void main(String[] args) {
System.out.println(BAS.Mult("101", "100", "111")); // output: 100
System.out.println(BAS.Add("101", "100", "111")); // output: 110
}
*/
Addition: BAS.Add would work as
"XOR operator"
or (Z2, +) math-group.
/*
* + | 0 | 1
* ----------
* 0 | 0 | 1
* ----------
* 1 | 1 | 0
*
*/
Multiplication: BAS.Mult works as
"and operator"
(Z2, *) math-group.
/*
* * | 0 | 1
* ----------
* 0 | 0 | 0
* ----------
* 1 | 0 | 1
*
*/