The M-ary Alphabet Codes page describes how the “m” code values are distributed around the unit circle, with code 0 at coordinate (1,0) or 1\angle 180^\circ in polar form. By convention, let us assume that all other points are placed in sequence while traversing the unit circle in a counter clockwise manner.

Assuming m points are distributed around the unit circle, operations between two points, a and b, can be expressed as follows.

AND Operation

With binary values (m=2) AND operations can be described as follows:

aba AND b
000
010
100
111

Notice that “a AND b” is minimum of a and b. Knowing this, the relationship can be written more generally as:

a AND b = min(a,b)

OR Operation

With binary values (m=2) OR operations can be described as follows:

aba OR b
000
011
101
111

Notice that “a OR b” is maximum of a and b. Knowing this, the relationship can be written more generally as:

a OR b = max(a,b)

XOR Operation

With binary values (m=2) XOR operations can be described as follows:

aba XOR b
000
011
101
110

Notice that “a XOR b” is sum of a and b, modulo 2. Knowing this, the relationship can be written more generally as:

a XOR b = (a+b) % m

NOT Operation

With binary values (m=2) NOT operations can be described as follows:

aNOT a
01
10

Notice that “NOT a” is a incremented by 1 then modulo 2. Knowing this, the relationship can be written more generally as:

NOT a = (a+1) % m