boolean expression for logic gates - Search