← GCSE Computer Science · Eduqas · GCSE Computer Science revision
⭐ 0
Eduqas GCSE Computer Science · 2 Logical operations
Mini-Lesson

Logical operations

3 missions. Guess, learn, then check. Your place is saved.

  1. Mission 1"Tea or coffee?" Would a computer's OR let you have both?
  2. Mission 2Three sensors, one alarm: how many cases must you test?
  3. Mission 3Is A OR (A AND B) ever different from plain A?
Mission 1

"Tea or coffee?" Would a computer's OR let you have both?

Make a guess: "Tea or coffee?" Would a computer's OR let you have both?

Boolean logic · AND, OR, NOT

1 or 0, and NOT

NOTANOT A0110
  • A Boolean value has only two states: 1 (TRUE) or 0 (FALSE).
  • A truth table lists every possible combination of inputs with the output for each.
  • NOT has one input and reverses it: NOT 0 = 1, NOT 1 = 0.
  • NOT A is written with an overbar: A̅.
Boolean logic · AND, OR, NOT

AND

Truth tablesABA AND B000010100111ANDABA OR B000011101111OR
  • AND has two inputs. The output is 1 only when both inputs are 1.
  • If either input is 0, the output is 0.
  • A AND B is written A.B
ABA AND B
000
010
100
111
Boolean logic · AND, OR, NOT

OR

Truth tablesABA AND B000010100111ANDABA OR B000011101111OR
  • OR has two inputs. The output is 1 when at least one input is 1.
  • The output is 0 only when both inputs are 0.
  • This is wider than everyday "or", which often means "one or the other, not both".
  • A OR B is written A + B
ABA OR B
000
011
101
111
Your answer
?A = 1 and B = 0. Work out NOT A, then A AND B, then A OR B. Type the three output bits in that order.
Boolean logic · AND, OR, NOT

XOR

Truth tablesABA AND B000010100111ANDABA OR B000011101111OR
  • XOR (exclusive OR) has two inputs. The output is 1 when the inputs are different.
  • If both inputs are the same (both 0 or both 1), the output is 0.
  • A XOR B is written A ⊕ B
ABA XOR B
000
011
101
110
Quick check
?A hall light has a switch at each end. Flipping either switch changes the light, whatever the other switch is set to. Which operator gives this behaviour?
Quick check
?A cash machine gives out money only if the card is valid (V) and the PIN is correct (P). Which logic statement matches?
Mission check

?"Tea or coffee?" A customer ticks both, so Tea = 1 and Coffee = 1. What does Tea OR Coffee give?
Mission 2

Three sensors, one alarm: how many cases must you test?

Make a guess: Three sensors, one alarm: how many cases must you test?

Boolean logic · combining operators

Combining operators

  • One logic statement (expression) can use several operators, e.g. (A AND B) OR NOT C.
  • Work out brackets first.
  • NOT applies only to the input or bracket just after it.
  • A.B + C̅ means (A AND B) OR (NOT C): AND is done before OR, like × before +.
  • Example: (1 AND 0) OR (1 AND 1) = 0 OR 1 = 1
  • XOR combines in the same way: NOT (1 XOR 0) = NOT 1 = 0
Boolean logic · combining operators

Every combination of three inputs

Counting the rows1 inputA012 rows×22 inputsAB000110114 rows×23 inputsABC0000010100111001011101118 rows
  • Each input can be 0 or 1, so each new input doubles the number of rows.
  • 1 input: 2 rows. 2 inputs: 4 rows. 3 inputs: 8 rows.
  • Fill the input columns by counting up in binary from 000 to 111. Then no row is missed or repeated.
Boolean logic · combining operators

Working columns

Working columnsABCA AND BNOT CP000011001000010011011000100011101000110111111101
  • For a long statement, add a column for each part.
  • Example: P = (A AND B) OR NOT C.
  • Column 4: A AND B. Column 5: NOT C. Column 6: P = column 4 OR column 5.
  • Working columns are optional, but they stop you mixing up steps.
ABCA AND BNOT CP
000011
001000
010011
011000
100011
101000
110111
111101
Your answer
?Q = (A + B).C̅, which means (A OR B) AND NOT C. Complete the output column for the rows 000, 001, 010, 011, 100, 101, 110, 111 (in that order). Type the 8 bits.
Boolean logic · combining operators

From a problem to a logic statement

  • Give each condition a letter (1 = true, 0 = false).
  • "and" → AND; "or" / "either" → OR; "not" / "is off" → NOT.
  • Use brackets to group conditions that go together.
  • Example: the alarm X sounds if the door is open (D) and the system is armed (S), or if the panic button (P) is pressed.
  • X = D.S + P, i.e. X = (D AND S) OR P
Quick check
?A greenhouse sprinkler W switches on when the soil is dry (D) and it is not raining (R), or when the manual override (M) is pressed. Which logic statement matches?
Mission check

?Three sensors, one alarm. How many different input combinations must the truth table cover?
Mission 3

Is A OR (A AND B) ever different from plain A?

Make a guess: Is A OR (A AND B) ever different from plain A?

Boolean logic · simplifying expressions

Boolean algebra notation

Boolean notationOperatorSymbolExampleAND.A.BA AND BOR+A + BA OR BNOTline overANOT AXOR⊕A ⊕ BA XOR B
  • Eduqas writes Boolean expressions with symbols:
  • AND: A.B · OR: A + B · NOT: A̅ (a line over the letter) · XOR: A ⊕ B
  • 1 means TRUE and 0 means FALSE, so 1 and 0 can appear in expressions too.
  • Simplifying means finding a shorter expression with the same truth table.
Boolean logic · simplifying expressions

Equal means the same column

A + NOT AAAA + A011101always 1
  • Two expressions are equal if their outputs match on every row of the truth table.
  • Example: A + A̅. If A = 0, it is 0 + 1 = 1. If A = 1, it is 1 + 0 = 1.
  • The output is always 1, so A + A̅ = 1.
  • A truth table is a good way to check a simplification.
Boolean logic · simplifying expressions

Rules with 0, 1 and A itself

  • Each rule has an OR form and an AND form.
RuleOR formAND form
AnnulmentA + 1 = 1A.0 = 0
IdentityA + 0 = AA.1 = A
ComplementA + A̅ = 1A.A̅ = 0
IdempotentA + A = AA.A = A
Quick check
?Simplify (B + B̅).C
Boolean logic · simplifying expressions

Rules that rearrange

  • Commutative: order does not matter. A + B = B + A and A.B = B.A
  • Association: grouping does not matter. A + (B + C) = A + B + C and A.(B.C) = A.B.C
  • Distribution: multiply out brackets. A.(B + C) = A.B + A.C and A + (B.C) = (A + B).(A + C)
  • Absorption: A + (A.B) = A and A.(A + B) = A
Boolean logic · simplifying expressions

Simplify step by step

Simplify step by stepA.B + A.BDistributionA.(B + B)ComplementA.1IdentityAABA.B + A.BA0000010010111111columns match: equal
  • Simplify A.B + A.B̅ and name each rule.
  • A.B + A.B̅ = A.(B + B̅) — Distribution (taking A out of both terms)
  • = A.1 — Complement
  • = A — Identity
  • Write one step per line and name the rule, as you would in the exam.
Your answer
?Simplify (A + 0).(B + B̅) as far as possible.
Quick check
?Which rule turns A.(B + C) into A.B + A.C?
Mission check

?Is A + A.B ever different from plain A?
Recap

Big ideas

  • Every input and output is 1 (TRUE) or 0 (FALSE). A truth table lists every combination of inputs.
  • AND: 1 only if both inputs are 1. OR: 1 if at least one input is 1. NOT: reverses its one input.
  • XOR: 1 only when the two inputs are different.
  • Work out brackets first; NOT applies only to what comes straight after it.
  • 3 inputs give 8 rows: count in binary from 000 to 111, and add working columns for each part.
  • Turn a problem into a statement by giving each condition a letter and mapping "and", "or", "not".
  • Simplifying keeps the truth table the same but uses fewer operations; check with a truth table.
  • Learn the Appendix B rules: Annulment, Identity, Complement, Idempotent, Commutative, Association, Distribution, Absorption.
  • Show one step per line and name the rule used.
🏆

Mini-lesson complete!

⭐⭐⭐

You've worked through Logical operations for Eduqas GCSE Computer Science. 🎉

  1. Mission 1"Tea or coffee?" Would a computer's OR let you have both?
  2. Mission 2Three sensors, one alarm: how many cases must you test?
  3. Mission 3Is A OR (A AND B) ever different from plain A?

Your stars: 0 / 0

Next: more GCSE Computer Science · Eduqas lessons and games on the GCSE Computer Science · Eduqas page.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to GCSE Computer Science · Eduqas

Specification points and sources for this lesson are listed at the bottom of the page.

Sources (5)

The specification points and sources behind this lesson.

  1. 1 Eduqas GCSE CS spec (2020), 2 Logical operations and Appendix B; Eduqas guidance for teaching, section 2
  2. 2 Eduqas GCSE CS spec (2020), 2 Logical operations; guidance for teaching, section 2
  3. 3 Eduqas GCSE CS spec (2020), 2 Logical operations (Boolean logic)
  4. 4 Eduqas GCSE CS spec (2020), Appendix B Boolean Algebra Conventions and Rules
  5. 5 Eduqas GCSE CS guidance for teaching, section 2