Year 10 - Computing
Creating an XOR function
Programming: subroutines
Study Hub
This pupil-friendly study guide includes a unit summary, clear notes, common mistakes, and quick questions with answers.
Year 10 - Computing
Programming: subroutines
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.
You will learn to write a function that replicates the output of an XOR gate.
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 electronic component that carries out a logical operation. Add one real device or system example to prove understanding.
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.
Browse all guides in the Year 10 Computing guide library.