Overview

OR operation


More Like This

Show all results sharing this subject:

  • Computing

GO

Show Summary Details

Quick Reference

The logical connective combining two statements, truth values, or formulas P and Q in such a way that the outcome is true if either P or Q or if both P and Q is true (see table). The latter outcome distinguishes the OR from the exclusive-OR operation. The OR operation is usually denoted by ∨ and occasionally by +. It is one of the dyadic operations of Boolean algebra and is both commutative and associative.

One way of implementing the OR operation (e.g. in Lisp) is to test P first, and then evaluate Q only if P is false. The resulting operation is noncommutative; in some languages there is a distinct notation for this.

When it is implemented as a basic machine code instruction, OR usually operates on pairs of bytes or pairs of words. In these cases the OR operation defined above is normally applied to pairs of corresponding bits.

OR operation. Truth table

Subjects: Computing.


Reference entries

Users without a subscription are not able to see the full content. Please, subscribe or login to access all content.