BL

10.Boolean Logic

Logic gates, logic circuits, truth tables and logic expressions

Learning Objectives

By the end of this lesson, you should be able to:

  • Identify and use the standard symbols for NOT, AND, OR, NAND, NOR and XOR gates.
  • Define and understand the functions of the logic gates.
  • Use logic gates to create given logic circuits from a problem statement, logic expression or truth table.
  • Complete a truth table from a problem statement, logic expression or logic circuit.
  • Write a logic expression from a problem statement, logic circuit or truth table.
  • Use the binary output and input combinations systematically, including circuits with up to three inputs and one output.
Guidance from the notes
  • The six gates are NOT, AND, OR, NAND, NOR and XOR (Exclusive OR).
  • NOT is a single-input gate; the other gates in the examples use two inputs.
  • For n inputs, the number of possible binary combinations is 2n.
  • Three inputs give 8 combinations and four inputs give 16 combinations.
  • The IGCSE logic circuits shown are limited to a maximum of three inputs and one output.

Key Terms

  • Boolean logic— logical decision-making using TRUE/FALSE, often represented by 1/0.
  • Logic gate— a visual way of representing a Boolean expression.
  • Logic circuit— a combination of logic gates arranged to perform a particular function.
  • Logic diagram— a visual representation of the combination of logic gates within a circuit.
  • Truth table— a table containing all possible inputs and the associated outputs.
  • Logic expression— a way of expressing a logic gate or logic circuit as an equation.
  • Intermediate value— a value produced by one stage of a logic circuit and used by a later stage.
  • Binary— information represented using two states, 0 and 1.

ICE Breaking: Recap Previous Chapter

The lesson begins with a recap of parity checks before introducing Boolean Logic.

  • An even-parity system checks whether the total number of 1s is even.
  • The recap uses received bytes and a parity table to identify a wrongly transmitted bit.
  • The worked answer identifies byte 7, column 6 as the incorrect bit.
  • The binary value 10111110 is 190 in decimal.
  • A parity check may fail to identify an error when bits are interchanged, an even number of bits are transposed, or multiple errors occur in the same byte/column arrangement.

Resources included in the notes

Activity 1: Parity recap

State the decimal value of 10111110 and give one situation in which parity may fail to identify an error.

  • 10111110 has a decimal value of 190.
  • Two interchanged bits can leave parity unchanged.

Activity 2: Connect the topics

What common skill does the parity recap share with truth tables?

  • Both use tables systematically.
  • Both require careful checking of binary states or combinations.

Check Your Understanding: Recap

  • It checks whether the total number of 1s is even.
  • The parity bit is included.
  • An unexpected parity result indicates an error.
  • It is used as a transmission-error check.
  • The value is 190.
  • The number is interpreted in binary.
  • The 1-bits represent powers of 2.
  • The total is 190.
  • It is in byte 7.
  • It is in column 6.
  • The row and column identify the bit.
  • This comes from the parity-table check.
  • Two bits may be interchanged.
  • One 1 can become 0 while another 0 becomes 1.
  • The number of 1s can remain unchanged.
  • Parity may then still appear correct.
  • It reinforces binary values.
  • It uses systematic tables.
  • It encourages careful checking.
  • Truth tables also use binary 0 and 1.
  • It prepares students to trace gate outputs.

1. Identify and Use the Standard Symbols for Logic Gates

Electronic circuits in computers, memory and controlling devices are made from logic gates. Gates take binary inputs and produce a binary output. When gates are combined to carry out a particular function, such as controlling a robot, they form a logic circuit.

AND

A AND B

TRUE only if both inputs are TRUE.

OR

A OR B

TRUE if either input is TRUE.

NOT

NOT A

reverses the input.

NAND

A NAND B

TRUE if either or both inputs are FALSE.

NOR

A NOR B

TRUE if both inputs are FALSE.

XOR

A XOR B

TRUE if either input is TRUE but NOT both.

Real-life examples used in the notes

  • AND: a person sensor and an alarm switch are both ON before a burglar alarm activates.
  • OR: a front doorbell switch or a back doorbell switch can activate a doorbell.
  • NOT: a temperature detector can provide the opposite state.
  • XOR: a stairway-light example acts when the two states are not the same.
Gate00011011
AND0001
OR0111
NAND1110
NOR1000
XOR0110

NOT:0 → 1 and 1 → 0.

Interactive Visualisation: Gate Simulator

Change the gate or binary inputs and see the output.

Output
0

Activity 1: Gate identification

Classroom / homework

Which gate gives 1 only when both inputs are 1? Which gate gives 1 only when both inputs are 0?

  • AND gives 1 only for 1,1.
  • NOR gives 1 only for 0,0.

Activity 2: XOR or OR?

Classroom / homework

For inputs 1 and 1, state the output of OR and XOR and explain the difference.

  • OR outputs 1.
  • XOR outputs 0.
  • OR is true when at least one input is 1.
  • XOR is true only when exactly one input is 1.

Check Your Understanding: Logic Gates

  • It is used in computer science and electronics to make logical decisions.
  • Boolean values are TRUE or FALSE.
  • They are often represented by 1 or 0.
  • Inputs and outputs can be represented by letters.
  • It has two inputs in the examples.
  • Its output is 1 only if both inputs are 1.
  • If either input is 0, the output is 0.
  • The 1,1 row is the only row with output 1.
  • It means Exclusive OR.
  • It gives 1 when the inputs are different.
  • It gives 0 when both inputs are 0.
  • It also gives 0 when both inputs are 1.
  • NAND means NOT AND.
  • It is the opposite result of AND.
  • It gives 1 for 0,0; 0,1 and 1,0.
  • It gives 0 for 1,1.
  • NOR means NOT OR.
  • It is the opposite result of OR.
  • It gives 1 only for 0,0.
  • It gives 0 when at least one input is 1.

2. Logic Circuits

A logic circuit performs logical operations on binary information. Logic gates are the core components. A logic diagram visually represents combinations of gates. Brackets clarify the order of operations.

Example: Q = NOT(A OR B)

  • A and B are the inputs.
  • P is the output of the OR gate.
  • P becomes the input to the NOT gate.
  • Q is the final output.
A, BOR → PNOT → Q

Real-life worked example: sprinkler system

The sprinkler switches on if it is not daytime (A) and the temperature is greater than 40 (B).

Q = (NOT A) AND B

The notes warn that exam questions may ask you to draw a logic circuit from a logic statement or Boolean expression, or write the logical expression represented by a diagram. Circuits are limited to a maximum of three inputs and one output.

Activity 1: Draw a circuit

Classroom / homework

Draw a circuit for an output that is 1 only when A is NOT active and B is active.

  • Send A through a NOT gate.
  • Use NOT A and B as the inputs to an AND gate.
  • The AND output is the final output.

Activity 2: Read a circuit

Classroom / homework

An OR gate feeds a NOT gate. Inputs are A and B. Write the expression.

Q = NOT(A OR B)

Check Your Understanding: Logic Circuits

  • It performs logical operations on binary information.
  • It is made from logic gates.
  • The arrangement of gates and input signals determines the function.
  • It produces a final output.
  • It is a visual representation of a combination of logic gates.
  • Inputs and outputs can be labelled.
  • Intermediate signals can be shown.
  • It helps a reader see how the circuit works.
  • P is produced by the OR gate.
  • P is not the final circuit output.
  • P becomes the input to the NOT gate.
  • Q is the final output.
  • They clarify the order of operations.
  • They make a multi-gate expression easier to follow.
  • They help match the expression to the circuit.
  • They reduce the chance of misreading the expression.
  • The examples use a maximum of three inputs.
  • There is one output.
  • Inputs should be identified clearly.
  • The limits are part of the IGCSE guidance in the notes.
  • Students should work systematically from left to right.

3. Truth Tables

Truth tables are used to trace the output from a logic gate or logic circuit. All possible combinations of 1s and 0s must be included.

  • One input → 21= 2 combinations.
  • Two inputs → 22= 4 combinations.
  • Three inputs → 23= 8 combinations.
  • Four inputs → 24= 16 combinations.
Gate00011011
AND0001
OR0111
NAND1110
NOR1000
XOR0110

Step-by-step method for 3 inputs

  1. Count the inputs and calculate 2n.
  2. Start with 000 and count up in 3-bit binary to 111.
  3. Add a new column for the result of the brackets first.
  4. Add another column for NOT operations.
  5. Use the intermediate values to calculate the final output.

Worked example: P = (A AND B) AND NOT C

ABCA AND BNOT CP
000010
001000
010010
011000
100010
101000
110111
111100

Interactive Visualisation: Generate a Gate Truth Table

Choose a gate; the browser generates its truth table.

Activity 1: Count the rows

Classroom / homework

How many rows are required for three inputs?

  • There are three inputs.
  • Use 23.
  • 2 × 2 × 2 = 8.
  • So 8 combinations are required.

Activity 2: Complete XOR

Classroom / homework

Complete the four output values for XOR: 00, 01, 10, 11.

0, 1, 1, 0

Check Your Understanding: Truth Tables

  • A truth table represents all possible inputs.
  • Every possible 0/1 combination must be considered.
  • Leaving out a row can omit a possible output.
  • A complete table lets the circuit be checked systematically.
  • Use 2n.
  • Here n is 4.
  • 24= 16.
  • Therefore 16 rows are needed.
  • The output is 0.
  • XOR is true only when exactly one input is 1.
  • Here both inputs are 1.
  • Therefore the inputs are not exclusive.
  • They show results from earlier gates.
  • They make complex expressions easier to calculate.
  • They make error checking easier.
  • They can be omitted from a final table when the student is confident.
  • Identify A, B and C.
  • Calculate 23= 8 rows.
  • List the inputs from 000 to 111.
  • Then calculate the circuit output for each row.
  • Add intermediate columns when helpful.

4. Logic Expressions

A logic expression expresses a logic gate or logic circuit as an equation. The output appears on the left of the equals sign and the inputs and logic gates appear on the right.

GateExpressionMeaning
NOTZ = NOT AReverses A.
ANDZ = A AND BBoth inputs must be 1.
ORZ = A OR BEither input can be 1.
NANDZ = A NAND BNOT(A AND B).
NORZ = A NOR BNOT(A OR B).
XORZ = A XOR BExactly one input is 1.

In the teacher notes, a dot (·) represents AND and a plus (+) represents OR.

Examples from the notes

  • Q = NOT(A OR B)
  • Q = (NOT A) AND B
  • P = ((NOT A) OR B) NAND C
  • X = NOT(A NAND B) OR (B NOR C)
  • The source also gives the more complex worked statement X = (((A AND B) OR (C AND NOT B)) XOR NOT C).

Activity 1: Convert words to an expression

Classroom / homework

Write an expression for “A is active AND B is NOT active”.

X = A AND (NOT B)

Activity 2: Convert a circuit to an expression

Classroom / homework

A NAND operation is applied to A and B, a NOR operation to B and C, and the two results are joined by OR. Write the expression.

X = NOT(A NAND B) OR (B NOR C)

Check Your Understanding: Logic Expressions

  • It is on the left of the equals sign.
  • The equals sign separates the output from the operations.
  • Inputs and gate operations appear on the right.
  • For example, Z = A AND B.
  • The dot represents AND.
  • A and B are the inputs.
  • Both are required for a true result.
  • A·B is the same operation as A AND B.
  • The gate is NOR.
  • NOR means NOT OR.
  • The expression is Z = A NOR B.
  • It can also be written Z = NOT(A OR B).
  • They show the order of operations.
  • They make the expression easier to follow.
  • They help match the expression to a circuit.
  • They reduce ambiguity.
  • Use one logic expression for the whole circuit.
  • Show each gate operation in the expression.
  • Use intermediate results where useful.
  • Keep the final output on the left.
  • Use brackets to make the order clear.

5. Use Logic Gates to Create Circuits, Complete Truth Tables and Write Logic Expressions

The notes show three directions of conversion: problem statement → circuit/truth table, logic expression → circuit/truth table, and truth table → expression/circuit.

Worked Example 1 — three-stage circuit

P = A AND B
Q = B NOR C
R = P OR Q
X = R XOR C

The source breaks the circuit into Part 1, Part 2 and Part 3. It first finds P and Q, then R, then X. The final truth table records A, B, C and X; intermediate columns can also be included while working.

ABCPQRX
0000111
0010001
0100000
0110001
1000111
1010001
1101011
1111010

Worked Example 2 — safety system

The source describes a safety system in which A, B and C represent ON/OFF conditions. The alarm is ON for:

X = (A AND NOT B) OR (B AND NOT C)

The two AND branches are then combined with an OR gate.

Worked Example 3 — wind turbine

The safety system monitors turbine speed S, bearing temperature T and wind velocity W. X = 1 shuts down the turbine when any of three combinations occurs:

  1. Turbine speed ≤ 1000 rpm AND bearing temperature > 80°C.
  2. Turbine speed > 1000 rpm AND wind velocity > 120 kph.
  3. Bearing temperature ≤ 80°C AND wind velocity > 120 kph.

The source translates these using AND, OR and NOT and then joins the three intermediate circuits with OR gates:

(NOT S AND T) OR (S AND W) OR (NOT T AND W)

Stage 1 converts the real-world statements into logic statements. Stage 2 creates the intermediate circuits and connects them with OR gates.

From a truth table to a circuit

  1. Find the rows where the output = 1.
  2. Build a logic branch for each of those rows.
  3. Determine which inputs need NOT gates because the row contains 0.
  4. AND the required conditions together within each branch.
  5. Use OR gates to combine the branches.
  6. Construct the final logic expression and circuit.
ABCX
0000
0010
0100
0110
1001
1010
1100
1111
(A AND NOT B AND NOT C) OR (A AND B AND C)

Activity 1: Identify the 1-rows

Classroom / homework

Using the truth table above, identify the two rows where X = 1.

  • 100
  • 111

Activity 2: Build the branches

Classroom / homework

Write the two AND branches needed for the 1-rows.

  • A AND NOT B AND NOT C
  • A AND B AND C
  • Then OR the two branch results.

Check Your Understanding: Converting Between Representations

  • List all input combinations first.
  • Calculate the circuit stage by stage.
  • Record intermediate results in separate columns.
  • Use the final stage to obtain the output.
  • Look for words such as AND, OR and NOT.
  • AND identifies conditions that occur together.
  • OR identifies alternatives.
  • NOT identifies an opposite condition.
  • Each branch represents one acceptable condition.
  • OR combines the branch results.
  • If any branch is 1, the combined result can be 1.
  • This matches a problem where any listed condition can trigger the output.
  • Find the rows where the output is 1.
  • Each of those rows becomes a branch.
  • Inputs in the row are used as conditions.
  • The branches are combined later.
  • It records the result of part of the circuit.
  • It makes a complex calculation easier to follow.
  • It supports checking each gate separately.
  • It helps prevent mistakes.
  • It can be removed from the final table when appropriate.

6. Logic Circuits in the Real World and Practical Simulation

The notes connect logic circuits to real electronic design. Electronics companies must consider cost of components, fabrication and time when designing and building circuits.

Method 1 — off-the-shelf building blocks

One approach described is to use off-the-shelf building blocks when reviewing and building circuit designs.

Method 2 — simplify the circuit

The other approach is to simplify the logic circuit as far as possible. This may be necessary when space is at a premium, such as on circuit boards used in satellites for space exploration.

Practical Activity from the notes

The source introduces Logisim for simulating the basic NOT, AND and OR gates.

Logisim simulation video

Activity 1: Satellite design

Classroom / homework

Why is simplification useful for a circuit board in a satellite?

  • Space can be at a premium.
  • Simplifying the circuit reduces the amount of circuit complexity that must fit on the board.

Activity 2: Simulation check

Classroom / homework

Use the Logisim activity to test one NOT gate, one AND gate and one OR gate against their truth tables.

  • Build or select the gate.
  • Apply the truth-table inputs.
  • Observe the output.
  • Compare it with the expected truth-table result.

Check Your Understanding: Real-World Circuits

  • Cost of components.
  • Fabrication.
  • Time.
  • These factors affect circuit design decisions.
  • Use off-the-shelf building blocks.
  • Simplify the logic circuit.
  • The second approach reduces the circuit as far as possible.
  • The approaches are ways to review circuit design.
  • Satellite circuit boards can have very limited room.
  • Circuit size therefore matters.
  • Simplification may be necessary.
  • The source specifically gives satellite boards as an example.
  • NOT is included.
  • AND is included.
  • OR is included.
  • The activity is about simulating basic gates.
  • The truth table gives the expected output.
  • The simulation gives an observed output.
  • Comparing them checks the gate behaviour.
  • A difference can indicate an error in the circuit or inputs.
  • It reinforces the relationship between a gate and its truth table.

Key Takeaways

  • Boolean logic uses TRUE/FALSE, often represented by 1/0.
  • Know the symbols and functions of NOT, AND, OR, NAND, NOR and XOR.
  • XOR is 1 only when exactly one input is 1.
  • A logic circuit combines gates to perform a particular function.
  • A truth table contains every possible input combination.
  • Use 2nfor n inputs.
  • Intermediate columns make complex truth tables easier to calculate.
  • Logic expressions put the output on the left of the equals sign.
  • From a truth table to a circuit: find output-1 rows, build branches, AND the conditions, then OR the branches.
  • Real-world design considers component cost, fabrication, time and limited space.

Question Bank — Entire Lesson

  • An AND gate has two inputs in the examples.
  • Its output is 1 only when both inputs are 1.
  • For 0,0; 0,1; and 1,0 the output is 0.
  • The 1,1 row gives output 1.
  • OR is true when either input or both inputs are 1.
  • XOR is true when exactly one input is 1.
  • For 0,0 both give 0.
  • For 0,1 and 1,0 both give 1.
  • For 1,1 OR gives 1 but XOR gives 0.
  • Count the inputs, giving n = 3.
  • Calculate 23= 8 rows.
  • List the input combinations from 000 to 111.
  • Calculate intermediate gate results when useful.
  • Use the final gate result to complete the output column.
  • The first input is A.
  • Apply NOT to A.
  • Use B as the other input of the AND gate.
  • The expression is Q = (NOT A) AND B.
  • Find the rows where the output is 1.
  • Build one branch for each such row.
  • Use NOT gates for input values that are 0.
  • Use AND gates inside each branch.
  • Use OR gates to combine the branches.
  • Identify the three monitored conditions S, T and W.
  • Translate each real-world condition into a logic statement.
  • Use NOT when a condition is the opposite of an input state.
  • Use AND for the paired conditions in each safety combination.
  • Use OR to combine the three intermediate results.
  • Complete the truth table from the resulting expression or circuit.
  • One approach is to use off-the-shelf building blocks.
  • The other is to simplify the logic circuit as far as possible.
  • Simplification is useful when physical space is limited.
  • The notes give satellite circuit boards as an example.
  • The first branch is A AND NOT B.
  • The second branch is B AND NOT C.
  • The branches are alternatives, so use OR.
  • X = (A AND NOT B) OR (B AND NOT C).
  • They show the result of earlier gates.
  • They make multi-stage calculations easier to follow.
  • They help check each stage for errors.
  • They can be removed from a final table when the student is confident.
  • XOR means Exclusive OR.
  • It is 1 when the two inputs are different.
  • It is 0 for 0,0.
  • It is 0 for 1,1.
  • Do not confuse XOR with OR, because OR is 1 for 1,1.