Français

The OR gate

The OR gate outputs 1 as soon as at least one input is 1. It only outputs 0 if all its inputs are 0. Careful: if both inputs are 1, the output is 1 as well. It is not the “either… or” of everyday speech, it is an inclusive “or”.

In real life

A house alarm goes off if the door sensor OR the window sensor is triggered. The hallway light comes on if either of the two presence detectors sees someone. A computer uses it to say “at least one of these errors has occurred”.

The truth table

ABS
000
011
101
111

The symbol

The classic symbol looks like a curved arrowhead. The European symbol is a rectangle with ≥1 inside (“at least one input set to 1”). The 74HC32 integrated circuit contains four OR gates.

Your turn to play

Place the right gate and flip the inputs: when every row of the table is green, the lamp lights up.

Your turn: 4 questions

Answer and see straight away whether you were right. You need 3 right answers out of 4 to pass the page. Your score stays on this device, nothing is sent.

Frequently asked questions

What is the difference between OR and XOR?

OR outputs 1 if one input or both are 1. XOR (exclusive OR) outputs 1 only if exactly one of the two inputs is 1.

What is the truth table of the OR gate?

For two inputs: 00 gives 0, 01 gives 1, 10 gives 1, 11 gives 1. Only the 00 row gives 0.

How do you build an OR from AND and NOT gates?

With De Morgan's laws: A OR B = NOT( (NOT A) AND (NOT B) ). Three NOT gates and one AND gate are enough.

The other gates: The AND gate · The NOT gate · The XOR gate · The NAND and NOR gates · The truth table · All the pages