Simulate logic gates in a circuit