Computer ScienceExam code: 0984

Boolean Logic and Expressions

Boolean Logic

Cambridge papers and mark schemes for this syllabus write logic expressions in words (the word form below), so write your answers the same way. The other two columns show the symbols that other books use, so that you can read them.

OperatorWord formAlgebraic formOther forms
ANDA AND BA · BAB, A ∧ B
ORA OR BA + BA ∨ B
NOTNOT A¬AA̅ (overbar), A'
NANDA NAND B¬(A · B)(A · B)', overbar over the bracket
NORA NOR B¬(A + B)(A + B)', overbar over the bracket
XORA XOR BA ⊕ B(A · ¬B) + (¬A · B)

A few important conventions:

  • The dot · for AND is often dropped, just like in ordinary algebra. So AB means "A AND B", and AB + C means (A AND B) OR C.
  • + here means OR, not numerical addition. 1 + 1 in Boolean algebra is 1, not 2.
  • An overbar over a variable (or group of variables) means NOT. The mark schemes for this syllabus write the word NOT instead.
  • Variables are always single letters. Take them from the question: inputs are often A, B and C but can be other letters (such as P, Q, R or X, Y, Z), and in the papers the output is usually X, Z or W.

(highest to lowest): brackets → NOT → AND → OR.

This mirrors school algebra: brackets first, then unary −, then ×, then +. As in algebra, brackets remove all ambiguity, so when in doubt, add brackets.

Quick check

4 short questions on this note. See what has stuck, and where to look if something hasn't.

About 2 minutes

Build on this topic