Logic gate simulator