boolean formula for logic gate - Search