Based on a design i found for a relay ALU, i have constructed an ALU that i believe is 'compact' for the amount of operations it can perform.
My first step was to build the following circuit:
This circuit may seem basic, and it is. However, this is a functional 1-bit ALU with 16 bitwise operations. green wool is the output, the two blue wools are the inputs, and the yellow wools on top tell it what bitwise function to perform. For example, by turning on all the yellow wools (there are levers on the back of them) except rightmost (the one on the right of the picture) one, the green wool will output the bitwise or of the two blue inputs. There are 16 combinations of input states, and there are 16 operations it can perform. (This is a lie because some of these 'operations' are not relly operations.)
Right now i can not construct a truth table what settings of the yellow wools will result in what operation, (server that i built this on is down >_> ), but i know they are: not x, not b, a and b, a nand b, a or b,a nor b, a xor b, a xnor b, a (just output a), b (just output b), 0 (just output 0), 1 (just output 1), b and !a, a and !b, !(b and !a), !(a and !b). As you can tell some of the 16 functions are not very useful.
The next step is to add addition, subtraction, and left/ right carry. Addition/subtraction will be easy. All i have to do is set the above circuit to function like an xor gate and wire another xor gate to its output.
This is the finished ALU:
In addition to the 16 functions listed above, it can also perform Addition, subtraction, as well as left and right shifting. (I think i messed up right shifting, going to have to check that out >_> )