TactivergeOffline

Level 2 Building Machines That Respond · Term 2: Digital and Electrical Systems

From charge, voltage and the materials that carry it (including a first look at semiconductors) to Ohm's law, series and parallel circuits, power and energy; then Boolean algebra, combinational logic, adders and binary arithmetic, opening the computer architecture thread. Everything is low-voltage and simulated.

In this file: 26 lessons across weeks 10–18, with 140 practice questions (questions only, no answers).

Program, analyse and test simple machines that sense their surroundings, make decisions and change their behaviour, all in simulation. Levels describe what you can do, not your age. About About 3 hours a week: roughly 1–1.5 hours of lessons, 1 hour of lab or coding practice and 30 minutes of notebook writing..

Week 10: Charge, voltage and materials

This week you will

Charge on the move

A phone charger pushes about two coulombs through its cable every second. How many electrons is that, and where do they all come from?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Every robot, sensor and phone you will design is, underneath, a plan for moving charge to the right place at the right rate. Engineers count that charge, because it decides how big the wires must be, how long a battery lasts and whether something overheats.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A single loop has a battery and two lamps one after the other. Compared with the wire before the lamps, the current in the wire after them is…

  1. Smaller, because the lamps used some of it up
  2. Exactly the same
  3. Bigger, because the lamps speed the charge up

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Close the switch and set 0.5 A for 10 s: how many coulombs pass? Now double the current, then double the time, and see what happens to Q. Open the switch and check every part of the loop. Switch between conventional current and electron drift and note which way each goes.

What the interactive shows, in words

The visualiser shows a loop with a cell, a switch and a lamp. With the switch closed, the readout gives the charge Q = I × t and the equivalent number of electrons, for example 0.5 A for 10 s gives 5 C, about 3.1 × 10¹⁹ electrons. Opening the switch stops the current everywhere. Dots move clockwise for conventional current and anticlockwise for electron drift.

Understand

Charge comes in coulombs

Electric charge is a property of particles: electrons carry a tiny negative charge, protons an equal positive one. Engineers count charge in coulombs (C). One coulomb is the charge of about 6.24 × 10¹⁸ electrons, so a single electron carries about 1.6 × 10⁻¹⁹ C.

Current is charge per second

Current is how much charge passes a point each second: I = Q ÷ t. Its unit, the ampere (A), means one coulomb per second. Small circuits use milliamps (mA): 1 A = 1000 mA. An indicator LED might take 10 mA; a phone charging, about 2 A.

No loop, no current

Charge only flows when there is an unbroken path from one terminal of the source, through the components and back to the other terminal. Open a switch anywhere in a single loop and the current stops everywhere, even in the wire touching the battery.

Two directions, one current

By a convention older than the discovery of the electron, conventional current is drawn from + to −. In metal wires the electrons actually drift the other way, from − to +. Both describe the same flow; circuit diagrams use conventional current.

Explain it another way: intuitive

Picture a bicycle chain. Turn the pedals and every link moves at once, the same number of links passing every point each second. No link is used up by the back wheel; the chain carries the push round.

Explain it another way: technical

Current is the rate of flow of charge, I = dQ/dt; for a steady current, I = Q/t. Charge is conserved, so at any junction the current in equals the current out, and in a single series loop the current is the same at every point.

Explain it another way: mathematical

Q = I × t. A 2 A charger for 60 s moves Q = 2 × 60 = 120 C, which is 120 × 6.24 × 10¹⁸ ≈ 7.5 × 10²⁰ electrons. Rearranged: t = Q ÷ I and I = Q ÷ t.

Explain it another way: applied

Fuses and circuit breakers protect wiring by watching current: too many coulombs per second through a thin wire heats it dangerously. A robot's battery management chip counts coulombs in and out to estimate how full the battery is.

Try these examples

Example 1

A motor draws 0.25 A for 2 minutes. How much charge flows through it?

The worked solution is in the online lesson.

Example 2

15 C passes through a lamp in 30 s. What is the current?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. In a single loop with a battery, a switch and three lamps, where is the current biggest?

  • Next to the + terminal
  • Next to the − terminal
  • It is the same everywhere in the loop
  • In the first lamp

2. A heater element carries 3 A for 20 s. How much charge flows, in coulombs?

Answer: C

3. A current of 100 mA carries 6 C of charge through a lamp. For how many seconds was it flowing?

Answer: s

4. A sensor draws 500 mA for 4 s. How much charge is that, in coulombs?

Answer: C

5. The switch in a single loop is opened. What happens to the current in the wire right next to the battery?

  • It keeps flowing there, just not past the switch
  • It stops
  • It reverses direction

6. In a copper wire connected to a battery, which way do the electrons drift?

  • From + to −, the same way as conventional current
  • From − to +, opposite to conventional current
  • They do not move at all

Apply it

In the charge-flow visualiser, find two different current-and-time settings that both move 30 C. Then write one sentence explaining why a robot that draws 2 A for 10 minutes needs a battery that can supply 1200 C.

Reflect

Why do you think engineers chose to measure current as 'charge per second' rather than 'number of electrons per second'?

Voltage: the energy each charge carries

A 9 V battery and a 1.5 V battery can both push the same current. So what does the '9 V' on the label actually promise?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Voltage decides what a part needs and what it can survive: a microcontroller wants 3.3 V or 5 V, a motor 12 V, and the wrong one can do nothing or destroy it. Reading a voltage correctly is the first skill on every electronics bench.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 9 V battery and a 1.5 V cell each push 1 C of charge round a circuit. Which gives that coulomb more energy?

  1. They give the same energy
  2. The 9 V battery, six times as much
  3. The 1.5 V cell, because it is smaller

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose the series circuit. Set the supply to 6 V and read the voltage across each resistor, then add them up. Change the resistors and add again. Now change the supply to 12 V: what always stays true about the total?

What the interactive shows, in words

In the circuits lab's series circuit, the readout lists the voltage across each resistor. Whatever values are chosen, the three voltages always add up to the supply voltage, for example 1 V + 2 V + 3 V on a 6 V supply. Doubling the supply doubles every voltage.

Understand

A volt is a joule per coulomb

Voltage (potential difference) is the energy given to, or taken from, each coulomb of charge: V = E ÷ Q. So 1 V = 1 J/C. A 5 V USB supply hands 5 J to every coulomb that leaves it; a lamp with 5 V across it turns 5 J per coulomb into light and heat.

Always between two points

A voltage is a difference, like a height difference on a hill. You measure it across a component, with the meter's two probes on either side. Saying 'the voltage at this wire' only makes sense once you agree which point counts as 0 V, usually the negative terminal, called ground.

The loop rule

In a single loop, the energy each coulomb gains in the battery is all handed out by the components before it gets back. So the voltages across the components add up to the supply voltage. Engineers call this Kirchhoff's voltage law; the circuits lab shows it for any resistor values you pick.

Explain it another way: intuitive

Think of a ski lift and slopes. The lift (battery) raises each skier (coulomb) by a fixed height (voltage). However the slopes split up the descent, every skier ends up back at the bottom having dropped exactly the height the lift gave them.

Explain it another way: technical

Potential difference V between two points is the work done per unit charge moving between them: V = W/Q, in volts. Around any closed loop the sum of potential rises equals the sum of drops (Kirchhoff's voltage law), a consequence of energy conservation.

Explain it another way: mathematical

E = V × Q. A 12 V battery moving 5 C gives E = 12 × 5 = 60 J. Combine with Q = I × t: E = V × I × t, which next week becomes power × time.

Explain it another way: applied

A robot's power board has several voltage 'rails': 12 V for the motors, 5 V for sensors and 3.3 V for the processor. Each rail is a promise about the energy per coulomb delivered, and parts are chosen to match.

Try these examples

Example 1

A 1.5 V cell pushes 2 C through a torch bulb. How much energy does the bulb receive?

The worked solution is in the online lesson.

Example 2

A 9 V battery drives two resistors in series. One has 4 V across it. What is across the other?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. What does '5 V' on a USB charger tell you?

  • It delivers 5 coulombs every second
  • Each coulomb of charge gains 5 joules of energy
  • It can power exactly 5 devices

2. A 12 V supply drives three resistors in series. Two of them have 3 V and 5 V across them. What is the voltage across the third, in volts?

Answer: V

3. A 3.7 V battery pushes 20 C of charge round a circuit. How much energy does it give that charge, in joules?

Answer: J

4. A 6 V battery delivers 0.5 A for 10 s. How much energy does it hand out, in joules? (First find the charge.)

Answer: J

5. To measure the voltage of a lamp, where do the meter's two probes go?

  • Both on the same wire, a little apart
  • One on each side of the lamp
  • In the gap made by opening the circuit

Apply it

In the circuits lab, build a series circuit whose three resistor voltages are roughly in the ratio 1 : 2 : 3 on a 6 V supply. Record the voltages and show they add to 6 V. Explain in one sentence what each resistor is doing with the energy.

Reflect

The ski-lift picture explains voltage well. Where do you think it might break down?

Conductors, insulators and why silicon

Copper and glass differ in resistivity by about a hundred billion billion times. Silicon sits in between, and that is why your phone works.

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Every chip, solar panel and LED starts with a materials choice. Knowing why copper makes good wires, rubber good insulation and silicon good transistors is the first step on a thread that will lead, in later years, to designing the circuits inside processors.

Goals

Predict

You warm up a piece of pure silicon and a piece of copper by the same amount. What happens to their resistance?

  1. Both go up
  2. Both go down
  3. Copper's goes up a little; silicon's falls a lot
  4. Neither changes

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Start with copper, then step through every material and watch the marker jump along the resistivity scale. Pick pure silicon and raise the temperature from 20 °C to 100 °C. Then compare pure silicon with doped silicon at the same size. Which change made the bigger difference?

What the interactive shows, in words

The materials explorer places eight materials on a resistivity scale from 10⁻⁹ to 10¹⁴ ohm-metres: copper, aluminium and nichrome in the conductor region; germanium, pure silicon and doped silicon in the semiconductor region; glass and rubber in the insulator region. Heating copper from 20 °C to 70 °C raises its resistance about 20%; heating pure silicon over the same range cuts its resistance by more than ten times. Doped silicon conducts millions of times better than pure silicon.

Understand

Resistivity: a property of the material

Resistivity (ρ, in ohm-metres) says how strongly a material opposes current, whatever its shape. Copper is about 1.7 × 10⁻⁸ Ω·m, glass around 10¹² Ω·m. Conductors, semiconductors and insulators are three bands on that enormous scale.

Free carriers make the difference

Current needs charges free to move. In a metal, each atom lends electrons to a shared 'sea', so there are vast numbers of free carriers. In an insulator, electrons are tightly bound. The band picture says the same thing: to move, an electron must jump an energy gap, which is zero in metals, small in semiconductors (1.1 eV for silicon) and large in insulators (about 9 eV for glass).

Semiconductors can be tuned

In pure silicon, heat lifts a few electrons across the gap, so warming it lowers its resistance. Adding a few impurity atoms per million, called doping, supplies extra carriers and cuts resistivity by millions of times. N-type doping adds electrons; p-type creates 'holes'. Joining the two makes diodes and transistors.

Why silicon?

Silicon is the second most common element in Earth's crust (it is in sand). It grows a tough, insulating oxide layer that chipmakers use to build transistors. Its gap is wide enough to work reliably when hot, yet doping controls it precisely. Germanium came first, but heat frees too many of its electrons.

Explain it another way: intuitive

Think of a crowded car park. In a metal, the cars are already on the road: traffic flows easily. In an insulator, every car is locked in its space. A semiconductor is a car park where a few cars get out on a warm day, and where you can deliberately add cars by doping.

Explain it another way: technical

Conductivity depends on carrier density and mobility. Intrinsic carrier density in a semiconductor grows roughly as T^1.5·exp(−Eg/2kT), so resistance falls steeply with temperature. Doping sets the carrier density by design, independent of temperature over a wide range.

Explain it another way: mathematical

Compare resistivities on a log scale: log₁₀(2.3 × 10³ ÷ 1.7 × 10⁻⁸) ≈ 11, so pure silicon resists about 10¹¹ times more than copper. In the explorer's model, pure silicon at 70 °C has under a tenth of its 20 °C resistance.

Explain it another way: applied

Thermistors in battery packs and 3D-printer nozzles sense temperature through this effect. Solar cells and LEDs are doped silicon or related semiconductors. The copper tracks on a circuit board connect billions of doped-silicon transistors sealed in a plastic or ceramic insulator.

Try these examples

Example 1

How many powers of ten separate the resistivity of copper (1.7 × 10⁻⁸ Ω·m) from glass (10¹² Ω·m)?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. Pure silicon at room temperature is best described as…

  • A conductor
  • An insulator
  • A semiconductor

2. What does doping do to silicon?

  • Adds a few impurity atoms that supply extra charge carriers, lowering resistivity hugely
  • Coats it in metal so it conducts
  • Heats it permanently

3. Pure silicon's resistivity is about 2.3 × 10³ Ω·m and copper's about 1.7 × 10⁻⁸ Ω·m. To the nearest whole number, how many powers of ten apart are they?

Answer:

4. A thermistor's resistance falls as it warms up. It is most likely made of…

  • Copper
  • A semiconductor
  • Rubber

5. Which is NOT a reason chips are made from silicon?

  • It is abundant, found in sand
  • It forms an excellent insulating oxide layer
  • It is the best electrical conductor known
  • Its conductivity can be set precisely by doping

Apply it

Write a one-paragraph materials brief for a temperature sensor in a robot's battery pack: which class of material, why, and how the robot could read it. (Hint: next week's lessons put sensors like this in a circuit.)

Reflect

Why might it matter that a material's electrical behaviour can be controlled, not just that it is good or bad at conducting?

Week 11: Current and resistance

This week you will

What resistance does, and what sets it

A toaster element and a phone cable can both be made of metal. Why does one glow red hot while the other stays cool?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Choosing a wire gauge, a heating element or a current-limiting resistor all come down to resistance. Get it too low and parts overheat; too high and motors stall and voltages sag.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

You double the length of a wire and also double its thickness (cross-sectional area). Its resistance…

  1. Doubles
  2. Halves
  3. Stays the same
  4. Goes up four times

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose copper. Double the length and watch R. Return it, then double the cross-section. Now try nichrome with the same size: how many times bigger is R? Find a length of nichrome that has the same resistance as 100 m of copper.

What the interactive shows, in words

In the materials explorer with copper, doubling the length doubles the resistance; doubling the cross-section halves it. Nichrome of the same size has about 65 times the resistance of copper, which is why heating elements use it. About 1.5 m of nichrome at 1 mm² matches the resistance of 100 m of copper at 1 mm².

Understand

Resistance limits current

Resistance (R, in ohms, Ω) is how strongly a component opposes current. For the same voltage, more resistance means less current. Resistance also turns electrical energy into heat: wanted in a toaster, wasted in a cable.

Material, length and thickness

A wire's resistance depends on its material (resistivity ρ), its length L and its cross-sectional area A. Long, thin, high-resistivity wire resists most. Toaster elements are nichrome, about 65 times more resistive than copper, so they heat; cables are thick copper, so they stay cool.

Numbers engineers meet

10 m of 1 mm² copper is about 0.17 Ω. A small resistor on a circuit board might be 220 Ω or 10 kΩ (10,000 Ω). Insulation on a cable is many millions of ohms. The kilohm (kΩ) and megohm (MΩ) save writing zeros.

Explain it another way: intuitive

Walking through a crowd: a long corridor slows you more than a short one, a wide corridor lets more people through at once, and a crowd of strangers who won't move (high resistivity) is worse than one that parts easily.

Explain it another way: technical

Resistance is the ratio of voltage to current for a component, R = V ÷ I. For a uniform conductor R = ρL/A, where ρ is the material's resistivity at the operating temperature.

Explain it another way: mathematical

Nichrome, ρ = 1.1 Ω·mm²/m, 2 m long, 0.5 mm²: R = 1.1 × 2 ÷ 0.5 = 4.4 Ω. Copper of the same size: 0.0168 × 2 ÷ 0.5 = 0.0672 Ω, about 65 times less.

Explain it another way: applied

Electric-vehicle and robot battery cables are thick so their resistance, and therefore heating and voltage drop, stays tiny at high current. Strain gauges exploit the formula: stretching a thin foil makes it longer and thinner, so its resistance rises and reveals the force.

Derivation: Why R = ρ × L ÷ A
  1. Cut a wire into slices of equal length. Charge must pass through every slice in turn, so the slices are in series and their resistances add. Twice as long means twice as many slices: R ∝ L.

  2. Now think of the wire as many thin strands side by side. Each strand is another path, so more strands make it easier for charge to flow. Twice the cross-section means twice as many parallel strands: R ∝ 1 ÷ A.

  3. Put both together and include the material's own resistivity ρ: R = ρ × L ÷ A.

  4. Units check: ρ in Ω·m, L in m, A in m² gives Ω·m × m ÷ m² = Ω. With ρ in Ω·mm²/m you can use L in metres and A in mm² directly (copper: 0.0168 Ω·mm²/m).

Try these examples

Example 1

Find the resistance of 10 m of copper wire with a cross-section of 1 mm² (ρ = 0.0168 Ω·mm²/m).

The worked solution is in the online lesson.

Example 2

The same wire is replaced by one twice as thick (2 mm²) and half as long (5 m). New resistance?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. You use a wire three times as long, same material and thickness. Its resistance…

  • Is a third
  • Stays the same
  • Triples

2. A copper wire is 25 m long with a cross-section of 0.5 mm². Its resistivity is 0.0168 Ω·mm²/m. What is its resistance, in ohms?

Answer: Ω

3. A nichrome element (ρ = 1.1 Ω·mm²/m) is 2 m long with a 0.5 mm² cross-section. What is its resistance, in ohms?

Answer: Ω

4. Why are a robot's battery cables made thick?

  • Thick cables look more robust
  • Larger area means lower resistance, so less heating and voltage drop at high current
  • Thick cables store extra charge

5. A copper wire has resistance 0.8 Ω. You replace it with one of the same material, half as long and twice the cross-section. New resistance in ohms?

Answer: Ω

Apply it

Design the heating element for a model greenhouse heater: it must have about 4 Ω. Choose nichrome, then find two different length-and-thickness combinations that work, and say which you would pick and why (think about space and strength).

Reflect

Strain gauges turn stretching into a resistance change. Using R = ρL ÷ A, explain why stretching increases resistance in two ways.

The water analogy, and where it breaks

Engineers love comparing circuits to water pipes. But if you cut a wire, why doesn't electricity pour out on the floor?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Analogies are engineering tools: they let you guess an answer quickly. Good engineers also know exactly where an analogy stops working, so it never leads them into a wrong design.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

In the water picture, a battery is a pump, current is water flow and a resistor is a narrow pipe. If you swap in a much narrower pipe, the flow…

  1. Increases
  2. Decreases
  3. Stays the same

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Test the analogy. In a series circuit, raise R1 and watch the current fall (narrower pipe, less flow). Raise the supply voltage (stronger pump). Now switch to parallel and add a second path: does total flow go up, as more pipes would suggest? Write down one prediction the analogy got right and one you are not sure about.

What the interactive shows, in words

In the circuits lab, raising a series resistor lowers the current, raising the supply voltage raises it, and adding a parallel branch increases the total current. These match the water analogy's predictions. The analogy fails for an open circuit, where the current stops completely rather than spilling out.

Understand

Where it helps

Battery ↔ pump (it creates a pressure difference). Voltage ↔ pressure difference. Current ↔ flow rate (litres per second ↔ coulombs per second). Resistor ↔ narrow pipe. Series ↔ pipes one after another; parallel ↔ pipes side by side. Use it to guess: more pump pressure, more flow; more narrowing, less flow; more parallel pipes, more total flow.

Where it breaks

Cut a pipe and water spills; cut a wire and charge simply stops, because charges repel and there is no 'outside' for them to flow into. Wires are not empty pipes that fill up: they are already full of free electrons. Water has weight and falls; charge does not. And a battery does not hold a tank of charge: it is an energy source.

Test, do not trust

The analogy is a hypothesis generator. Every prediction should be checked against the real relationships (V = IR, the loop rule, the junction rule) or a simulation. Next week those relationships get exact numbers.

Explain it another way: intuitive

An analogy is like a map drawn from memory: brilliant for getting your bearings, unreliable in the details. Use it to choose a direction, then check the street signs.

Explain it another way: technical

The hydraulic analogy maps electric potential to pressure, current to volumetric flow and resistance to flow resistance (as in Poiseuille flow). It captures linear, steady behaviour but not field effects, charge repulsion or why an open circuit carries no current at all.

Explain it another way: applied

Engineers still use the analogy, and its mechanical cousins (springs as capacitors, masses as inductors), to reason about sensors and motor drives. They also use circuit simulators, which follow the real equations, before trusting the analogy's answer.

Try these examples

Example 1

Use the analogy to predict what happens to total current when you add a second resistor in parallel. Then check the real answer.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. In the water analogy, voltage corresponds to…

  • The amount of water in the pipes
  • The pressure difference the pump creates
  • The width of the pipe

2. Which prediction of the water analogy is WRONG for a real circuit?

  • More pump pressure gives more flow
  • A narrower pipe gives less flow
  • Cutting the pipe makes the charge spill out of the gap
  • Two pipes side by side carry more than one

3. The analogy tempts people to think a battery is a tank of charge. What is it really?

  • A store of energy that pushes charge already in the wires
  • A store of electrons that get used up
  • A pipe with no resistance

4. A component has 5.64 V across it and 12 mA through it. What is its resistance, in ohms?

Answer: Ω

5. Using the analogy and then checking with V = IR: a 6 V supply has one 1 kΩ resistor (6 mA). You add a second 1 kΩ in parallel. The total current becomes…

  • 3 mA
  • 6 mA
  • 12 mA

Apply it

Write a two-column table: 'The analogy predicts…' and 'The circuits lab shows…'. Fill at least four rows, including one where they disagree. Finish with a one-sentence rule for when you will and will not trust the analogy.

Reflect

Think of another analogy for current (traffic, a bicycle chain, a crowd). Where does your analogy break?

Real resistors, and sensors that resist

Why can you buy a 4.7 kΩ resistor but not a 4.5 kΩ one? And how can a resistor tell a robot that it is getting dark?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Real parts are not the round numbers in textbook problems. Engineers design with the values they can buy and the tolerances they come with, and they turn resistance changes into sensors that let machines feel light, heat and force.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A resistor is marked 1 kΩ ± 5%. Which reading on a meter would mean it is faulty?

  1. 980 Ω
  2. 1040 Ω
  3. 1080 Ω

Write down your guess and your reason. The reveal is in the online lesson.

Discover

In the Electronics Studio, place a resistor across a low-voltage supply and read the current. Swap it for the next standard value up and down and compare. If the studio offers a light-dependent resistor or thermistor, sweep the light or temperature and record how its resistance and current change.

What the interactive shows, in words

In the Electronics Studio, a resistor across a low-voltage supply carries a current set by its value; stepping to neighbouring standard values changes the current by about 10% each step. A light-dependent resistor's resistance falls as light increases, raising the current; a thermistor's falls as temperature rises.

Understand

Preferred values

Manufacturers sell resistors in E-series steps. The E24 series has 24 values per decade (1.0, 1.1, 1.2, 1.3, 1.5, … 8.2, 9.1), each about 10% above the last, so 4.7 kΩ exists but 4.5 kΩ does not. The steps are spaced so that, with ±5% tolerance, every resistance is close to some value you can buy.

Tolerance

A resistor marked 4.7 kΩ ± 5% could really be anywhere from 4.7 × 0.95 = 4465 Ω to 4.7 × 1.05 = 4935 Ω. Good designs still work at both ends of every part's range.

Power rating

A resistor turns electrical energy into heat. Small through-hole resistors are commonly rated at 0.25 W; beyond that they overheat. Week 14 shows how to calculate the power; the circuits lab warns you when a resistor would exceed 0.25 W.

Resistors as sensors

A light-dependent resistor (LDR) is a semiconductor whose resistance falls in bright light, from tens of kilohms in the dark to hundreds of ohms in sunshine. An NTC thermistor falls in resistance as it warms. Put either in a circuit and a changing resistance becomes a changing voltage the robot can read.

Explain it another way: intuitive

Resistor values are like shoe sizes: you can't buy size 7.3, but the sizes are spaced so one of them will fit well enough, and every shoe has a little give.

Explain it another way: technical

E-series values follow a geometric sequence with ratio 10^(1/n): for E24, 10^(1/24) ≈ 1.10. Tolerance bands specify the maximum deviation from the nominal value at a stated temperature. Sensor resistances follow characteristic curves given on datasheets.

Explain it another way: mathematical

Range = nominal × (1 ± tolerance). 2.2 kΩ ± 10% → 1980 Ω to 2420 Ω. The current through it at 5 V ranges from 5 ÷ 2420 = 2.07 mA to 5 ÷ 1980 = 2.53 mA.

Explain it another way: applied

Automatic street lights and phone screens dim or brighten using light sensors. 3D printers read nozzle temperature with a thermistor. Production engineers check that a product still meets its specification when every resistor sits at the worst end of its tolerance.

Try these examples

Example 1

A design needs about 450 Ω. Which E24 value would you choose, and what is its 5% range?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A 470 Ω ± 5% resistor: what is the lowest resistance it could have, in ohms?

Answer: Ω

2. A resistor is marked 220 Ω ± 10%. What is the smallest resistance it could really have, in ohms?

Answer: Ω

3. Why don't shops sell every possible resistance value?

  • Only E24 values obey Ohm's law
  • Steps about 10% apart, combined with tolerance, already cover every value closely enough
  • Other values would be too expensive to calculate with

4. An LDR is moved from bright light into darkness. Its resistance…

  • Falls
  • Rises
  • Stays the same

5. An NTC thermistor in a battery pack reads 10 kΩ at 25 °C. If the pack heats up, the reading will…

  • Go above 10 kΩ
  • Go below 10 kΩ
  • Stay at 10 kΩ

Apply it

A night-light robot must switch its lamp on when it gets dark. Sketch which component senses the darkness, what happens to its resistance at dusk, and what question you would still need to answer to turn that resistance into a decision (you will answer it in week 13 with a voltage divider).

Reflect

Why does designing for the worst-case tolerance make a product more reliable when thousands are built?

Week 12: Ohm's law in simulation

This week you will

Ohm's law: V = I × R

Measure the current through a resistor at 1 V, 2 V and 3 V. One number connects all three readings. Can you find it before the graph does?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Ohm's law is the most-used equation in electronics. Every time an engineer picks a resistor, checks a sensor or debugs a dead circuit, this one line of algebra is doing the work.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A resistor carries 10 mA at 2 V. What current will it carry at 6 V?

  1. 10 mA
  2. 30 mA
  3. 60 mA
  4. It depends on the colour of the resistor

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose the 220 Ω resistor. Record points at 1 V, 2 V, 4 V and 6 V and check that V ÷ I is the same each time. Do the same for the 100 Ω resistor: which line is steeper? Then try the filament lamp and the LED and record three points each. What is different about their V ÷ I?

What the interactive shows, in words

The V–I plotter shows current (0 to 60 mA) against voltage (0 to 6 V). The 100, 220 and 470 ohm resistors give straight lines through the origin; the 100 ohm line is steepest. The filament lamp's curve bends over as its resistance rises. The LED passes almost no current below about 1.8 V, then rises steeply. Recorded points are listed in a table with V ÷ I for each.

Understand

The law

For a resistor at a steady temperature, V = I × R. Know any two of voltage (V), current (A) and resistance (Ω) and you can find the third. A 220 Ω resistor with 20 mA through it has 0.02 × 220 = 4.4 V across it.

Units are where answers go wrong

Convert first: mA ÷ 1000 → A, kΩ × 1000 → Ω. A current of 5 mA through 2.2 kΩ is 0.005 A × 2200 Ω = 11 V. Then sanity-check: does the answer have the right size and unit?

Reading the graph

Plot current against voltage. For a resistor you get a straight line through the origin: that is what 'ohmic' means. The slope is I ÷ V = 1 ÷ R, so a steeper line means a smaller resistance.

Not everything is ohmic

A filament lamp's line curves over: as it heats, its resistance rises. An LED passes almost nothing below about 1.8–2 V and then the current shoots up. For these, V ÷ I still gives 'the resistance right now', but it changes from point to point.

Explain it another way: intuitive

Resistance is how many volts it takes to push each amp through. A 'stubborn' 470 Ω part needs 470 V per amp (0.47 V per mA); an easy-going 100 Ω part needs only 100 V per amp.

Explain it another way: technical

Ohm's law is an empirical, linear relationship valid for many conductors at constant temperature. Components whose I–V characteristic is non-linear (lamps, diodes, LEDs, transistors) are called non-ohmic; their static resistance V/I varies with operating point.

Explain it another way: mathematical

From (2 V, 10 mA): R = 2 ÷ 0.010 = 200 Ω. At 6 V: I = 6 ÷ 200 = 0.03 A = 30 mA. For a 9 V supply across 450 Ω: I = 9 ÷ 450 = 0.02 A = 20 mA.

Explain it another way: applied

When a robot's motor will not start, an engineer measures the voltage across it and the current through it. V ÷ I tells them whether the winding is shorted (tiny R), open (huge R) or fine, before anything is taken apart.

Derivation: One law, three forms
  1. Start from the experimental finding: for a resistor, current is proportional to voltage, I ∝ V. The constant of proportionality is 1/R, so I = V ÷ R.

  2. Multiply both sides by R: V = I × R.

  3. Divide both sides of V = I × R by I: R = V ÷ I.

  4. Units: volts = amps × ohms. If I is in mA and R in kΩ, the factors of 1000 cancel (10⁻³ × 10³), so mA × kΩ gives volts directly: 5 mA × 2.2 kΩ = 11 V.

Try these examples

Example 1

A 9 V battery is connected across a 450 Ω resistor. What current flows?

The worked solution is in the online lesson.

Example 2

A sensor has 3.3 V across it and draws 1.5 mA. What is its resistance?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. There are 6 V across a 1.5 kΩ resistor. What current flows, in milliamps?

Answer: mA

2. On a current-against-voltage graph, resistor X's line is steeper than resistor Y's. Which has the larger resistance?

  • X
  • Y
  • They are equal

3. There are 3.76 V across a 470 Ω resistor. What current flows, in milliamps?

Answer: mA

4. A component has 5.64 V across it and 12 mA through it. What is its resistance, in ohms?

Answer: Ω

5. A filament lamp's V–I graph curves so that equal voltage steps give smaller and smaller current steps. Why?

  • The lamp is broken
  • Its filament heats up and its resistance rises
  • Ohm's law stops working at high voltage for everything

6. 5 mA flows through a 2.2 kΩ resistor. What is the voltage across it, in volts?

Answer: V

Apply it

In the V–I plotter, record four points for an unknown-to-you component (choose one without reading its label first) and work out its resistance from the slope. Then decide whether it is ohmic and justify your answer with your data.

Reflect

Why is it useful that resistance shows up as the slope of a graph, rather than only as a number in a formula?

Keep the LED alive: current-limiting resistors

Connect a red LED straight to a 5 V supply and it may flash brightly once and never again. One resistor prevents it. Which one?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Status LEDs are on almost every board you will ever design, and the current-limiting resistor is often the first calculation a new electronics engineer gets checked on. It combines everything so far: the loop rule, Ohm's law and real resistor values.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A red LED (2.0 V when lit) runs from 5 V through a resistor. How much voltage does the resistor take?

  1. 5 V
  2. 3 V
  3. 2 V
  4. 0 V

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose the LED circuit with a red LED. Set 5 V and find the smallest resistor that keeps the LED at or below 20 mA. Then switch to a blue LED. Why does the same resistor now give less current? Finally lower the supply below the LED's forward voltage and explain what you see.

What the interactive shows, in words

In the circuits lab's LED circuit, the readout shows the LED current and warns above 20 mA. On 5 V with a red LED (2.0 V), 150 ohms gives 20 mA; 220 ohms gives about 13.6 mA. Switching to a blue LED (3.0 V) with the same resistor lowers the current because the resistor's share of the voltage falls. Below the forward voltage, no current flows and the LED is off.

Understand

LEDs are not resistors

An LED is a diode: below its forward voltage almost no current flows, and above it the current rises extremely steeply (you saw this on the V–I plotter). On its own it cannot limit its own current, so a tiny overshoot in voltage can mean a huge, destructive current.

The resistor takes the rest

Put a resistor in series. The LED settles at about its forward voltage and the resistor takes the remainder, Vs − Vf. Because the resistor is ohmic, that voltage fixes the current: I = (Vs − Vf) ÷ R.

Pick a real value, then recheck

Calculate R, choose the next standard value up (so the current is a little less, not more), then recalculate the current and the resistor's power. Typical small indicator LEDs are rated around 20 mA; 5–15 mA is usually bright enough.

Explain it another way: intuitive

The LED is like a door that is jammed shut until you push past a threshold, then flies wide open. The resistor is a doorstop that stops it slamming.

Explain it another way: technical

An LED's I–V curve is roughly exponential above its knee. A series resistor linearises the circuit: with Vf approximately constant over the operating range, the current is set by the resistor, I ≈ (Vs − Vf)/R, a simple fixed-drop model.

Explain it another way: mathematical

9 V supply, red LED, 20 mA target: R = (9 − 2) ÷ 0.020 = 350 Ω. Next E24 value up is 360 Ω: I = 7 ÷ 360 ≈ 19.4 mA. Resistor power: 7 V × 0.0194 A ≈ 0.136 W, under a 0.25 W rating.

Explain it another way: applied

Every power, charging and error light on a robot controller is a calculation like this. Because blue and white LEDs drop about 3 V, designers sometimes cannot run them from 3.3 V logic with a sensible resistor and need a different circuit.

Derivation: Where R = (Vs − Vf) ÷ I comes from
  1. Loop rule around supply, resistor and LED: Vs = V_R + Vf, where Vf is the LED's forward voltage (about 2.0 V for red, 3.0 V for blue in this model).

  2. So the resistor's voltage is V_R = Vs − Vf.

  3. It is a series loop, so the same current I flows through the resistor and the LED. Ohm's law for the resistor: V_R = I × R.

  4. Combine: I × R = Vs − Vf, so R = (Vs − Vf) ÷ I.

  5. Example: Vs = 5 V, red LED, I = 15 mA: R = (5 − 2) ÷ 0.015 = 200 Ω. The nearest standard value above is 220 Ω, giving I = 3 ÷ 220 ≈ 13.6 mA: safe and still bright.

Try these examples

Example 1

A blue LED (Vf = 3.0 V) on a 5 V supply should take 10 mA. Which resistor?

The worked solution is in the online lesson.

Example 2

Why is the 'next value up' safer than the 'nearest value'?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A red LED (Vf = 2.0 V) runs from 5 V and should carry 15 mA. What series resistor is needed, in ohms?

Answer: Ω

2. A red LED drops 2.0 V when lit. It runs from a 12 V supply and should carry 5 mA. What series resistor is needed, in ohms?

Answer: Ω

3. You fit a 220 Ω resistor in series with a red LED (Vf = 2.0 V) on 5 V. What current actually flows, in milliamps?

Answer: mA

4. Why must an LED never be connected straight across a 5 V supply?

  • LEDs only work on AC
  • Without a resistor nothing limits the current, which can rise far above the LED's rating
  • It would be too dim

5. The same 150 Ω resistor and 5 V supply are used with a red LED (2.0 V) and then a blue LED (3.0 V). Which carries more current?

  • Red
  • Blue
  • The same

Apply it

Design the power light for a 9 V robot: choose a red or blue LED, a current between 5 and 15 mA, the standard resistor, and check its power is under 0.25 W. Build it in the circuits lab and record the simulated current next to your calculation.

Reflect

Which step of the LED calculation would you most like a teammate to double-check, and why?

Module check: when calculation meets simulation

Your calculation says 4.50 mA. The simulator says 4.49 mA. A meter on a real board might say 4.3 mA. Who is right?

About 40 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Engineers never trust a single source. They calculate, simulate and measure, and when the three disagree they find out why. That habit catches more design mistakes than any formula.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

You calculate a current of exactly 4.5 mA, but a simulator shows 4.49 mA. Most likely…

  1. The simulator has a bug
  2. Ohm's law is slightly wrong
  3. Rounding, or the simulator used a standard resistor value that differs from your number
  4. The battery is running out

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Pick three circuits from this module (a single resistor, an LED with its resistor, and two resistors in series). For each, write your calculated current before you run the Electronics Studio, then record what it shows. Mark each pair 'matches', 'small difference' or 'big difference', and explain every big one.

What the interactive shows, in words

Learners compare calculated currents with the Electronics Studio's readings for three circuits: a single resistor, an LED with a series resistor and two resistors in series. Small differences come from rounding and standard values; differences of exactly 1000 times point to unit slips; a zero current in an LED circuit usually means the supply is below the LED's forward voltage.

Understand

Three ways to know

A calculation shows you understand the circuit. A simulation checks the arithmetic and handles circuits too tedious to solve by hand. A measurement checks reality, including everything the model left out. Agreement between all three is evidence; disagreement is a clue.

Small differences

Rounding during the calculation, standard resistor values instead of ideal ones, and resistor tolerance (±5%) all cause small differences. If your answer is within a few per cent and you can name the reason, that is a match.

Big differences

Ten times out? Look for a unit mistake (mA vs A, kΩ vs Ω). Current zero? Look for an open circuit or an LED below its forward voltage. Wildly high? Look for a short circuit or a resistor in parallel instead of series.

Meters change circuits too

An ammeter measures current, so the current must pass through it: it goes in series and has very low resistance. A voltmeter measures a difference across a part, so it goes in parallel and has very high resistance. Wire them the wrong way and you change, or even short out, the circuit you are measuring.

Explain it another way: intuitive

Calculating, simulating and measuring are like three friends describing the same film. If they all agree, you can trust the plot. If one disagrees, ask what they missed.

Explain it another way: technical

Verification asks whether the model was solved correctly (calculation vs simulation). Validation asks whether the model matches reality (simulation vs measurement). Discrepancies are classified by size against known sources of error: rounding, component tolerance, instrument loading and model assumptions.

Explain it another way: mathematical

A 1 kΩ ± 5% resistor on 5 V: the current can be anywhere from 5 ÷ 1050 ≈ 4.76 mA to 5 ÷ 950 ≈ 5.26 mA. A measurement of 5.1 mA is consistent with the design; 6.0 mA is not.

Explain it another way: applied

Before a circuit board is manufactured, its design is simulated; when the first prototypes arrive, engineers measure key voltages and currents and compare them with both. Disagreements are logged and explained before production starts.

Try these examples

Example 1

A student calculates 0.45 A through a 2 kΩ resistor on 9 V. The simulator shows 4.5 mA. Diagnose.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. To measure the current through a resistor, the ammeter must be…

  • Connected across the resistor, in parallel
  • Connected in series, so the current flows through it
  • Connected anywhere, as long as it is switched on

2. A 1 kΩ ± 5% resistor is across 5 V. What is the largest current it could carry, in milliamps?

Answer: mA

3. There are 3.76 V across a 470 Ω resistor. What current flows, in milliamps?

Answer: mA

4. A red LED drops 2.0 V when lit. It runs from a 9 V supply and should carry 20 mA. What series resistor is needed, in ohms?

Answer: Ω

5. A motor draws a steady 1200 mA for 60 s. How much charge flows through it, in coulombs?

Answer: C

6. A nichrome wire is 10 m long with a cross-section of 1.5 mm². Its resistivity is 1.1 Ω·mm²/m. What is its resistance, in ohms?

Answer: Ω

7. A simulated LED circuit shows 0 mA. The supply is 2.5 V, the LED is blue (3.0 V) and the resistor is 100 Ω. Why?

  • The resistor is too small
  • The supply is below the LED's forward voltage, so it never turns on
  • Ohm's law does not apply to LEDs

8. Your answer is exactly 1000 times bigger than the simulator's. The most likely cause is…

  • Resistor tolerance
  • Rounding
  • A unit slip, such as mA vs A or kΩ vs Ω

Apply it

Write a one-page 'verification log' for the three circuits you checked: circuit, calculated value, simulated value, match category and explanation. Add one line on what a real measurement might show differently and why.

Reflect

Which kind of mistake did you catch most often this module: units, connections or something else? How will you check for it next time?

Week 13: Series and parallel circuits

This week you will

Series circuits: one path, shared voltage

Old strings of fairy lights went completely dark when one bulb failed. What does that tell you about how they were wired?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Series connections are everywhere: a current-limiting resistor with an LED, a chain of battery cells, a sensor in a divider. Knowing how they share voltage lets you predict every reading on the chain.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 220 Ω, a 470 Ω and a 1 kΩ resistor are in series on 9 V. Which one has the most voltage across it?

  1. The 220 Ω, because it is first
  2. The 1 kΩ, because it is biggest
  3. All the same, because the current is the same

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose series with three resistors: 220 Ω, 470 Ω and 1 kΩ on 9 V. Check that the three voltages add to 9 V. Now double one resistor and predict, before looking, which voltages go up and which go down. Finally drop the supply until no resistor's power is shaded.

What the interactive shows, in words

The series and parallel builder, in series mode with 220, 470 and 1000 ohms on 9 volts, reports a total of 1690 ohms and 5.33 mA through every resistor. The voltages are about 1.17, 2.50 and 5.33 volts, adding to 9 volts. A table lists voltage, current and power for each part and flags any above 0.25 watts.

Understand

One path, one current

Components in series are joined end to end with no branches. Charge has only one route, so the current is identical through every part, and a break anywhere stops it everywhere. That is why the old fairy lights went dark.

Resistances add

The total resistance is the sum: R = R1 + R2 + …. Adding a resistor in series always increases the total and reduces the current.

Voltage is shared in proportion

Each resistor's voltage is V = I·R, so bigger resistors take bigger shares, and the shares add up to the supply. For 220 Ω, 470 Ω and 1 kΩ on 9 V: R = 1690 Ω, I = 9 ÷ 1690 ≈ 5.33 mA, voltages ≈ 1.17 V, 2.50 V and 5.33 V.

Explain it another way: intuitive

A relay race on a single track: every runner carries the baton (the current) in turn, and the total race time is the sum of each leg. Remove one runner and the race stops.

Explain it another way: technical

Series elements share a single current. Equivalent resistance is the algebraic sum, and the voltage across each element is proportional to its resistance: Vk = V·Rk/ΣR.

Explain it another way: mathematical

R = 220 + 470 + 1000 = 1690 Ω. I = 9 ÷ 1690 = 5.325 mA. V(1 kΩ) = 0.005325 × 1000 = 5.33 V. Check: 1.17 + 2.50 + 5.33 = 9.00 V.

Explain it another way: applied

Battery packs put cells in series to add their voltages: four 3.7 V lithium cells give about 14.8 V for a drone's motors. A current-limiting resistor works precisely because it is in series with the LED.

Derivation: Why series resistances add
  1. In series there is only one path, so the same current I flows through every resistor.

  2. By the loop rule, the supply voltage is shared: V = V1 + V2 + V3.

  3. Ohm's law for each resistor: V1 = I·R1, V2 = I·R2, V3 = I·R3. So V = I·R1 + I·R2 + I·R3 = I·(R1 + R2 + R3).

  4. The whole chain therefore behaves like one resistor with R = R1 + R2 + R3, since V = I·R.

Try these examples

Example 1

100 Ω and 330 Ω are in series on 12 V. Find the current and the voltage across each.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. What is the total resistance of 220 Ω, 470 Ω and 1000 Ω in series, in ohms?

Answer: Ω

2. Resistors of 1500 Ω, 150 Ω are in series across a 3 V supply. What current flows, in milliamps?

Answer: mA

3. Two resistors, 1 kΩ and 2 kΩ, are in series on 6 V. What is the voltage across the 2 kΩ resistor, in volts?

Answer: V

4. You add a third resistor in series with two others. The current from the supply…

  • Increases
  • Decreases
  • Stays the same

5. Four 1.5 V cells are connected in series, + to −. What voltage do they give?

  • 1.5 V
  • 3 V
  • 6 V

Apply it

Using the builder, design a series chain from a 9 V supply where one resistor has between 2.9 V and 3.1 V across it, using only values the slider offers. Show your calculation and the builder's readout.

Reflect

Series wiring makes one failure stop everything. When might an engineer actually want that?

Parallel circuits: many paths, shared current

Add another resistor to a circuit and the total resistance goes DOWN. How can more resistors mean less resistance?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Every socket in a building, every sensor on a robot's power rail, every LED on a matrix display is wired in parallel, so each gets the full supply voltage and works independently.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 1 kΩ resistor across 6 V draws 6 mA. A second 1 kΩ is added in parallel. What happens to the total current?

  1. Halves to 3 mA
  2. Stays at 6 mA
  3. Doubles to 12 mA

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose the parallel circuit on 6 V. Set R1 = R2 = 1 kΩ and read the total resistance and current. Now make R2 ten times bigger: does the total resistance get close to R1 or to R2? Make R2 ten times smaller. Write a rule for which branch 'wins'.

What the interactive shows, in words

In the circuits lab's parallel circuit on 6 volts, two 1 kΩ resistors give a total of 500 ohms and 12 mA. Making R2 ten times bigger (10 kΩ) gives about 909 ohms, close to R1; making R2 ten times smaller (100 Ω) gives about 91 ohms, close to R2. The smaller branch always dominates.

Understand

Same voltage, separate paths

Components in parallel connect across the same two points, so each has the full supply voltage and its own current. Break one branch and the others carry on, which is why house lights do not all go out when one bulb fails.

Currents add, resistance falls

The supply current is the sum of the branch currents. Every extra branch is another path, so the combined resistance is smaller than the smallest branch. Two equal resistors in parallel give exactly half.

The small branch dominates

1 kΩ ∥ 10 kΩ = 10,000,000 ÷ 11,000 ≈ 909 Ω, close to the 1 kΩ. The low-resistance branch carries most of the current, so it sets the total. A very small resistor in parallel with anything is almost a short circuit.

Explain it another way: intuitive

Opening more checkout tills in a supermarket: each till (branch) serves its own queue, the total number of shoppers served per minute goes up, and the shop as a whole lets people through more easily.

Explain it another way: technical

Parallel elements share a common voltage. Conductances (G = 1/R, in siemens) add: G = G1 + G2 + …, and branch currents divide in proportion to conductance (Kirchhoff's current law at each node).

Explain it another way: mathematical

1 kΩ ∥ 2 kΩ on 6 V: I1 = 6 mA, I2 = 3 mA, total 9 mA. R = 2,000,000 ÷ 3000 ≈ 666.7 Ω, and 6 ÷ 666.7 = 9 mA. The two methods agree.

Explain it another way: applied

A robot's 5 V rail feeds a microcontroller, sensors and LEDs in parallel: each gets 5 V, and the power supply must deliver the sum of all their currents. Engineers add those currents up to size the regulator.

Derivation: Why 1/R = 1/R1 + 1/R2
  1. Each branch connects directly across the supply, so every branch has the same voltage V.

  2. Charge splits at the junction and rejoins afterwards, so the currents add: I = I1 + I2.

  3. Ohm's law for each branch: I1 = V/R1 and I2 = V/R2, so I = V/R1 + V/R2 = V·(1/R1 + 1/R2).

  4. For one equivalent resistor I = V/R, so 1/R = 1/R1 + 1/R2.

  5. For exactly two resistors this rearranges to R = R1·R2 ÷ (R1 + R2) ('product over sum'). Check: 1 kΩ ∥ 1 kΩ = 1,000,000 ÷ 2000 = 500 Ω.

Try these examples

Example 1

A 470 Ω and a 330 Ω resistor are in parallel on 5 V. Find the combined resistance and total current.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. Two 2.2 kΩ resistors are in parallel. What is the combined resistance, in ohms?

Answer: Ω

2. A 220 Ω resistor and a 220 Ω resistor are connected in parallel. What is the combined resistance, in ohms?

Answer: Ω

3. A 1 kΩ and a 2 kΩ resistor are in parallel across 6 V. What is the total current from the supply, in milliamps?

Answer: mA

4. A 100 Ω resistor and a 10 kΩ resistor are in parallel. The combined resistance is…

  • About 10.1 kΩ
  • Just under 100 Ω
  • About 5 kΩ

5. In a parallel circuit of three lamps, one lamp's filament breaks. The other two…

  • Go out
  • Stay lit with the same brightness
  • Get brighter because they share the current

Apply it

A robot's 5 V rail powers a microcontroller (50 mA), three sensors (10 mA each) and two LEDs (12 mA each), all in parallel. What total current must the supply provide, and what single resistance would draw the same current? Check the idea with two branches in the circuits lab.

Reflect

Why is the parallel rule easier to remember as 'currents add' than as '1/R = 1/R1 + 1/R2'?

Voltage dividers: turning resistance into a reading

A microcontroller cannot measure resistance, only voltage. So how does a robot know how bright the room is?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Dividers are how sensors talk to computers. Light sensors, thermistors, potentiometers and battery monitors all rely on two resistors in series turning a resistance or a big voltage into a voltage a chip can safely read.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

Two equal resistors are in series across 12 V. What is the voltage at the point between them, measured from 0 V?

  1. 0 V
  2. 6 V
  3. 12 V
  4. 24 V

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Set 5 V with R1 = R2 = 10 kΩ and check Vout. Switch the bottom part to the light sensor and sweep the light from 0% to 100%: which way does Vout move? Then go back to fixed resistors and attach each load in turn. Which load barely changes Vout, and which drags it down?

What the interactive shows, in words

The divider explorer draws R1 above R2 with Vout taken from the middle and shown on a vertical meter. With 5 volts and two 10 kΩ resistors, Vout is 2.5 volts. With the LDR as the bottom part, Vout falls from about 4 volts in the dark to under 0.3 volts in bright light. Adding a 100 kΩ load barely changes Vout; a 1 kΩ load drags it down to well under half its unloaded value.

Understand

Two resistors, one share

A voltage divider is two resistors in series with the output taken from the middle. The output is the bottom resistor's share of the supply: Vout = Vin × R2 ÷ (R1 + R2). 9 V across 10 kΩ (top) and 4.7 kΩ (bottom) gives 9 × 4.7 ÷ 14.7 ≈ 2.88 V.

Sensors in dividers

Replace R2 with a light sensor (LDR). In bright light its resistance falls, so its share falls and Vout drops; in the dark Vout rises. A microcontroller reads Vout and decides 'day' or 'night'. Thermistors and force sensors work the same way.

Scaling down a big voltage

A 12 V battery is too much for a 3.3 V chip's input. A divider with R1 = 27 kΩ and R2 = 10 kΩ gives 12 × 10 ÷ 37 ≈ 3.24 V, so the chip can watch the battery safely.

Loading

Anything connected to Vout draws current and sits in parallel with R2, lowering Vout. Rule of thumb: the load should be at least ten times R2. Microcontroller inputs are usually very high resistance, so they barely load a divider.

Explain it another way: intuitive

Two people share a pizza in proportion to their size. The 'bigger' resistor gets the bigger slice of the voltage. Vout is the bottom person's slice.

Explain it another way: technical

An unloaded divider has transfer ratio R2/(R1 + R2) and Thevenin output resistance R1 ∥ R2. A load R_L forms a second divider with that output resistance, which is why R_L ≫ R1 ∥ R2 keeps the error small.

Explain it another way: mathematical

Vout = Vin·R2/(R1 + R2). For 5 V, R1 = 10 kΩ, LDR at 50 kΩ (dark): 5 × 50 ÷ 60 ≈ 4.17 V. LDR at 500 Ω (bright): 5 × 0.5 ÷ 10.5 ≈ 0.24 V. A big swing that is easy to read.

Explain it another way: applied

Joysticks and volume knobs are potentiometers: a divider whose ratio you set by turning a shaft. Robot battery monitors and light-following robots both start with a divider.

Derivation: The divider formula
  1. R1 and R2 are in series across Vin, so (with nothing attached to the output) the current is I = Vin ÷ (R1 + R2).

  2. Vout is the voltage across R2: Vout = I × R2.

  3. Substitute: Vout = Vin × R2 ÷ (R1 + R2).

  4. Checks: if R2 = R1, Vout = Vin/2. If R2 ≫ R1, Vout → Vin. If R2 → 0, Vout → 0. Vout is always between 0 and Vin.

  5. With a load R_L attached, R2 is replaced by R2 ∥ R_L, which is smaller, so Vout drops. Example: 10 kΩ and 10 kΩ on 5 V give 2.5 V; add a 10 kΩ load and the bottom becomes 5 kΩ, so Vout = 5 × 5 ÷ 15 ≈ 1.67 V.

Try these examples

Example 1

R1 = 2.2 kΩ, R2 = 3.3 kΩ across 5 V. Find Vout.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A divider has R1 = 10 kΩ and R2 = 4.7 kΩ across 9 V. What is Vout, in volts?

Answer: V

2. A voltage divider has R1 = 3.3 kΩ on top and R2 = 220 Ω on the bottom, across 3.3 V. Nothing is connected to the output. What is Vout across R2, in volts?

Answer: V

3. An LDR is the bottom resistor of a divider. The room gets brighter. Vout…

  • Rises
  • Falls
  • Stays the same

4. 10 kΩ over 10 kΩ across 5 V gives 2.5 V. A 10 kΩ load is connected to the output. What is the new Vout, in volts?

Answer: V

5. A 12 V battery must be read by a 3.3 V input. Which divider is safe?

  • R1 = 10 kΩ, R2 = 27 kΩ
  • R1 = 27 kΩ, R2 = 10 kΩ
  • R1 = 10 kΩ, R2 = 10 kΩ

Apply it

Design a light sensor for a night-light robot on a 5 V supply: choose R1 so that Vout is above 2.5 V in the dark (LDR about 50 kΩ) and below 2.5 V in daylight (LDR about 2 kΩ). Test your choice in the divider explorer and record Vout at three light levels.

Reflect

Why must a sensor divider's output feed something with a very high input resistance?

Week 14: Power and energy

This week you will

Electrical power: how fast energy flows

A tiny resistor and a car headlight can both be 'just a resistor'. Why does one stay cool and the other burn too hot to touch?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Power is what melts wires, drains batteries and makes chips throttle. Every component has a power limit, and checking it is as routine for an engineer as checking the voltage.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 100 Ω resistor is connected across 9 V. Will a standard 0.25 W resistor cope?

  1. Yes, easily
  2. Only just
  3. No: it would dissipate more than three times its rating

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose a single series resistor circuit on 9 V. Lower R1 until the lab warns that a resistor would exceed 0.25 W. Note that resistance. Now halve the supply voltage: by how much does the power fall? Predict first, then check.

What the interactive shows, in words

In the circuits lab on 9 volts, lowering a series resistor raises its power; below about 324 ohms the lab warns that a resistor would exceed 0.25 watts. Halving the supply voltage to 4.5 volts quarters the power in the same resistor.

Understand

Watts are joules per second

Power is the rate of energy transfer. P = V × I: a 5 V USB port supplying 2 A delivers 10 W, ten joules every second. A watt is small: a phone charger is a few watts, a robot drive motor tens of watts.

Pick the formula that fits your numbers

Know V and I? Use P = V·I. Know the current and resistance? P = I²·R. Know the voltage and resistance? P = V²/R. All three give the same answer for the same resistor.

Power ratings

Resistors turn all their electrical power into heat. Common small resistors are rated at 0.25 W. 470 Ω on 5 V: P = 25 ÷ 470 ≈ 0.053 W, fine. 100 Ω on 9 V: 0.81 W, too hot. Fix it with a higher-rated resistor (e.g. 1 W) or a larger resistance.

Explain it another way: intuitive

Voltage is how hard each coulomb is pushed; current is how many coulombs pass each second. Multiply them and you get how much energy is delivered every second.

Explain it another way: technical

Instantaneous electrical power is p = v·i. For a resistor all of it is dissipated as heat (Joule heating). Steady-state temperature rise depends on power and on how well the part sheds heat, which is why ratings assume free air at a stated temperature.

Explain it another way: mathematical

I² dependence: doubling the current through a resistor quadruples its heating. 50 mA through 100 Ω: P = 0.05² × 100 = 0.25 W, right at the limit. 100 mA: 1 W.

Explain it another way: applied

Motor drivers, voltage regulators and processors all have power limits and often heatsinks. Engineers reduce heat by lowering current, which is one reason long-distance power lines use very high voltages: the same power at lower current wastes far less as I²R heat in the wires.

Derivation: Three formulas from one idea
  1. Power is energy per second: P = E ÷ t, in watts (W), where 1 W = 1 J/s.

  2. Voltage is energy per coulomb, E = V × Q, so P = V × Q ÷ t.

  3. Charge per second is current, Q ÷ t = I, so P = V × I.

  4. Substitute V = I × R: P = I × R × I = I² × R.

  5. Substitute I = V ÷ R: P = V × V ÷ R = V² ÷ R. Halving V quarters the power in a fixed resistor.

Try these examples

Example 1

A 12 V robot motor draws 1.5 A. What power does it take?

The worked solution is in the online lesson.

Example 2

20 mA flows through a 470 Ω resistor. Is a 0.25 W resistor enough?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A USB port supplies 5 V at 0.5 A. What power is that, in watts?

Answer: W

2. A device runs at 24 V and draws 0.25 A. What power does it use, in watts?

Answer: W

3. 50 mA flows through a 100 Ω resistor. How much power does it turn into heat, in watts?

Answer: W

4. Which resistor would exceed a 0.25 W rating?

  • 470 Ω on 5 V
  • 1 kΩ on 12 V
  • 100 Ω on 9 V

5. The current through a resistor doubles. Its heating power becomes…

  • The same
  • Twice as much
  • Four times as much

Apply it

Revisit your week 12 LED design. Calculate the power in the resistor and in the LED (P = Vf × I), and say what rating of resistor you would buy. Then design a version that runs the same LED from 12 V and check the resistor rating again.

Reflect

Why do you think engineers care more about power ratings in small, sealed devices than on an open workbench?

Energy over time: watt-hours and what they cost

Which uses more energy in a day: a 10 W phone charger used for two hours, or a 0.25 W gadget that is never switched off?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Batteries, electricity bills and carbon footprints are all about energy, not power. Engineers designing 'always-on' devices often worry more about the tiny standby power that runs all year than the big burst that lasts a minute.

Goals

Predict

A 10 W phone charger runs for 2 hours; a 0.25 W microcontroller runs for 24 hours. Which uses more energy?

  1. The phone charger
  2. The microcontroller
  3. They use the same

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Step through each device and note its power and its energy per day. Which has the biggest power? Which uses the most energy in a year? Change the hours per day for the laptop and watch the yearly cost. Finally pick a battery pack and find a device it can run for more than a day.

What the interactive shows, in words

The power and energy meter lists five low-voltage devices: an indicator LED (5 V, 15 mA), a microcontroller board (5 V, 50 mA), a phone charging (5 V, 2 A), a robot drive motor (12 V, 1.5 A) and a laptop (20 V, 3 A). For each it shows power, energy per day, energy per year and cost per year at an adjustable illustrative price, plus run time from a chosen battery pack. For example, the phone at 10 W for 2 hours uses 20 Wh a day.

Understand

Energy is power × time

E = P × t. With P in watts and t in seconds, E is in joules. Engineers usually use watt-hours (Wh): 1 Wh = 1 W for 1 hour = 3600 J. Electricity is sold in kilowatt-hours: 1 kWh = 1000 Wh = 3.6 million joules.

Working out a cost

Cost = energy in kWh × price per kWh. A 60 W laptop for 6 hours a day uses 360 Wh = 0.36 kWh a day, 131.4 kWh a year. At an illustrative 25 p per kWh that is about £32.85 a year. Prices vary by place and time, so always state the price you assumed.

Power is not the whole story

A big power for a short time can use less energy than a small power for a long time. Comparing devices by power alone can mislead: always multiply by how long they run.

Explain it another way: intuitive

Power is your speed; energy is the distance you travel. A sprinter is fast but stops quickly; a walker who never stops can go further.

Explain it another way: technical

Energy is the time integral of power, E = ∫P dt; for constant power, E = P·t. Average power over a duty cycle is total energy divided by total time.

Explain it another way: mathematical

Phone: 5 V × 2 A = 10 W; 10 W × 2 h = 20 Wh/day; × 365 = 7.3 kWh/year; × 25 p ≈ £1.83. Microcontroller: 5 V × 0.05 A = 0.25 W; × 24 h = 6 Wh/day; 2.19 kWh/year ≈ £0.55.

Explain it another way: applied

Product designers set standby-power targets because millions of devices left on add up to power-station-sized loads. Robot designers do the same sum to decide battery size.

Try these examples

Example 1

A 100 W device runs 10 hours a day for 30 days. At 25 p per kWh, what does it cost?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A 20 W device runs for 3 hours. How much energy does it use, in watt-hours?

Answer: Wh

2. A 10 W device runs 12 hours a day for 7 days. Electricity costs 20 p per kWh (an illustrative price). What does that energy cost, in pounds?

Answer: £

3. How many joules are in 2 Wh?

Answer: J

4. To compare how much two devices add to an electricity bill, you should compare their…

  • Power ratings only
  • Energy used: power × hours of use
  • Voltages

5. A 0.5 W standby light is on all day, every day, for a year (365 days). How many kWh does it use?

Answer: kWh

Apply it

Make an energy table for five devices you use (estimate their power from the meter's presets or their labels, and your hours of use). Rank them by power and then by yearly energy. Did the order change? State the electricity price you assumed.

Reflect

Which device surprised you most when you ranked by energy instead of power?

Battery budgets: peak, average and run time

A robot's motors draw 1.5 A, but only for a tenth of the time. Do you size the battery for 1.5 A, or for something much smaller?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Battery choice shapes a whole robot: its weight, size, cost and how long it works. A power budget, a simple table of currents and times, is one of the first documents a robotics team writes.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 5000 mAh battery powers a robot whose average current is 200 mA. Roughly how long will it run?

  1. 2.5 hours
  2. 25 hours
  3. 250 hours

Write down your guess and your reason. The reveal is in the online lesson.

Discover

In the Electronics Studio, build a low-voltage supply feeding two loads in parallel: a small constant one (like a microcontroller) and a larger one you switch on and off (like a motor). Record the supply current with the big load on and off. Use your two readings and a duty cycle of 10% to work out the average current.

What the interactive shows, in words

In the Electronics Studio, a supply feeds a small constant load and a larger switched load in parallel. With the large load off, the supply current is just the small load's; with it on, the two currents add. Weighting the large load by a 10% duty cycle gives the average current, for example 50 mA + 10% of 1500 mA = 200 mA.

Understand

Capacity: mAh and Wh

Battery capacity is often quoted in milliamp-hours (mAh): 2000 mAh can supply 2000 mA for 1 hour, or 200 mA for 10 hours, ideally. Energy capacity in Wh = mAh × voltage ÷ 1000. A 2000 mAh, 3.7 V cell holds 7.4 Wh.

Average from a duty cycle

If a load draws a large current only part of the time, the average is current × fraction of time on. A 1.5 A motor running 10% of the time averages 150 mA. Add the constant loads: a 50 mA controller plus that motor averages 200 mA.

Peak still matters

Run time depends on the average, but the battery, wiring and regulator must survive the peak: here 50 + 1500 = 1550 mA. A battery that cannot deliver the peak will sag in voltage and may reset the controller just as the motor starts.

Explain it another way: intuitive

Your phone battery lasts a day even though the screen and radio occasionally gulp power. What matters for 'how long' is the average; what matters for 'does it crash' is the biggest gulp.

Explain it another way: technical

Average current I_avg = Σ(I_k × t_k) / T. Ideal run time = capacity / I_avg. Real capacity falls at high discharge rates and low temperatures, and usable capacity is usually limited to protect the cells.

Explain it another way: mathematical

I_avg = 50 mA + 0.10 × 1500 mA = 200 mA. Run time = 5000 ÷ 200 = 25 h. Energy view: 5000 mAh × 3.7 V = 18.5 Wh; at 3.7 V the average power is 0.2 × 3.7 = 0.74 W; 18.5 ÷ 0.74 = 25 h.

Explain it another way: applied

Planetary rovers, drones and delivery robots all start with a power budget. Designers cut the average by sleeping the processor and switching sensors off between readings, sometimes doubling run time without a bigger battery.

Try these examples

Example 1

A sensor node draws 20 mA for 1 second, then sleeps at 0.1 mA for 59 seconds, repeating. What is its average current?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A controller draws a constant 50 mA and a motor draws 1500 mA for 10% of the time. What is the average total current, in mA?

Answer: mA

2. A robot's 1000 mAh battery feeds an average current of 400 mA. Ignoring losses, roughly how many hours will it run?

Answer: h

3. A 2000 mAh battery has a voltage of 3.7 V. How much energy does it store, in Wh?

Answer: Wh

4. Which number decides whether the battery and wires can cope when the motor starts?

  • The average current
  • The peak current
  • The battery's weight

5. A 47 Ω resistor has 3 V across it. How much power does it dissipate, in watts?

Answer: W

Apply it

Write a power budget table for a small simulated robot: controller (50 mA, always on), two sensors (10 mA each, always on), drive motors (1.2 A, 15% of the time) and a buzzer (30 mA, 1% of the time). Calculate the average and peak current, then choose a battery from 1000, 2000 or 5000 mAh for at least 8 hours of running.

Reflect

Which single change to your robot's behaviour would most extend its run time, and why?

Week 15: Boolean algebra

This week you will

Logic gates and truth tables

Every decision your phone makes, from unlocking to sending a message, comes down to a few kinds of tiny switch. How few kinds?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

This lesson opens the computer architecture thread. A processor is built from billions of gates, but there are only a handful of kinds. Learn their rules now and you can follow a signal all the way from a switch to an adder, and later to a whole CPU.

Goals

Predict

A truth table lists the output for every possible combination of inputs. How many rows does a gate with three inputs need?

  1. 3
  2. 6
  3. 8
  4. 9

Write down your guess and your reason. The reveal is in the online lesson.

Discover

In the logic lab, start from the 'One gate' preset. Change the gate to each type in turn (AND, OR, NAND, NOR, XOR) and toggle A and B through all four combinations. Copy each live truth table into your notebook. Which two gates are exact opposites of each other?

What the interactive shows, in words

In the logic lab's one-gate preset, toggling inputs A and B through 00, 01, 10 and 11 gives: AND 0,0,0,1; OR 0,1,1,1; NAND 1,1,1,0; NOR 1,0,0,0; XOR 0,1,1,0. OR and NOR are exact opposites, as are AND and NAND.

Understand

Bits as voltages

Digital circuits treat a voltage near the supply (say 3.3 V or 5 V) as 1 and near 0 V as 0. Anything in between is avoided. Because only two levels matter, small amounts of noise do not change the answer.

The basic gates

NOT flips its input. AND gives 1 only if all inputs are 1. OR gives 1 if any input is 1. XOR gives 1 if the inputs differ. NAND and NOR are AND and OR followed by NOT. Engineers write them as ¬A, A·B, A + B and A ⊕ B.

A truth table says everything

List every input combination in counting order (00, 01, 10, 11) and write the output. That table completely defines the gate: two circuits with the same truth table do the same job, however different they look.

Gates are made of transistors

A transistor is a switch made from doped silicon (week 10): a voltage on one terminal lets current flow between the other two. Two transistors in series make a NAND-like path; in parallel, a NOR-like one. That is how a material property becomes logic.

Explain it another way: intuitive

AND is two light switches in series: both must be on. OR is two switches in parallel: either will do. NOT is a switch that is on when you are not pressing it.

Explain it another way: technical

Boolean functions map {0,1}ⁿ to {0,1}. Logic families such as CMOS implement them with complementary transistor networks so that the output is always driven firmly to one rail or the other.

Explain it another way: mathematical

There are 2ⁿ input rows, and each row's output can be 0 or 1, so there are 2^(2ⁿ) different n-input functions: 16 for two inputs, 256 for three.

Explain it another way: applied

A car's interior light comes on if the driver's door OR the passenger's door is open. A lift moves only if the doors are closed AND a floor is selected. Logic gates make these rules physical and fast.

Try these examples

Example 1

Write the truth table of A NAND B.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. When does A XOR B output 1?

  • When both inputs are 1
  • When the inputs are different
  • When at least one input is 1

2. With A = 0, B = 1 and C = 0, what is Y = ¬A ⊕ C? Answer 0 or 1.

Answer:

3. How many rows does the truth table of a 4-input gate have?

Answer: rows

4. With A = 1, B = 0 and C = 0, what is Y = (C ⊕ B) ⊕ A? Answer 0 or 1.

Answer:

5. Which gate's truth table is the exact opposite (every output flipped) of OR?

  • AND
  • NOR
  • XOR

Apply it

Choose a machine at home or school (a microwave, a lift, a printer). Write three of its rules as gates, for example 'heat only if door closed AND timer running'. For one rule, write the full truth table and test it in the logic lab.

Reflect

Why is it useful that a truth table describes a gate completely, whatever is inside it?

From safety rules to Boolean expressions

'The press may run only when the guard is shut, a hand is on each button and there is no fault.' Can you write that as one line of algebra?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Safety interlocks on machines, alarms and doors are Boolean expressions written in hardware. A mistranslated word can let a machine start when it must not, so engineers write the rule, the expression and the full truth table, and check that all three agree.

Goals

Predict

An alarm must sound if it is armed and either the door or the window opens. Which expression fits?

  1. Arm · Door + Window
  2. Arm · (Door + Window)
  3. Arm + Door + Window

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Start from the interlock preset A · B · ¬C (A = guard closed, B = operator present, C = fault). Toggle the inputs to find the only row where Y = 1. Then type A · (B + C) and compare it with A · B + C: find a row where they differ. Finally write your own rule for a door alarm and check its truth table.

What the interactive shows, in words

The explorer takes a typed Boolean expression and shows three views: input switches with a live output, a gate diagram drawn from inputs on the left to the output on the right, and a full truth table with the current row marked. For the interlock A · B · ¬C, Y = 1 only on row 110: guard closed, operator present, no fault.

Understand

Name the signals first

Give every input a letter and say what 1 means: G = 1 'guard closed', P = 1 'operator present', F = 1 'fault reported'. Writing what 1 means avoids the most common bug: a signal that is 1 when you thought it was 0.

Words to operators

'and', 'both', 'all' → ·. 'or', 'either', 'any' → +. 'not', 'no', 'unless' → ¬ (often 'X unless Y' becomes X · ¬Y). 'one or the other but not both' → ⊕. So the interlock is Y = G · P · ¬F.

Brackets carry meaning

AND binds tighter than OR, just as × binds tighter than +. A · B + C means (A · B) + C. If the rule says 'A and either B or C', write A · (B + C). When unsure, add brackets and check the truth table.

Check all three views

The expression is compact, the truth table is complete, and the gate diagram is what you build. If they disagree, one of them is wrong. For safety rules, read every row of the truth table aloud: 'guard open, operator present, no fault: machine off.'

Explain it another way: intuitive

Translating rules into logic is like writing a recipe so exact that a robot cook cannot misunderstand it. Every 'and', 'or' and 'unless' becomes a symbol with one meaning only.

Explain it another way: technical

Natural-language connectives are ambiguous; Boolean operators are not. Specifications are written as truth tables or expressions with explicit precedence, then verified exhaustively for small input counts.

Explain it another way: mathematical

Y = A · (B + C) is 1 on rows 101, 110 and 111: three of eight. Y = A · B + C is 1 on 001, 011, 101, 110, 111: five of eight. The two differ on rows 001 and 011, exactly where A = 0 and C = 1.

Explain it another way: applied

Industrial presses use two-hand controls (both buttons, so both hands are clear) plus guard switches, with the rule built in dedicated safety hardware rather than ordinary software.

Try these examples

Example 1

'The fan runs if the temperature is high, unless the maintenance switch is on.' Write it as an expression.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. Machine runs only if the guard is closed (G), the operator is present (P) and there is no fault (F = 1 means fault). Which expression?

  • G + P + ¬F
  • G · P · F
  • G · P · ¬F

2. Write out the 8-row truth table for Y = ¬A ⊕ C (inputs A, B, C). On how many rows is Y = 1?

Answer: rows

3. How many of the 8 rows of Y = A · (B + C) have Y = 1?

Answer: rows

4. Write out the 8-row truth table for Y = (C ⊕ B) ⊕ A (inputs A, B, C). On how many rows is Y = 1?

Answer: rows

5. 'The light is on if it is dark (D), unless the switch is off (S = 1 means switch off).' Which expression?

  • D + S
  • D · ¬S
  • ¬D · S

Apply it

Write the rule for a greenhouse vent: open if it is too hot OR too humid, but never while it is raining. Name your signals, write the expression, check its truth table in the explorer, and read the rows where the vent is open aloud.

Reflect

Which English word did you find most dangerous to translate, and how will you check it next time?

Module check: simplifying logic

A 'majority vote' circuit can be written with 12 letters, or with 6. Both give identical answers. Why would an engineer care which one you build?

About 40 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Fewer gates mean a cheaper, faster, lower-power circuit and fewer places for faults. Simplification is also a check on your thinking: if the simplest form surprises you, maybe the rule was not what you meant.

Goals

Predict

Simplify Y = A · B + A · ¬B.

  1. A
  2. B
  3. A · B
  4. It cannot be simplified

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Load the majority preset and compare the row-by-row form with the simplest form. Toggle cells to make Y = A: how many literals does it need? Load 'XOR of three' and explain why nothing groups. Finally make up a function with four 1s that simplifies to a single two-letter term.

What the interactive shows, in words

The K-map shows eight cells in two rows (A = 0, 1) and four columns (BC = 00, 01, 11, 10). Pressing a cell toggles its output. The tool lists the groups and the simplest expression: majority (rows 3, 5, 6, 7) simplifies to A·B + A·C + B·C; rows 4 to 7 simplify to A; three-input XOR (rows 1, 2, 4, 7) does not simplify.

Understand

Useful laws

Identity: A·1 = A, A + 0 = A. Null: A·0 = 0, A + 1 = 1. Complement: A·¬A = 0, A + ¬A = 1. Idempotent: A + A = A. Absorption: A + A·B = A. De Morgan: ¬(A·B) = ¬A + ¬B; ¬(A + B) = ¬A · ¬B. Each can be proved with a four-row truth table.

The Karnaugh map

A K-map is a truth table folded into a grid whose columns go 00, 01, 11, 10 (Gray code), so neighbouring cells differ in exactly one input. A group of two neighbouring 1s drops that input; a group of four drops two inputs. Cover every 1 with as few, as large groups as possible.

Always verify

A simplification is correct only if its truth table matches the original on every row. The explorer and the K-map both do this check for you; on paper, compare the two output columns.

Explain it another way: intuitive

Simplifying logic is like tidying instructions: 'If it's raining take an umbrella; if it's not raining take an umbrella' becomes 'take an umbrella'.

Explain it another way: technical

Two-level minimisation finds a minimal sum-of-products cover of the function's minterms by prime implicants. K-maps do this visually for up to four or five variables; tools use algorithms such as Quine–McCluskey or heuristics for larger functions.

Explain it another way: mathematical

Literal count is a proxy for gate inputs. Majority: 4 three-literal minterms (12 literals) become 3 two-literal terms (6 literals). Three-input XOR has four 1s with no two adjacent on the map, so its minimal sum of products stays at 12 literals.

Explain it another way: applied

Chip design tools simplify logic automatically, but engineers still simplify by hand to understand a design, to spot mistakes in a specification and to build small interlocks with the fewest parts.

Derivation: Two simplifications, step by step
  1. Distributive law (factor out A): A·B + A·¬B = A·(B + ¬B).

  2. Complement law: B + ¬B = 1, because exactly one of them is 1. So the expression is A·1 = A.

  3. De Morgan's law: ¬(A · B) = ¬A + ¬B and ¬(A + B) = ¬A · ¬B. Check by truth table: ¬(A·B) is 1,1,1,0 for AB = 00, 01, 10, 11, and so is ¬A + ¬B.

  4. Majority: the row-by-row form is ¬A·B·C + A·¬B·C + A·B·¬C + A·B·C. Copy A·B·C three times (X + X = X), pair it with each other term and use the complement law: (¬A + A)·B·C + A·(¬B + B)·C + A·B·(¬C + C) = B·C + A·C + A·B, 6 literals instead of 12.

Try these examples

Example 1

Simplify A + A · B and check with a truth table.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. Simplify Y = A·B + A·¬B.

  • B
  • A
  • A·B
  • 1

2. By De Morgan's law, ¬(A + B) equals…

  • ¬A + ¬B
  • ¬A · ¬B
  • A · B

3. Write out the 8-row truth table for Y = (B + ¬A) + C (inputs A, B, C). On how many rows is Y = 1?

Answer: rows

4. With A = 1, B = 0 and C = 0, what is Y = (C ⊕ B) ⊕ A? Answer 0 or 1.

Answer:

5. The majority function's row-by-row form uses 12 literals. How many literals does its simplest sum of products use?

Answer: literals

6. On a three-input K-map, four 1s form one group (a whole row or a 2 × 2 block). The resulting term has…

  • Three literals
  • Two literals
  • One literal

7. Simplify A + A · B.

  • A · B
  • A
  • B
  • A + B

Apply it

Write the row-by-row (sum of minterms) expression for your greenhouse vent rule from the previous lesson, simplify it with the K-map, then prove the two forms match by comparing truth tables in the expression explorer.

Reflect

Which law surprised you most, and how would you convince a friend it is true?

Week 16: Combinational logic

This week you will

Everything from NAND

If you could only manufacture one kind of gate, could you still build a whole computer? Engineers found the answer is yes, twice.

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

NAND gates are simple to make with transistors, so whole chips (and early computers) have been built almost entirely from them. Showing that everything can be made from one gate is also your first real piece of computer architecture: building bigger blocks from smaller ones.

Goals

Predict

What does a NAND gate do if you connect both of its inputs to the same signal A?

  1. Always outputs 0
  2. Outputs A
  3. Outputs NOT A
  4. Always outputs 1

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Do Level 2 of the virtual computer: wire NOT from one NAND, XOR from at most four NANDs, and a half adder from at most two gates. Read the live truth table after every wire you add, and keep notes on which NAND does which job.

What the interactive shows, in words

In the virtual computer's circuit builder, a NAND with both inputs joined acts as NOT. Four NANDs make XOR: the first NAND feeds two more, each also fed by one input, and a last NAND combines them. A half adder uses XOR for the sum and AND for the carry. The live truth table confirms each row.

Understand

NOT and AND

NOT A = NAND(A, A). A AND B = NOT(NAND(A, B)), which is two NANDs: one NAND, then a NAND with its inputs tied as a NOT.

OR via De Morgan

De Morgan says A + B = ¬(¬A · ¬B), which is NAND(¬A, ¬B). So OR takes three NANDs: two as NOTs on the inputs, and one to combine them.

XOR in four

Let g1 = NAND(A, B). Then g2 = NAND(A, g1), g3 = NAND(B, g1), and Y = NAND(g2, g3) = A ⊕ B. Check row 11: g1 = 0, g2 = 1, g3 = 1, Y = 0. Row 10: g1 = 1, g2 = 0, g3 = 1, Y = 1.

Why one gate type helps

A factory that makes one well-tested cell can tile it millions of times. Designers still use many gate types today, but the fact that NAND (or NOR) is universal shows how little you need to compute anything.

Explain it another way: intuitive

It is like having only one Lego brick shape and discovering you can still build every model, just with more bricks.

Explain it another way: technical

A gate set is functionally complete if every Boolean function can be expressed with it. {NAND} and {NOR} are each complete; {AND, OR} is not, because it cannot produce NOT.

Explain it another way: mathematical

Gate counts with NAND only: NOT 1, AND 2, OR 3, XOR 4. A half adder needs XOR (4) + AND (2) = 6 NANDs if built naively, or 5 if the AND reuses g1 with one extra NAND as its NOT.

Explain it another way: applied

Some flash memory is called 'NAND flash' after the way its memory cells are strung together like transistors in a NAND gate. In CMOS chips, NAND and NOR are among the smallest gates to make.

Try these examples

Example 1

Show that NAND(NAND(A, A), NAND(B, B)) is A OR B.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. How do you make NOT from a single NAND?

  • Connect one input to 0
  • Connect both inputs to the signal
  • Connect one input to the output

2. How many NAND gates does the standard De Morgan construction of a two-input OR use?

Answer: gates

3. How many NAND gates does the classic XOR construction use?

Answer: gates

4. In the four-NAND XOR, with A = 1 and B = 1, what is g1 = NAND(A, B)?

  • 0
  • 1

5. With A = 0, B = 0 and C = 0, what is Y = ¬(A + (B + ¬A))? Answer 0 or 1.

Answer:

6. Why can't AND and OR gates alone build every logic function?

  • They are too slow
  • They cannot make NOT: with all inputs 0 their output is always 0
  • They need too many transistors

Apply it

In BUILD 008 Level 2, complete all three circuits within the gate limits. Then, on paper, design AND from NOR gates only and check it with a truth table.

Reflect

What does it tell you about computers that one simple switch pattern, repeated, is enough to compute anything?

Half adders and full adders

In binary, 1 + 1 = 10. A computer does that with two gates. How many does it need to add 1 + 1 + 1?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

The adder is the heart of a processor's arithmetic logic unit. Once you can add one column of bits with gates, you can add numbers of any size, and from there subtract, count and address memory.

Goals

Predict

Adding one column of binary, the inputs are A = 1, B = 1 and a carry in of 1. What do you write, and what do you carry?

  1. Write 0, carry 1
  2. Write 1, carry 1
  3. Write 1, carry 0
  4. Write 0, carry 0

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Set 4 bits. Make A = 0001 and B = 0001 and step: the first column is a half adder. Now try A = 0111, B = 0001 and watch the carry ripple through three columns. Then turn on carry in. Fill in the eight-row full adder table in your notebook from what you see.

What the interactive shows, in words

The adder stepper shows two 4-bit numbers as rows of bit buttons and reveals one column at a time from the right, giving each column's carry in, sum and carry out. Adding 0111 and 0001, the carry ripples through three columns to give 1000. The full adder table for A B Cin from 000 to 111 is Cout S = 00, 01, 01, 10, 01, 10, 10, 11.

Understand

Column addition in binary

Binary adds like decimal, with only two digits: 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 10 (write 0, carry 1), 1 + 1 + 1 = 11 (write 1, carry 1).

The full adder table

For A B Cin = 000, 001, 010, 011, 100, 101, 110, 111, the outputs Cout S are 00, 01, 01, 10, 01, 10, 10, 11. In other words, Cout S is just the count of 1s written in binary.

Chaining adders

To add 4-bit numbers, line up four full adders, one per column. Each carry out feeds the next column's carry in, so the carry ripples from right to left. Next week you will add multi-bit numbers this way and see what happens when the answer is too big.

Explain it another way: intuitive

A full adder counts how many of its three inputs are 1 and writes that count in binary: the right digit is the sum, the left digit is the carry.

Explain it another way: technical

A full adder is a 3-input, 2-output combinational block. Sum is the odd-parity function of its inputs; carry is the majority function (you simplified it in week 15: A·B + A·Cin + B·Cin, equivalent to A·B + Cin·(A ⊕ B)).

Explain it another way: mathematical

Check row 111: S = 1 ⊕ 1 ⊕ 1 = 1; Cout = 1·1 + 1·(1 ⊕ 1) = 1 + 0 = 1. Cout S = 11 = 3 = 1 + 1 + 1. ✓

Explain it another way: applied

Every addition your phone does, and every address it calculates in memory, passes through adders built from exactly these equations, usually with faster carry tricks layered on top.

Derivation: Building the full adder
  1. Half adder (two inputs): the sum is 1 when exactly one input is 1, so S = A ⊕ B; the carry is 1 only when both are 1, so C = A · B.

  2. Full adder (three inputs A, B, Cin): the column total A + B + Cin is 0, 1, 2 or 3, written as two bits Cout S.

  3. S is 1 when the total is odd (1 or 3), which is when an odd number of inputs are 1: S = A ⊕ B ⊕ Cin.

  4. Cout is 1 when the total is 2 or 3. Either A and B are both 1 (A·B), or exactly one of them is 1 and there is a carry in (Cin·(A ⊕ B)). So Cout = A·B + Cin·(A ⊕ B).

  5. This is two half adders and an OR: the first adds A and B, the second adds Cin to that sum, and either carry makes Cout.

Try these examples

Example 1

Use the full adder equations for A = 1, B = 0, Cin = 1.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A half adder is built from…

  • Two ANDs
  • An XOR for the sum and an AND for the carry
  • An OR for the sum and a NOT for the carry

2. For a full adder with A = 1, B = 1, Cin = 1, read Cout S as a 2-bit binary number. What is its value in decimal?

Answer:

3. A full adder's sum output S is 1 exactly when…

  • All three inputs are 1
  • An odd number of inputs are 1
  • At least two inputs are 1

4. With A = 1, B = 0 and C = 0, what is Y = (C ⊕ B) ⊕ A? Answer 0 or 1.

Answer:

5. An unsigned 8-bit register adds 01110011 + 00001101. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Answer:

6. How many full adders does an 8-bit ripple-carry adder use (one per column)?

Answer: adders

Apply it

Build a full adder in the logic lab (the 'Full adder' preset is a model answer, so try it from scratch first) and check all eight rows against your table. Then explain in two sentences why the carry out is the majority function from week 15.

Reflect

How does knowing that a full adder 'counts its 1s' make its truth table easier to remember?

Multiplexers and decoders: choosing and pointing

A robot has eight sensors but only one analog-to-digital converter. How does it read them all through one input?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Multiplexers and decoders are the traffic police of a computer: they choose which data goes where. Every processor uses them to pick registers, select memory and route results.

Goals

Predict

A multiplexer chooses one of several inputs using binary select lines. How many inputs can 3 select lines choose between?

  1. 3
  2. 6
  3. 8

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Open the '2:1 multiplexer' challenge in the logic lab. Build Y = ¬S·A + S·B from AND, OR and NOT gates. Test all eight rows: confirm that S = 0 passes A through and S = 1 passes B, whatever the other input does.

What the interactive shows, in words

In the logic lab's 2:1 multiplexer challenge, the circuit Y = NOT S AND A, OR S AND B is checked on all eight rows of S, A and B. When S is 0 the output always equals A; when S is 1 it always equals B.

Understand

Multiplexer: a selector

A 2:1 multiplexer has data inputs A and B and a select input S. If S = 0 the output copies A; if S = 1 it copies B: Y = ¬S·A + S·B. A 4:1 mux uses two select bits; an 8:1 mux uses three.

Decoder: a pointer

A decoder takes an n-bit number and switches on exactly one of 2ⁿ outputs. A 2-to-4 decoder with inputs A1 A0 has outputs D0 = ¬A1·¬A0, D1 = ¬A1·A0, D2 = A1·¬A0, D3 = A1·A0. Give it 10 and only D2 lights.

Where machines use them

A microcontroller uses a mux to connect one of its many analog pins to its single converter. Memory uses decoders to switch on one row out of thousands. A processor uses muxes to choose which register feeds the adder.

Explain it another way: intuitive

A multiplexer is a railway junction: the select lever decides which track reaches the station. A decoder is a lift panel lighting exactly one floor number.

Explain it another way: technical

A 2ⁿ:1 multiplexer implements Y = Σ (minterm_k(S) · D_k). A decoder generates all 2ⁿ minterms of its inputs; combined with an OR gate it can implement any Boolean function of those inputs.

Explain it another way: mathematical

Select lines n and inputs N relate by N = 2ⁿ, so n = log₂ N. Choosing among 16 channels needs 4 select bits; 1024 memory rows need a 10-bit decoder.

Explain it another way: applied

Sensor boards often share one converter between many channels through a multiplexer, reading them one after another. Seven-segment display drivers decode a 4-bit number into the segments to light.

Try these examples

Example 1

A 2:1 mux has A = 0, B = 1, S = 1. What is Y?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. In a 2:1 multiplexer Y = ¬S·A + S·B, what does S = 0 do?

  • Outputs B
  • Outputs A
  • Outputs A AND B

2. How many select lines does a multiplexer need to choose one of 16 inputs?

Answer: lines

3. How many outputs does a 3-to-8 decoder switch between, and how many are active at once? Give the number of outputs.

Answer: outputs

4. With A = 1, B = 0 and C = 0, what is Y = (C ⊕ B) ⊕ A? Answer 0 or 1.

Answer:

5. A 2-to-4 decoder receives A1 A0 = 10. Which output is active?

  • D1
  • D2
  • D3

Apply it

A robot has four distance sensors and one converter. Draw the 4:1 multiplexer, label the select lines, and write the sequence of select values its program should cycle through to read every sensor once.

Reflect

Why is selecting with binary numbers so much cheaper in wires than having one 'choose me' wire per input?

Week 17: Binary arithmetic

This week you will

Binary and hexadecimal

A sensor datasheet says its ID register reads 0x6B. What number is that, and why would anyone write it that way?

About 30 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Registers, memory addresses, colours and network packets are all written in binary or hex. Fluent conversion is the everyday language of anyone who works close to the hardware.

Goals

Predict

What is the largest number you can store in 8 bits?

  1. 8
  2. 128
  3. 255
  4. 256

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Do Level 1 of the virtual computer: show 13, 6 and 9 on the 4-bit register, turn 1010 and 0111 back into numbers, find the largest 4-bit number, and predict what 1111 + 1 shows.

What the interactive shows, in words

In the virtual computer's 4-bit register, lamps show the bits: 13 is 1101, 6 is 0110 and 9 is 1001; 1010 is 10 and 0111 is 7. The largest 4-bit number is 15 (1111), and adding 1 to 1111 gives 0000 because the carry falls off the top.

Understand

Place values that double

In binary each place is worth twice the one to its right: 1, 2, 4, 8, 16, 32, 64, 128. 1011 = 8 + 0 + 2 + 1 = 11. To go the other way, take away the biggest power of 2 that fits and repeat: 13 = 8 + 4 + 1 = 1101.

How much fits

n bits make 2ⁿ patterns, holding 0 to 2ⁿ − 1. 4 bits: 0 to 15. 8 bits (a byte): 0 to 255. 16 bits: 0 to 65,535. Each extra bit doubles the range.

Hex: four bits per digit

Hexadecimal has 16 digits: 0–9 then A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Each hex digit is exactly four bits, so a byte is two hex digits: 0x6B = 0110 1011 = 6 × 16 + 11 = 107. 0xFF = 255. The '0x' just marks a number as hex.

Explain it another way: intuitive

Binary is counting with only two fingers per place. Hex is a shorthand that packs four of those places into one symbol, the way '1 dozen' packs twelve eggs.

Explain it another way: technical

A positional system in base b represents Σ dₖ·bᵏ. Since 16 = 2⁴, each hex digit maps to a fixed 4-bit group (a nibble), making conversion a lookup rather than arithmetic.

Explain it another way: mathematical

0x2A = 2 × 16 + 10 = 42 = 0010 1010. 200 = 128 + 64 + 8 = 1100 1000 = 0xC8.

Explain it another way: applied

Colours on web pages are three bytes in hex: #FF8000 is full red, half green, no blue. Debuggers show memory in hex because each pair of digits is one byte.

Try these examples

Example 1

Convert 0xC8 to binary and decimal.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. What is binary 1011 in decimal?

Answer:

2. What is the binary number 11010011 in decimal?

Answer:

3. What is the hexadecimal number 85 (0x85) in decimal?

Answer:

4. What is 0x2A in decimal?

Answer:

5. What is the largest value a 16-bit unsigned number can hold?

Answer:

Apply it

Complete BUILD 008 Level 1. Then write your age, the day of the month and 200 in binary and in hex, and check each with the 4-bit or 8-bit register in the adder stepper.

Reflect

Why do you think computers use base 2 while people use base 10?

Multi-bit addition and the ripple-carry adder

Adding 0111 + 0001 changes every single bit of the answer. How long does a circuit have to wait before it can trust the result?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Adders set the speed of a processor's arithmetic. Understanding why the carry has to ripple, and what that costs in time, is the first step towards the faster adder designs used in every modern chip.

Goals

Predict

Add 0110 + 0111 in 4-bit binary. What is the result?

  1. 1101
  2. 1011
  3. 0111
  4. 1111

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Do Level 3 of the virtual computer: fill in the full adder table, find two 4-bit numbers whose carry ripples through all four columns (watch the settle clock), and work out how many gate delays the 4-bit adder needs before its carry out is certain.

What the interactive shows, in words

The virtual computer's ripple-carry adder shows four full adders in a row with carries passing right to left and a settle clock counting gate delays. Adding 0111 and 1001 makes the carry ripple through all four columns, and the carry out is certain after 9 gate delays.

Understand

By hand: right to left

Line the numbers up, start at the rightmost column and add the two bits plus any carry. Write the sum bit and carry the rest. 1011 + 0110: 1 + 0 = 1; 1 + 1 = 10 → 0 carry 1; 0 + 1 + 1 = 10 → 0 carry 1; 1 + 0 + 1 = 10 → 0 carry 1. Result 1 0001 = 17 = 11 + 6.

The ripple-carry adder

One full adder per column, each carry out wired to the next carry in. It is simple and small, but a column cannot be sure of its answer until the carry from the right has arrived, so the carry ripples across the whole adder.

Worst-case delay

Each gate takes a little time to settle. In the virtual computer's model the first column's carry is ready after 3 gate delays (XOR, AND, OR), and each further column adds 2. A 4-bit adder needs 3 + 2 × 3 = 9 delays; 32 bits would need 65. Faster designs, such as carry-lookahead, compute carries in parallel at the cost of more gates.

Explain it another way: intuitive

A row of dominoes: the last one cannot fall until every one before it has. The more bits, the longer the row.

Explain it another way: technical

Ripple-carry delay is O(n) in the number of bits because the carry chain is serial. Carry-lookahead adders compute generate (A·B) and propagate (A ⊕ B) signals per bit and combine them in a tree, giving roughly O(log n) delay.

Explain it another way: mathematical

With delay 3 for the first carry and 2 per further bit, the n-bit ripple delay is 3 + 2(n − 1) = 2n + 1 gate delays: 9 for 4 bits, 17 for 8 bits, 65 for 32 bits.

Explain it another way: applied

Processor designers choose adder structures to meet a clock speed: the adder must settle within one clock tick. Small microcontrollers can afford ripple-like adders; fast desktop chips cannot.

Try these examples

Example 1

Add 0101 + 0011 by hand, showing carries.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. Add 0110 + 0111 (4-bit). Give the result as a decimal number.

Answer:

2. An unsigned 4-bit register adds 1101 + 0100. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Answer:

3. An unsigned 4-bit register adds 1000 + 1001. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Answer:

4. Using the model 'first carry after 3 gate delays, then 2 more per extra bit', how many gate delays does an 8-bit ripple-carry adder need for its final carry?

Answer: delays

5. Which 4-bit addition makes the carry ripple through every column?

  • 0001 + 0010
  • 0111 + 0001
  • 0100 + 0100

Apply it

Finish BUILD 008 Level 3. Then, using the delay model above, make a table of worst-case delay for 4, 8, 16 and 32 bits and describe the pattern in one sentence.

Reflect

If you were designing a very fast processor, which would you rather spend: more gates or more time? Why?

Overflow and negative numbers

In a 4-bit computer, 7 + 1 = −8. That is not a bug in the adder. So what is going on?

About 35 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

Registers have a fixed number of bits, so every computer arithmetic result can overflow. Engineers who forget this have lost rockets; engineers who remember it design counters, timers and sensors that never surprise them.

Goals

Predict

A 4-bit unsigned register holds 1111 (15). You add 1. What does it hold now?

  1. 16
  2. 10000
  3. 0000
  4. 1111

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Set 4 bits. Add 1111 + 0001 and read the unsigned result and carry out. Then add 0111 + 0001 and read the signed view: why is 7 + 1 shown as −8? Find a pair of negative numbers whose sum looks positive. Switch to 8 bits and repeat one of your examples.

What the interactive shows, in words

The adder stepper shows each number's unsigned and signed values. In 4 bits, 1111 + 0001 gives 0000 with a carry out: unsigned overflow. 0111 + 0001 gives 1000, which is 8 unsigned but −8 signed: signed overflow, because two positive numbers gave a negative result. In 8 bits the signed range is −128 to 127.

Understand

Unsigned overflow

k bits hold 0 to 2ᵏ − 1. If a sum is bigger, the extra bit leaves as carry out and the register keeps the sum minus 2ᵏ. 4-bit 1011 + 0110 = 11 + 6 = 17 → keeps 1 (0001), carry out 1. The carry out flag is how hardware reports unsigned overflow.

Two's complement

To store negatives, let the top bit be worth −2ᵏ⁻¹. In 4 bits the range becomes −8 to 7: 0111 = 7, 1000 = −8, 1111 = −1. To negate, invert every bit and add 1. The same adder circuit then adds signed numbers correctly, so subtraction is just adding a negative.

Signed overflow

If two numbers of the same sign give a result of the opposite sign, the true answer did not fit. 0111 + 0001 = 1000: 7 + 1 'became' −8. Adding a positive and a negative can never overflow.

Real consequences

In 1996 the first Ariane 5 rocket was lost less than a minute after launch when its guidance software converted a 64-bit floating-point value into a 16-bit signed integer and the value did not fit. Embedded engineers choose widths with headroom and test the edges.

Explain it another way: intuitive

A 4-bit register is a clock face with 16 positions. Go past the top and you land back near the bottom. Two's complement just relabels the top half of the clock as negative numbers.

Explain it another way: technical

Unsigned k-bit addition is arithmetic modulo 2ᵏ; carry out signals overflow. Two's complement maps the same bit patterns to −2ᵏ⁻¹ … 2ᵏ⁻¹ − 1; signed overflow is the XOR of the carry into and out of the top bit.

Explain it another way: mathematical

8-bit: range −128 to 127. −1 = 1111 1111 = 255 as unsigned. −100 = 256 − 100 = 156 = 1001 1100. 100 + 100 = 200 overflows signed 8-bit and reads as 200 − 256 = −56.

Explain it another way: applied

Wheel encoders count pulses in fixed-width registers that wrap; robot code computes the difference between two readings in the same width so a wrap does not look like a huge jump.

Derivation: Why 'invert and add 1' gives −n
  1. In k bits, n plus its bitwise inverse ¬n is all 1s: for example 0101 + 1010 = 1111. So n + ¬n = 2ᵏ − 1.

  2. Add 1 to both sides: n + (¬n + 1) = 2ᵏ.

  3. A k-bit register cannot hold 2ᵏ: it wraps to 0. So in k-bit arithmetic n + (¬n + 1) = 0, which means ¬n + 1 behaves exactly like −n.

  4. Example, 4 bits: 5 = 0101, ¬5 = 1010, +1 = 1011. Check: 0101 + 1011 = 1 0000, which wraps to 0000. ✓

  5. Equivalently, the top bit is worth −2ᵏ⁻¹ instead of +2ᵏ⁻¹: 1011 = −8 + 2 + 1 = −5.

Try these examples

Example 1

Write −3 in 4-bit two's complement and check by adding 3.

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. In a 4-bit unsigned register, what is 1011 + 0110? Give the value the register holds, in decimal.

Answer:

2. What is −2 in 4-bit two's complement? Give the bit pattern's unsigned value in decimal.

Answer:

3. What is −5 in 4-bit two's complement? Give the bit pattern's unsigned value in decimal.

Answer:

4. An unsigned 4-bit register adds 1011 + 1100. What value does the register hold afterwards, in decimal? (Any carry out of the top bit is lost.)

Answer:

5. Which 4-bit two's complement addition overflows?

  • 0011 + 1110 (3 + −2)
  • 0101 + 0100 (5 + 4)
  • 1111 + 1111 (−1 + −1)

6. What is −5 in 4-bit two's complement? Give the bit pattern's unsigned value in decimal.

Answer:

Apply it

A robot stores its wheel speed in a signed 8-bit variable and adds 30 every control step. Starting from 10, after how many steps does it overflow, and what value does it show? Check with the adder stepper in 8-bit mode, then propose a fix.

Reflect

Why do you think computers use two's complement rather than a separate minus sign?

Week 18: Simulated digital system project

This week you will

Project: specify a fault-tolerant interlock

A single guard switch can stick 'closed' while the guard is open. How do you design logic that one broken sensor cannot fool?

About 45 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

This is the term project. You will specify, design and verify a small digital system the way engineers do for real machines: words, then a truth table, then logic, then exhaustive tests, then an honest list of what it does not protect against.

Goals

Predict

The machine may run only if two independent guard sensors (A, B) both say 'closed', the operator is present (C) and there is no fault (D = 1 means fault). On how many of the 16 input rows should it run?

  1. 1
  2. 4
  3. 8
  4. 15

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Type A · B · C · ¬D (A, B = guard sensors, C = operator present, D = fault). Read the 16-row truth table and find the single row where Y = 1. Now imagine sensor A is stuck at 1: toggle B to 0 (guard really open) and confirm Y stays 0. Try the same for each other input.

What the interactive shows, in words

In the expression explorer, Y = A · B · C · ¬D gives a 16-row truth table with Y = 1 only on row 1110: both guard sensors closed, operator present, no fault. If sensor A is stuck at 1 while the guard is open (B = 0), Y stays 0.

Understand

Specify before you build

Write each signal with its meaning: A = 1 'guard sensor 1 reads closed', B = 1 'guard sensor 2 reads closed', C = 1 'operator present', D = 1 'fault reported'. Then write the rule in one sentence and as a full truth table. Every one of the 16 rows must have a defined output.

Redundancy against a stuck sensor

With one guard sensor, a switch stuck at 1 would let the machine start with the guard open. With two independent sensors both required (A · B), one stuck sensor is not enough: the other still reads 0 and holds the machine off. This is the simplest form of fault tolerance.

Know the limits

The rule Y = A · B · C · ¬D does not detect that a sensor has failed; it only refuses to run on a single false 'safe'. A fault line stuck at 0, or two failures at once, could still fool it. Real safety systems add self-tests and certified hardware. Say so in your design note.

Explain it another way: intuitive

Two locks on a door, with different keys: losing one key, or one lock jamming open, still leaves the door locked.

Explain it another way: technical

Requiring agreement of redundant channels (1-out-of-2 to stop, 2-out-of-2 to run) means no single channel failing in the 'safe' direction can enable the output. Detecting the failure needs comparison of the channels over time, which needs memory (sequential logic, next year).

Explain it another way: mathematical

Four inputs give 2⁴ = 16 rows. Y = A·B·C·¬D is a single minterm (row 1110), so it is already minimal: 4 literals, one 4-input AND with one input inverted.

Explain it another way: applied

Industrial machine guards often use two switches of different types, and their safety controllers compare the two channels and lock out if they disagree.

Try these examples

Example 1

Sensor B is stuck at 1. The guard is actually open, so sensor A reads 0. The operator is present and there is no fault. What is Y?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. How many rows does the truth table of a 4-input interlock have?

Answer: rows

2. On how many rows is Y = A · B · C · ¬D equal to 1?

Answer: rows

3. Guard sensor A is stuck at 1 and the guard is open (B = 0). C = 1, D = 0. The machine…

  • Runs, because A says closed
  • Stays stopped, because B = 0
  • Runs only if the operator presses harder

4. Which failure can Y = A · B · C · ¬D NOT protect against on its own?

  • Guard sensor A stuck at 1
  • Guard sensor B stuck at 1
  • Both guard sensors stuck at 1 at the same time

5. Write out the 8-row truth table for Y = ¬(A + (B + ¬A)) (inputs A, B, C). On how many rows is Y = 1?

Answer: rows

Apply it

Write your project specification: signal table with meanings, the rule in one sentence, the full 16-row truth table, the simplified expression and a list of at least three failure cases with what your logic does in each. Mark any case it does not handle.

Reflect

Which row of your truth table would you most want a second engineer to check, and why?

Project: build, test every row and light the indicator

Your interlock logic passes the rows you tried. Did you try all sixteen? And will its 'RUN' light survive being switched on?

About 45 min · Checked by automated tests · Interactive lesson · Lite lesson (answers checked here)

Why it matters

A design is only as good as its evidence. Exhaustive testing is possible for small logic, so engineers do it, and the indicator light that tells an operator 'RUN' is a real circuit with real current limits.

Goals

Safety: Everything here is a low-voltage simulation. Never experiment with mains electricity or high-current batteries; real circuits are built only under supervision with a small, current-limited low-voltage supply.

Predict

A 5 V logic output drives a red LED (2.0 V) through 330 Ω. Roughly what current flows?

  1. About 9 mA
  2. About 15 mA
  3. About 30 mA

Write down your guess and your reason. The reveal is in the online lesson.

Discover

Choose the LED circuit with a red LED on 5 V (standing in for the interlock's logic output). Set the resistor to 330 Ω and read the current and the resistor's power. Try 150 Ω and 1 kΩ too, and pick the value you would use, with a reason. Then test your interlock gates in the logic lab, recording all 16 rows.

What the interactive shows, in words

In the circuits lab's LED circuit on 5 V with a red LED, 330 ohms gives about 9.1 mA with the resistor dissipating about 27 mW; 150 ohms gives 20 mA, right at a typical LED rating; 1 kΩ gives 3 mA, dim but safe. The interlock's 16 input combinations are tested in the logic lab and logged against the expected outputs.

Understand

Test every row

With 4 inputs there are only 16 combinations, so test all of them and record the output next to the expected value. Pay special attention to the single-fault rows from the previous lesson. A design that has passed every row has been verified against its truth table.

The indicator circuit

Treat the logic output as a 5 V source when Y = 1. For a red LED (2.0 V) and a target of about 10 mA: R = (5 − 2) ÷ 0.010 = 300 Ω; the next standard value up is 330 Ω, giving I ≈ 9.1 mA. Resistor power: P = 3 V × 0.0091 A ≈ 0.027 W, far under 0.25 W.

Check the output can supply it

Logic outputs can only supply a limited current; many can manage around 10–20 mA, but the real limit is on the chip's datasheet. Keeping the LED near 9 mA leaves margin. A bigger load, such as a motor or relay coil, needs a transistor driver, never a logic pin directly.

The design record

Present: the specification, the truth table, the gate design, the 16-row test log, the LED calculation with its simulated check, and the limitations. That record is what the term assessment looks at.

Explain it another way: intuitive

Testing every row is like checking every door in a building before locking up, not just the ones you remember.

Explain it another way: technical

Exhaustive testing of an n-input combinational block needs 2ⁿ vectors and proves functional correctness against the specification (not against the specification's own mistakes). Output drive is limited by the gate's output resistance and absolute maximum current ratings.

Explain it another way: mathematical

R = (5 − 2) ÷ 0.010 = 300 Ω → 330 Ω. I = 3 ÷ 330 = 9.09 mA. P_R = 3 × 0.00909 = 0.0273 W. P_LED = 2.0 × 0.00909 = 0.018 W.

Explain it another way: applied

Machine-safety test procedures list every input combination and the required result, and a person signs off each line. Indicator lamps on control panels are sized to be visible without stressing the electronics that drive them.

Try these examples

Example 1

The operator wants a brighter light, so you try 150 Ω. Is it within a 20 mA LED rating?

The worked solution is in the online lesson.

Common mix-ups

Practice questions

Questions only. Check your answers in the Lite lesson; they are graded on our server and nothing is saved.

1. A 5 V logic output drives a red LED (Vf = 2.0 V) through 330 Ω. What current flows, in milliamps?

Answer: mA

2. What power does the 330 Ω resistor dissipate in that circuit, in milliwatts?

Answer: mW

3. A red LED drops 2.0 V when lit. It runs from a 9 V supply and should carry 15 mA. What series resistor is needed, in ohms?

Answer: Ω

4. Your interlock passes 15 of its 16 rows in testing; you skipped one because 'it obviously works'. What should you do?

  • Ship it; 15 out of 16 is 94%
  • Test the last row: exhaustive testing is cheap here and that row might be the faulty one
  • Test the first row again to be sure

5. Could the interlock's logic output drive the machine's motor directly?

  • Yes, if the motor is small
  • No: a logic output can only supply a small current; a motor needs a driver circuit
  • Yes, through a bigger resistor

Apply it

Submit your design record: specification, 16-row truth table, gate design built in the logic lab, 16-row test log with expected and actual outputs, LED resistor calculation checked in the circuits lab, and a limitations list. Use the term project rubric to check your own work before you hand it in.

Reflect

What is one thing your tests proved, and one thing they could not prove?