S-boxes should be balanced (equal number of 0s and 1s in the boolean function truth table) Boolean functions must be non-linear Single bit changes on the input cause changes on 1/2 of the outputs Good ...
Now, the thing to remember is that we are using a CD4512 chip, whose truth table is shown below. The important thing to note here is that, in addition to the three multiplexer select controls, A, B, ...