How do I perform logical operations without a micro-controller?
You can average two analog voltages - which is equivalent to adding them, effectively -  with a resistor divider:







simulate this circuit &ndash; Schematic created using CircuitLab

This only works if your inputs, A and B, have low impedance compared to R1 and R2 - that is, they're capable of supplying a lot more current than these resistors will draw, meaning their voltage won't be affected much by the divider. That's definitely not the case for something like a photodiode, so you'll need a buffer that measures the photodiode signal and reproduces it with much lower impedance - something like this:







simulate this circuit

To compare voltages, you want a comparator. A comparator takes two inputs, and outputs a high voltage if the positive input is greater than the negative input, and a low voltage otherwise.

Collectively, you'd configure the whole thing something like this:







simulate this circuit

For each of the other outputs, you could reuse the opamp buffers, but use separate resistors and comparators to sum the outputs you need.