Teachers' Portal  /  A-Level Computer Science 9618  /  Hardware and virtual machines  /  Boolean algebra
Lesson pack · A-Level Computer Science 9618 · 15.2 · A Level (A2)

Boolean algebra

Fewer gates, same logic. Boolean algebra lets you rewrite a logic expression into a simpler one that gives exactly the same truth table, so the circuit needs fewer gates.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Hardware and virtual machines
Syllabus reference
Cambridge International AS and A Level Computer Science 9618, 15.2
Level
A Level (A2)
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 4 of 6 in Hardware and virtual machines; follows Virtual machines; leads into Karnaugh maps
Central model
Fig. 1: a NAND gate does the same job as an OR gate with both inputs inverted, and a NOR gate the same as an AND gate with both inputs inverted
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • The laws of Boolean algebra: Each law below is true for every combination of inputs, which you can check with a truth table.
  • De Morgan's laws: De Morgan's laws turn a NAND into an OR of inverted inputs and a NOR into an AND of inverted inputs.
  • Simplifying step by step: Expand brackets, collect terms, then look for the patterns X + X = X, X + X = 1, X + X.Y = X and X + X.Y = X + Y.
Key points to leave on the board
  • Notation: A.B is AND, A + B is OR, a bar is NOT; keep bars clearly over the right letters.
  • De Morgan: break the bar and change the operator, one bracket at a time.
  • Look for patterns: X + X.Y = X, X + NOT X.Y = X + Y, X + NOT X = 1, X.NOT X = 0.
  • Check: compare a few rows of the truth table of your answer with the original.
The core visual model

One picture every idea returns to

In Boolean algebra A.B means A AND B, A + B means A OR B and a bar over a term means NOT, so A is NOT A. The laws of Boolean algebra (identity, null, idempotent, inverse, commutative, associative, distributive, absorption) let an expression be rewritten without changing its truth table. De Morgan's laws say A.B = A + B and A + B = A.B: break the bar and change the operator. Simplifying an expression means fewer gates, so a circuit that is cheaper, smaller, faster and uses less power. A simplification can always be checked by comparing the truth tables of the original and the result.

De Morgan's laws as gate equivalences A B X NOT (A.B) = A B X NOT A + NOT B A B X NOT (A + B) = A B X NOT A . NOT B break the bar, change the operator: a bubble on each input swaps AND and OR
Fig. 1: a NAND gate does the same job as an OR gate with both inputs inverted, and a NOR gate the same as an AND gate with both inputs inverted
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Fewer gates, same logic.. Boolean algebra lets you rewrite a logic expression into a simpler one that gives exactly the same truth table, so the circuit needs fewer gates. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: The laws of Boolean algebraEach law below is true for every combination of inputs, which you can check with a truth table. Your turn: Use a truth table to show that A + A.B = A.Whole class, then pairs
13 to 21 minTeach and check: De Morgan's lawsDe Morgan's laws turn a NAND into an OR of inverted inputs and a NOR into an AND of inverted inputs. Model the worked example De Morgan, then absorb on the board, one line at a time. Your turn: Use De Morgan's laws to show that A + B = A.B.Pairs
21 to 30 minTeach and check: Simplifying step by stepExpand brackets, collect terms, then look for the patterns X + X = X, X + X = 1, X + X.Y = X and X + X.Y = X + Y. Project tab 2 of the lab (Compare the truth tables of two expressions) and let a student drive it while the class predicts. Model the worked example Taking out a common factor on the board, one line at a time. Your turn: Simplify X = A.B + A.B + A. B.Anticipation / Reaction Guide
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 17 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Simplifying step by step, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Anticipation / Reaction Guide

Before the lesson, students mark five statements true or false. After the teaching they mark them again and justify any change of mind in one sentence each. The statements come from the examiner traps below.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
In Boolean algebra A + A = A, not 2A, and A.A = A, not A squared.There are only two values, 0 and 1.
The commonest error is to break the bar but forget to change the operator.A + B is not A + B: try A = 1, B = 0, which gives 0 on the left and 1 on the right.
An answer with no working rarely earns full marks.Show each law you use, and do not combine several laws in one line.
Worksheet

Boolean algebra: worksheet

6 questions, 17 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[2 marks]

State De Morgan's laws for two inputs, A and B.

Q2 · apply[3 marks]

Simplify X = A.B + A.B + A.B. Show your working.

Q3 · apply[2 marks]

Use De Morgan's laws to write A.B.C without a bar over the whole expression, then simplify it.

Q4 · apply[3 marks]

Show that (A + B).A.B = A.B + A.B.

Q5 · apply[4 marks]

Simplify X = A.B.C + A.B.C + A.B.C. Show your working.

Q6 · analysis[3 marks]

A student writes: A + B = A + B. Show that the student is wrong and give the correct expression.

Answer key and marking notes
Q1 · 2 marks
  • A.B = A + B
  • A + B = A.B
Q2 · 3 marks
  • = A.(B + B) + A.B (distributive: take out NOT A)
  • = A + A.B (inverse and identity)
  • = A + B (redundancy: NOT A + A.B = NOT A + B)
Q3 · 2 marks
  • A.B.C = A + B + C (De Morgan for three inputs)
  • = A + B + C (double complement)
Q4 · 3 marks
  • = (A + B).(A + B) (De Morgan)
  • = A.A + A.B + B.A + B.B (distributive: multiply out)
  • = A.B + A.B (inverse: A.NOT A = 0 and B.NOT B = 0, then commutative)
  • This is A XOR B.
Q5 · 4 marks
  • = A.B.(C + C) + A.B.C (distributive: take out A.B)
  • = A.B + A.B.C (inverse and identity)
  • = A.(B + B.C) (distributive: take out A)
  • = A.(B + C) (redundancy: B + NOT B.C = B + C)
  • = A.B + A.C (either form earns the mark)
Q6 · 3 marks
  • Take A = 1, B = 0: A + B = 1 = 0.
  • But A + B = 0 + 1 = 1, so the two expressions are not equal.
  • The student broke the bar but did not change the operator: the correct expression is A.B.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

A NOR gate has three inputs A, B and C, so its output is A + B + C. Which expression is equivalent?

  • AA.B.C
  • BA + B + C
  • CA.B.C
  • DA.B.C
Q21 mark

Simplify X = A.B + A.B.C.

  • AA.B + A.C
  • BA.B + C
  • CA
  • DA.C
Q31 mark

Which law of Boolean algebra states that A + A.B = A + B?

  • ARedundancy
  • BAbsorption
  • CDistributive
  • DDe Morgan's
Q41 mark

Simplify X = A.B + A.B.

  • AA
  • BB
  • CA + B
  • D0
Q51 mark

Simplify X = A + B + A.B.

  • AA
  • BA + B
  • CA.B
  • DA.B
Q61 mark

A student simplifies X = A + B.C + A.C like this:
Line 1: = (A + B).C + A.C
Line 2: = A.C + B.C + A.C
Line 3: = C.(A + A) + B.C
Line 4: = C + B.C
Line 5: = C
Where is the first error?

  • ALine 1: the bar was broken but the OR was kept
  • BLine 2: the bracket was multiplied out incorrectly
  • CLine 3: the inverse law gives 0 for this bracket, not 1
  • DLine 4: C + B.C cannot be absorbed to give C
Quiz key
Q1: A

De Morgan's law works for any number of inputs: break the bar and change every OR to AND, giving A.B.C. Breaking the bar without changing the operators gives A + B + C, which is a three-input NAND. A.B.C has no bars at all, and A.B.C has lost the bar from C.

Q2: A

X = A.(B + B.C) by the distributive law, and B + B.C = B + C by the redundancy law, so X = A.(B + C) = A.B + A.C. A.B + C loses the A from the second term; A on its own would be 1 for A = 1, B = 0, C = 0, where X = 0; and A.C misses the row A = 1, B = 1, C = 0, where X = 1.

Q3: A

The redundancy law says A + A.B = A + B: if A is 1 the output is 1 anyway, so the NOT A in the second term is redundant. Absorption is A + A.B = A. The distributive law multiplies out or factorises a bracket, and De Morgan's laws break a bar over a whole expression.

Q4: A

X = A.(B + B) by the distributive law, and B + B = 1 by the inverse law, so X = A. B takes out the wrong letter; A + B is 1 when A = 1 and B = 0, where X = 0; and 0 would mean the output is never 1, but X = 1 whenever A = 0.

Q5: A

De Morgan: A + B = A.B = A.B (double complement). So X = A.B + A.B = A.(B + B) = A.1 = A. A + B is 1 when A = 0 and B = 1, where X = 0. A.B is only the first term, and A.B comes from dropping the outer bar and changing the operator without complementing each term inside it.

Q6: A

De Morgan's law gives A + B = A.B, so line 1 should be A.B.C + A.C; the student kept the OR. Every later step is correct for the wrong line 1: line 2 multiplies out properly, A + A = 1 by the inverse law, and C + B.C = C by absorption. The correct answer is X = A.B.C + A.C = C.(A + B).

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonVirtual machines