It is a multiplier that uses and-gates to turn on lights with the right answer and the adder/substracter uses xor.It is binary so if you take (8+4)-4+2 you will get 4 and 2 if you add them together you get 6, the right answer. the adder is doing the same, just inverted.
for the multiplier you turn on a lever of the bottom row and the top to multiplie them together for the adder you have every number 2 times.
the substractor has two inputs so you take the left levers for 8 and 4 and the right lever for 4 to substract it.((8+4)-4) the lamps will give you the right answer.