Skip to content

Study Hub

Study Guides

This pupil-friendly study guide includes a unit summary, clear notes, common mistakes, and quick questions with answers.

Year 10 - Computing

Creating an XOR function

Programming: subroutines

Unit Summary

In this unit pupils will be introduced to structured programming. They will explore the differences between functions and procedures and use functions to return values in programs. They will be introduced to the concept of scope and how parameters can be used to reduce the need for global variables.

Lesson Summary

You will learn to write a function that replicates the output of an XOR gate.

Key Notes

  • A logic gate is a fundamental component of a digital circuit.
  • A truth table shows all possible combinations of inputs and the output that a circuit will produce.
  • An XOR logic gate is True when either input is True, but not both.
  • Unlike AND, OR and NOT, Python does not have a built-in operator for XOR.

Vocabulary To Learn

  • logic gate: an electronic component that carries out a logical operation
  • truth table: a table showing the outputs for all possible combinations of inputs to a logic gate or logic circuit
  • XOR: a Boolean operation that outputs True if either, but not both, of the input values are True

Common Mistakes To Avoid

  • Python has a built-in XOR operator in the same way that it has AND, OR and NOT.

3 Quick Questions (With Answers)

1. Describe the system or process from this lesson in clear steps.

A logic gate is a fundamental component of a digital circuit. A truth table shows all possible combinations of inputs and the output that a circuit will produce.

2. Define this computing term and give one practical example. 'logic gate'

an electronic component that carries out a logical operation. Add one real device or system example to prove understanding.

3. Correct this common computing misconception.

Mistake: Python has a built-in XOR operator in the same way that it has AND, OR and NOT. Correction: Unlike AND, OR and NOT, Python does not have a built-in operator for XOR and instead must be designed as part of and program that uses it.

More Lessons In This Unit

Browse all guides in the Year 10 Computing guide library.