Boolean logic - OCROR gates

At the simplest level, computers are little more than a collection of transistors and circuits. They connect together to form logic gates, which in turn are used to form logic circuits.

Part ofComputer ScienceComputational thinking, algorithms and programming

OR gates

An OR gate, also called a , uses two to generate one . The output is 1 (TRUE) only if either or both of the inputs are 1 (TRUE).

OR gates are represented diagrammatically as

Two separate OR gates representing TRUE outputs

A represents the first input. B represents the second input. Q represents the output.

A shows, for each combination of inputs, what the output will be. An OR gate is represented in a truth table as seen below.

ABQ
000
011
101
111
A0
B0
Q0
A0
B1
Q1
A1
B0
Q1
A1
B1
Q1

This OR gate is represented in as one of:

  • A OR B
  • A \/ B
  • A+B