Topic 2 · Notes

Logical operations

These notes are part of the Study subscription

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

Preview

Boolean logic and notation

A Boolean value has only two states: True or False, written 1 or 0. Logical operations take Boolean inputs and give a Boolean output.

OperationWrittenAlso writtenOutput is 1 when…
NOTA̅ (a bar over A)¬A, NOT AA is 0
ANDA . BA ∧ B, A AND Bboth A and B are 1
ORA + BA ∨ B, A OR BA or B or both are 1
XOR (exclusive OR)A ⊕ BA XOR BA and B are different

On paper, NOT over a whole expression is a bar over the whole of it. On this site that is written NOT(A + B).

Order of operations: brackets first, then NOT, then AND, then OR. So A + B . C means A + (B . C), just as 2 + 3 × 4 means 2 + (3 × 4).

Logic gates in a circuit do the same operations on electrical signals: high voltage is 1, low voltage is 0.

Also in these notes

  • Truth tables: NOT, AND, OR and XORAS
  • Building a truth table for an expressionAS
  • Logical operations in programsAS
  • Bitwise operations and maskingAS
  • Clearing a registerAS
  • Boolean identitiesAS
  • Simplifying expressionsAS
  • NAND and NORA2
  • De Morgan's lawsA2
  • Masking for encryptionA2