Grade 9 · CAPS · English

Grade 9 Coding and Robotics Study Guide

Complete Grade 9 Coding and Robotics study guide in English, aligned to the CAPS curriculum. 16 chapters with explanations, worked examples, exercises with solutions, and original practice papers with memos.

16Chapters
255Practice Qs & solutions
2Practice papers (short + full)
∞Lifetime access
Unlock this subject Start reading See practice papers

Chapters

Strand 1: Algorithms and Coding

Chapter 1. Logic Circuits: Combining Three Gates FREE

1.1 One gate is a decision; a circuit is a rule

In Grade 8 you met the three basic logic gates and combined two of them. This year you take the step that real machines take: combining three gates into one circuit - because almost no real-world rule fits inside a single gate. A factory press, an ATM, a lift door: each one runs on a circuit of gates working together.

Quick recap of the three building blocks. Each gate takes inputs that are either 1 (on, true) or 0 (off, false), and produces one output:

GateOutput is 1 when...Mini truth table
ANDboth inputs are 100→0, 01→0, 10→0, 11→1
ORat least one input is 100→0, 01→1, 10→1, 11→1
NOTthe single input is 0 (it flips the input)0→1, 1→0

1.2 Reading a circuit diagram

A logic circuit diagram reads like a sentence, from left to right: inputs enter on the left, signals flow along the wires, and the final output leaves on the right. The trick that makes any circuit manageable - no matter how many gates it holds - is to give every internal wire its own letter. Each internal letter is the output of one gate and the input of the next. Work out the letters one gate at a time, and even a large circuit becomes a series of small, easy steps.

1.3 Warm-up: two gates, four rows

Take X = NOT (A AND B): the output of an AND gate feeds into a NOT gate. Call the internal wire D, so D = A AND B and X = NOT D. Two inputs means 2 x 2 = 4 rows:

ABD = A AND BX = NOT D
0001
0101
1001
1110

The intermediate column D does the heavy lifting: first fill in D for every row using only the AND rule, then fill in X from D using only the NOT rule. One gate at a time, never two at once.

1.4 Three gates, eight rows: a machine that knows when to stop

Now the Grade 9 step. Picture a machine on a factory floor - the theme of this year, where your PAT automates a manufacturing process. The machine must run when the operator presses the start button (S) or when it is in automatic mode (A) - but never, under any circumstances, while the emergency stop (E) is pressed. As a logic rule:

R = (S OR A) AND (NOT E)

Three gates, so two internal wires: D = S OR A (the request to run) and F = NOT E (the safety check). The output is R = D AND F. Three inputs means 2 x 2 x 2 = 8 rows. Build the input columns systematically - the S column holds four 0s then four 1s, the A column alternates in pairs, the E column alternates every row - so that no combination is missed:

SAED = S OR AF = NOT ER = D AND F
000010
001000
010111
011100
100111
101100
110111
111100

Read the answer out of the table: the machine runs in exactly three situations - whenever there is a run request (S or A is 1) and the emergency stop is not pressed (E is 0). Look down the E column: every single row where E = 1 gives R = 0. That is the NOT gate doing safety work: pressing the emergency stop turns the safety signal F to 0, and the final AND gate then blocks the run signal no matter what the buttons say. This is precisely how interlocks on real machines are designed.

1.5 The method, in general

Every combined-gate problem gives way to the same five steps:

  1. Count the inputs. The truth table needs 2 to the power of n rows: 2 inputs → 4 rows, 3 inputs → 8 rows.
  2. Fill the input columns systematically - halves, then pairs, then alternating - so every combination appears exactly once.
  3. Name every internal wire with its own letter and add a column for each.
  4. Work one gate at a time, left to right through the circuit, using only that gate’s rule.
  5. The last column is the answer. Read off the rows where the output is 1 and say, in words, what they mean.

1.6 Checking your table in the shell

Python speaks logic natively: the values True and False, and the operators and, or and not, behave exactly like the gates. Any row of your truth table can be typed straight into the shell as a check. Row 5 of the big table (S = 1, A = 0, E = 0):

>>> (True or False) and (not False)
True

And row 4 (S = 0, A = 1, E = 1):

>>> (False or True) and (not True)
False

Both match the table: row 5 runs, row 4 does not. This is the same shell skill you used in Grade 8 - now it is your free, instant marker for any truth table you build. The gate names on diagrams and the Python operators are two costumes for the same idea.

1.7 Where this is going

This year your PAT automates a manufacturing process, and every automated process is built on rules like R = (S OR A) AND (NOT E): sensors and buttons supply the inputs, a circuit (or the microcontroller code standing in for it) combines them, and actuators obey the output. Master the three-gate table now and the control logic of your project - and of Chapter 2, where loops let these decisions repeat - will already feel familiar.

Summary: circuits combine gates, and the way to tame them is one intermediate column per gate; n inputs need 2 to the power of n rows, filled systematically; work left to right, one gate rule at a time, and read the meaning out of the final column; the emergency-stop circuit R = (S OR A) AND (NOT E) shows NOT and AND doing real safety work; and the Python shell, with and, or and not, checks any row of any table in seconds.

Chapter 2. The While Loop

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 3. The For Loop and Nested Loops

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 4. Functions and Modular Programming

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 5. Working with Lists - and a Machine Learning Project

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 6. Event-Driven Programming and Game Design

You will see the full content once you unlock this subject. Unlock for R49.
Strand 2: Robotic Skills

Chapter 7. CAD: Four-Part Assemblies, Display Methods and Pulleys

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 8. CAD: Preparing for 3D Printing

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 9. Multi-Servo Control with Joysticks

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 10. The Bluetooth Module: Wireless Control

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 11. The Automation Project

You will see the full content once you unlock this subject. Unlock for R49.
Strand 3: Internet and E-Communication

Chapter 12. Social Media: Platforms, Power and Pitfalls

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 13. Streaming, Big Data and AI

You will see the full content once you unlock this subject. Unlock for R49.
Strand 4: Application Skills

Chapter 14. Spreadsheets 3: Absolute References and the IF Function

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 15. Spreadsheets 4: New Formatting Rules and Chart Types

You will see the full content once you unlock this subject. Unlock for R49.

Chapter 16. The Website Project 2: Tables, Navigation and Looking Ahead

You will see the full content once you unlock this subject. Unlock for R49.

Practice papers

Grade 9 Coding and Robotics: Term 2 Short Practice Paper (first half) 30 marks · 30 min
Grade 9 Coding and Robotics: Term 2 Full Practice Paper (first half) 60 marks · 60 min
Grade 9 Coding and Robotics: Term 4 Short Practice Paper (full year) 30 marks · 30 min
Grade 9 Coding and Robotics: Term 4 Full Practice Paper (full year) 60 marks · 60 min
Term 2 Exam: Advanced 40 marks · 60 min
Term 4 Exam: Advanced 40 marks · 60 min
Grade 9 Coding and Robotics: Term 3 Test 50 marks · 60 min

Sample questions from this subject

  1. A NOT gate receives the input 0. What is its output?
  2. An AND gate receives the inputs 1 and 1. What is its output?
  3. In the circuit Q = (A AND B) OR C, what is Q when A = 1, B = 0 and C = 1?
  4. How many rows does the truth table of a circuit with three inputs need?

Unlock the subject for the full questions, memos and step-by-step solutions.

About this study guide

This Grade 9 Coding and Robotics study guide is written in clear English, following the CAPS curriculum for South African schools. Each chapter starts with the core content, shows worked examples, and ends with exercises whose solutions are already in the guide.