Topic 13 · Notes

Logical operations

These notes are part of a subscription

6 sections covering the whole specification for this topic, with worked examples.

Preview

Logical operators

Computers make decisions with Boolean values: TRUE or FALSE, stored as 1 or 0. Logical operators combine them.

OperatorOutput is TRUE (1) when …In words
ANDBoth inputs are 1"A and B"
ORAt least one input is 1 (either or both)"A or B, or both"
NOTThe input is 0 (it reverses its one input)"not A"
XOR (exclusive OR)Exactly one input is 1 (the inputs are different)"A or B, but not both"

Truth tables list every possible combination of inputs and the output for each.

ABA AND BA OR BA XOR B
00000
01011
10011
11110
ANOT A
01
10

Also in these notes

  • Truth tables with more inputs
  • Solving problems with truth tables
  • Logical operators in programs
  • Logic gates and digital circuits
  • From Boolean algebra to modern circuits