OR

Inputs

PinTypeDescription
AbitFirst input signal
BbitSecond input signal

Outputs

PinTypeDescription
Qbit1 if A=1 or B=1

How It Works

The OR gate means "at least one". An alarm goes off if the door OR the window is open — it does not care which one. In a circuit it is two switches connected in parallel: current reaches the lamp if at least one of them is closed.

The key property of OR: the output is 1 if at least one input is 1, and only the combination 0 and 0 produces 0. It is called logical addition, with a caveat: 1+1 gives not 2 but 1 again — the gate cannot count, it only answers the question "is there at least one one?". Example: checking whether at least one of two buttons is pressed.

Interestingly, OR can be built without an OR gate at all. By De Morgan's laws, OR(A,B) = NOT(AND(NOT A, NOT B)): invert both inputs and pass them through a NAND — you get an honest OR. In the game this is not just theory: that is exactly how you assemble OR at Level 4 from the parts you already know.

Truth Table and Examples

ABQ
000
011
101
111

Example of combining alarms: the "Attention" lamp lights up if the processor overheats (A=1) OR the voltage drops (B=1). Two failures at once light the same lamp — OR does not tell you how many problems there are, only that at least one exists.

Usage

OR is unlocked at Level 4 and keeps showing up ever after: in the full adder it merges two partial carries, on buses BusOR blends several data sources, and in decoders it helps assemble complex conditions from simple signals.

Its second typical role is working with flags. A processor keeps result attributes in separate bits: "zero", "carry", "overflow". The instruction "interrupt the program if the overflow flag OR the division-by-zero flag fires" is literally a single OR gate over two bits. This is how separate signals combine into one decision.

Interactive Demo

Click inputs to toggle value (0 / 1)

Build it yourself →

Related components

Related articles

Frequently Asked Questions

How does OR differ from XOR?

OR gives 1 when at least one input is 1 — including the case when both inputs are 1. XOR excludes that case.

How do I build OR from NAND?

Invert both inputs with NOT gates and feed them into a NAND: by De Morgan, NOT(AND(NOT A, NOT B)) is exactly OR. Three gates in total.

What if I feed the same signal into both inputs?

OR(A,A) = A: a one passes through either input, and so does a zero. With a duplicated signal the gate becomes a transparent repeater.