%0000 thru %1111 is the binary truth table for each boolean operation.
NULL is FALSE
Identity is TRUE.
the water in the beaker is neither a nor b (%0001)
the orange represents input b. (%0010)
the apple represents input a. (%0100)
the purple overlap between the apple and orange is %1000 in the truth table.
a is %1100 when including the overlap and a in the venn diagram.
notice in a beaker of only water and an apple this is %10
in a beaker of only water and an orange this is %10 too.
notice with evey added fruit (circle) into the venn diagram the amount of digits in the binary mask doubles and all existing bits are repeated next to itself once more.
so %0, %00, %0000 are all FALSE,
and %1, %11, %1111 are all TRUE.
%10 and %1100 are both a
and %01 and %0011 are both not a.
likewise %1100 is a while %1010 is b
likewhise %0100 is just a, while %0010 is just b
also %1000 is both a and b, but not one or the other by themself.
the result of the logic operand is simply ((%mask >> %b) >> (%a<<1)) & %1
where a and b are either one or zero. each
with bitwise operations you perform that using each coupling of the bits for a,b outputting to the same bit offset.
this expands to:
%11110000 which is a for 3 inputs
%11001100 which is b for 3 inputs
also note:
%11001010 which is c for 3 inputs
for 3 inputs it goes:
Code:
high bit: 2 to power 7 (128): all a,b,c
2 to 6 (64): both a,b
2 to 5 (32): both a,c
2 to 4 (16): just a
2 to 3 (8): both b,c
2 to 2 (4): just b
2 to 1 (2): just c
low bit: 2 to power 0 (1): none of a,b,c
this also expands to %111111110000000 which is a for 4 inputs
and so on.
it follows a very predictable pattern of permutations.
if you dump all the operations in order, counting values for last input to first input (a), it acts as a perfect clock counter.
for example:
%0000 thru %1111
dumps as %0 thru %11111111
basically adds the dimension c.
you can recurse this once more in order to add the dimension d. (%0 thru %1111111111111111)
and so on.
hope this helps blargg.
that is basically the grand unified ring theory of boolean logic in a nutshell.
%0000 thru %1111 basically map to a logic cube, that is a hypercube with each bit as an axis, each segment being 1 bit in length.
false/true is basically a one bit long line segment. being a beaker either with or without water.
false,!a,a,true is basically a square with one bit long line segments. being a beaker either with or without water, with or without an apple.
my poster shows 16 possibilities, and 16 operations has 4 bit truth tables, that being a venn diagram of two overlapping circles master card logo style, of which produces a cube centered in another cube with all nearest vertices connected of which each vertice a beaker containing water or not containing water, containing a partial apple or not containing a partial apple, containing a partial orange or not containing a partial orange, or containing a merged apple and orange or not containing a merged apple and orange, of which each segment is 1 bit long, for a total of 16 vertices and 32 segments
each neighbor vertice is only different by a single bit in its truth table.
i came up with a c code generator for each truth table set called Seles in 2002, using this permutation ring theory i call Morsyl.
however Seles got corrupted and no longer works.
i attempted to use Seles to reverse engineer the S-DD1 conversions between input and output for Star Ocean and Street Fighter Alpha 2, but the only existing dumps from Seles are for Star Ocean, and only contain the final output in each part of the dump.
it should have dawned on me that S-DD1 had to have used barrel shifting due to the massive size of the dumps.
my final goal was to combine the two models it produced in order to spawn a common conversion for the two games, however the emulator itself if compiled, would have been uncountably larger than the zSNES emulator, the star ocean/street fighter alpha 2 S-DD1 output, and the star ocean/street fighter alpha 2 roms combined.
it would prolly have compiled as a binary larger than the entire storage space of all of the net at the time.