What are logic gates?

Logic gates are like simple switches that help computers make decisions.

Imagine you have a toy car that only moves if two things happen: your friend pushes a button and you turn on the light. That’s like a logic gate called an AND gate, it needs both inputs to be "on" for the output to be "on."

Now, think of another toy where the car moves if either your friend pushes the button or you turn on the light. That's like an OR gate, it only needs one of the inputs to be "on" for the output to work.

There are also NOT gates, which act like a switch that flips things around. If the light is on, the NOT gate turns it off, and if it’s off, it turns it on.

These basic switches combine in clever ways to let computers do amazing things, just like how you can mix different colors of paint to make new ones!

Take the quiz →

Examples

  1. A light turns on only if both switches are flipped up.
  2. You can only enter the party if you have a ticket and know the password.
  3. A door opens when either of two buttons is pressed.

Ask a question

See also

Discussion

Recent activity