Boolean Operators

Let bdi(x) correspond to the (i+1)th digit of x in base-b. That is to say the digit of x in units of bi. bd0(x) is therefore the least significant digit, units. i∈{0, 1, 2, ...} for the integer part of x, and i∈{−1, −2, −3, ...} for the fractional part. We can mathematically define bdi(x) thus: bdi(x) = [x×b−i] − b×[x×b−i−1], where [α] denotes the integer part of α throughout this page.

Given this definition, the positive Boolean operators can be defined by the following summations:

Note that these operators take vector arguments, x, defined as the vector (x1, x2, x3, ..., xn). The limits on the primary summations are the minimum requirements. The upper limit could be taken as infinite, but no higher value is necessary since all higher order digits will be zero. Technically, the lower limit could be reduced to some negative value to allow for the fractional part of the arguments (in which case the magnitude of the limit would represent the precision of the calculation) but these functions are usually used for calculations involving integers.

When dealing with potentially negative numbers, it is usual in Boolean logic to set an upper limit on the range that numbers can take. Say this is limit is to N binary digits. We would then use the greatest unit of 2, the Nth digit, to represent −2N instead of 2N. This way, by setting the value of this digit from 0 to 1, one would effectively change a positive number to its negative counterpart. If you are dealing with negative numbers in this way, you should replace all of the upper limits on the primary summations above with N.

The negative Boolean functions, as defined below, require this arbitrary upper limit to be set, since they perform transformations across the entire range of the digits, even when the high order digits are set to 0. Using the definition of N as defined above, we now have NOT(0)=−1 and NOT(−1)=0.

Below are single digit truth tables for the operators using both two and three arguments as examples of how they work:

x1x2AND(x)OR(x)EOR(x)NAND(x)NOR(x)NEOR(x)
00000111
01011100
10011100
11110001

x1x2x3AND(x)OR(x)EOR(x)NAND(x)NOR(x)NEOR(x)
000000111
001011100
010011100
011010101
100011100
101010101
110010101
111111000

Help! Maths!