Boolean Operators

Computer Science: OCR A Level, topic 4.3.3

Boolean Operators

Boolean operators perform logical operations on boolean variables and always return another boolean variable.

AND

AND

  • AND evaluates to True (1) if and only if both operands are True (1).
  • '.' is the symbol for the AND operator.
OR

OR

  • OR evaluates to True (1) if any of the two operands are True (1).
  • '+' is the symbol for the OR operator.
NOT (negation)

NOT (negation)

  • NOT negates a logical value.
  • The symbol for the NOT operator is a line above the variable.
  • For example, NOT AA is written as A‾\overline{A}.
XOR

XOR

  • XOR means 'exclusive OR'.
  • The symbol for the XOR operator is ⨁\bigoplus.
NAND

NAND

  • NAND means NOT AND.
  • AA NAND BB is written as A.B‾\overline{A.B}.
NOR

NOR

  • NOR means NOT OR.
  • AA NOR BB is written as A+B‾\overline{A+B}.

Test yourself on Boolean Operators

  • Which Boolean operator takes only one value as input?

  • What does the operation 0 NAND 0 evaluate to?

Practise this topic for free