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.
| Operator | Word form | Algebraic form | Other forms |
|---|---|---|---|
| AND | A AND B | A · B | AB, A ∧ B |
| OR | A OR B | A + B | A ∨ B |
| NOT | NOT A | ¬A | A̅ (overbar), A' |
| NAND | A NAND B | ¬(A · B) | (A · B)', overbar over the bracket |
| NOR | A NOR B | ¬(A + B) | (A + B)', overbar over the bracket |
| XOR | A XOR B | A ⊕ B | (A · ¬B) + (¬A · B) |
A few important conventions:
- The dot
·for AND is often dropped, just like in ordinary algebra. SoABmeans "A AND B", andAB + Cmeans(A AND B) OR C. +here means OR, not numerical addition.1 + 1in Boolean algebra is1, not2.- 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,BandCbut can be other letters (such asP,Q,RorX,Y,Z), and in the papers the output is usuallyX,ZorW.
(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