nand gate function - Search