PhysicsCore22 min read

Basic Electronics

Diodes, transistors and the logic gates built from them

This topic appears in:

01

Conductors, insulators and the semiconductor in between

A conductor has free electrons that drift through it, so it carries current easily. An insulator has none — every electron is bound to its atom. A semiconductor sits between the two, and that awkward middle position is exactly what makes it useful.

Pure silicon at room temperature conducts only very slightly. Heat it and it conducts better, because thermal energy frees more electrons — the opposite of a metal, whose resistance rises when hot. That difference is worth remembering, because it is the standard way exams test whether you know what a semiconductor is.

The real trick is doping: adding a trace of another element to change the conduction deliberately. Add an element with five outer electrons and there is a spare electron for every added atom, giving n-type silicon whose carriers are negative. Add one with three outer electrons and there is a missing electron — a hole — giving p-type silicon whose carriers behave as positive.

A hole is not a particle. It is the absence of an electron, which neighbouring electrons keep falling into, so the vacancy appears to travel the other way. Treating it as a positive carrier gives the right answers and is the standard convention.

MetalSemiconductorInsulator
Conducts?very wella little, and controllablynot at all
Resistance when heatedrisesfallsstays very high
Charge carriersfree electronselectrons and holesnone free
Examplecoppersilicon, germaniumglass, rubber

A semiconductor behaves like a thermistor

Both conduct better when hot, because heat frees more charge carriers. A metal wire does the opposite. If a question tells you resistance fell as temperature rose, you are looking at a semiconductor or a thermistor, never at a plain metal.

02

The diode

Definition

Diode — A component made from a p–n junction that allows current to flow in one direction only.

Join a piece of p-type silicon to a piece of n-type and you have a p–n junction. Electrons from the n-side and holes from the p-side meet and cancel near the boundary, leaving a thin region with no free carriers — the depletion layer — which acts as a barrier.

Connect the positive terminal of the supply to the p-side and the barrier is pushed aside: the diode is forward biased and conducts, though only once the applied voltage exceeds about 0.7 V for silicon. Connect it the other way round and the barrier widens: the diode is reverse biased and essentially no current flows.

The I–V graph shows this asymmetry plainly. In the forward direction there is nothing until roughly 0.7 V, after which the current rises very steeply. In the reverse direction the line runs flat along the axis at almost zero.

This one-way behaviour makes the diode a rectifier: feed it alternating current and only the halves of the cycle in the forward direction get through, converting a.c. into a rough d.c. Nearly every mains adapter in your house begins with this.

A light-emitting diode is a diode that releases its energy as light when forward biased. It uses far less energy than a filament lamp because it produces almost no heat, and it lasts far longer. Like any diode, it works only one way round.

forward bias: p to +, conducts above ≈ 0.7 Vreverse bias: p to −, blockssilicon needs about 0.7 V to switch on; germanium about 0.3 V
Worked example 14 marks

A single diode is placed in series with a lamp and a 12 V a.c. supply. Describe what happens to the lamp, and explain why.

  1. The lamp lights, but less brightly than on d.c.
  2. The diode conducts only when it is forward biased.One-way component.
  3. So only half of each cycle passes — this is half-wave rectification.The other half is blocked entirely.
  4. The lamp receives about half the power, so it is dimmer.Averaged over a whole cycle, half the energy is delivered.

it lights dimly — the diode passes only half of each a.c. cycle

Choose Diode and the asymmetry is the whole picture: flat along the axis in reverse, nothing forward until about 0.7 V, then a rise so steep it leaves the top of the graph. The other three are there to compare it against — a component that conducts equally both ways looks nothing like this.

03

The transistor as a switch

A transistor has three connections — base, collector and emitter — and its job is that a small current at the base controls a much larger current between collector and emitter. That is amplification, and used at its extremes it is switching.

Below a threshold base voltage of roughly 0.6 V, essentially no collector current flows and the transistor is off. Above it, the transistor turns on and a large collector current flows. There is no moving part, no contact to wear out, and the change takes microseconds.

This is what makes automatic control circuits possible. Put a light-dependent resistor in a potential divider so that the voltage at the base rises as darkness falls. When it crosses the threshold the transistor switches on and a lamp or a relay operates — an automatic street light, built from four components.

Swap the LDR for a thermistor and the same circuit becomes a temperature alarm. Which way round you place the sensor in the divider decides whether the circuit triggers on hot or on cold, and that is a favourite exam question: work out what happens to the sensor's resistance, then what happens to its share of the supply voltage.

Key points

  1. A small base current controls a much larger collector current.
  2. Below about 0.6 V at the base the transistor is off; above it, on.
  3. A sensor in a potential divider supplies that base voltage.
  4. Swapping the sensor and the fixed resistor reverses when the circuit triggers.
  5. A relay lets the transistor switch a high-power circuit safely.
04

Logic gates

Digital electronics works with two states only: 0 for low voltage and 1 for high. Every logic gate is built from transistors, and each takes one or two of these inputs and produces one output according to a fixed rule.

Five gates cover the syllabus, and the fastest way to hold them is by the one-line rule rather than by memorising tables. AND gives 1 only when both inputs are 1. OR gives 1 when either is 1. NOT inverts its single input. NAND and NOR are AND and OR each followed by a NOT, so their outputs are the exact opposite.

A truth table lists every possible combination of inputs with the resulting output. With two inputs there are four rows; with three inputs there are eight. Writing the input combinations in counting order — 00, 01, 10, 11 — guarantees you do not miss one.

Gates are combined to make useful circuits. A safety interlock on a machine might use an AND gate so the motor runs only when the guard is closed and the start button is pressed. A fire alarm might use an OR gate so it sounds when the smoke sensor or the heat sensor triggers.

ABANDORNANDNOR
000011
010110
100110
111100
Worked example 24 marks

A machine guard sensor gives 1 when the guard is closed. A start button gives 1 when pressed. The motor must run only when both are true. Name the gate needed and give its truth table.

  1. Both conditions must hold, so an AND gate is needed.The word "both" in the requirement points straight to AND.
  2. Rows 00, 01 and 10 all give output 0.At least one condition fails in each.
  3. Row 11 gives output 1.Only here are both conditions satisfied.
  4. The motor therefore cannot start with the guard open, whatever the button does.This is the safety property the circuit exists to guarantee.

AND gate — output 1 only for inputs 1 and 1

Pick a gate, then flip inputs A and B. The wires light up when they carry a 1, and the matching row of the truth table is highlighted. Compare AND with NAND and you will see the output column is simply inverted.

NAND and NOR are the inverted columns

You do not need to learn four tables. Work out AND and OR, then flip every output to get NAND and NOR. In an exam this halves both the effort and the chance of a slip.

Practice questions

6 questions · 26 marks · full working on every one

Try each one on paper first, then open the working. The marks are shown where they are actually awarded, because that is where they are actually lost.

Short questions

3 · 6 marks

Two marks each, in the style of the short-question section of the paper. Answer in two or three lines.

SQ1[2 marks]
State what is meant by doping, and name the two types of semiconductor it produces.
Model answer

Adding a small amount of another element to a pure semiconductor to change its conductivity. It produces n-type, where the carriers are free electrons, and p-type, where they are holes.

Examiner tip. Name both types and say what carries the charge in each — that pairing is what earns the second mark.

SQ2[2 marks]
Explain why the resistance of a semiconductor falls when it is heated, while that of a metal rises.
Model answer

In a semiconductor, heat frees more charge carriers, so more current can flow. In a metal the number of carriers is fixed, and heating makes the ions vibrate more so the electrons collide with them more often.

Examiner tip. Two different mechanisms — more carriers versus more collisions. Give both halves.

SQ3[2 marks]
State what happens to a diode when it is reverse biased, and give one use of this property.
Model answer

The depletion layer widens and essentially no current flows. This one-way behaviour is used to rectify alternating current into direct current.

Examiner tip. The use must follow from the property. "It is used in circuits" scores nothing.

Long questions

2 · 15 marks

Theory and numerical together, as they appear in the long-question section.

LQ1[8 marks]
A student builds an automatic light that switches on when it gets dark, using an LDR, a fixed resistor, a transistor and a lamp.
  1. Explain how the LDR and fixed resistor form a potential divider. [2]
  2. Explain what happens to the voltage at the base as darkness falls. [3]
  3. Explain how the transistor uses that voltage to switch the lamp on. [3]
Mark scheme
  1. The two components are in series across the supply[1]
  2. They share the supply voltage in proportion to their resistances[1]
  3. As it gets darker the resistance of the LDR increases[1]
  4. So the LDR takes a larger share of the supply voltage[1]
  5. The base voltage, taken across the LDR, therefore rises[1]
  6. When the base voltage exceeds about 0.6 V the transistor switches on[1]
  7. A small base current then allows a much larger collector current[1]
  8. That current flows through the lamp, lighting ita relay would be used for a mains lamp[1]

Examiner tip. Follow the chain in order: light falls → LDR resistance rises → its share of the voltage rises → base voltage crosses the threshold → transistor conducts. Skipping a link loses the mark for it.

LQ2[7 marks]
A fire alarm must sound if either a smoke sensor or a heat sensor detects danger. Each sensor outputs 1 when triggered.
  1. Name the gate required and give its truth table. [4]
  2. The design is changed so the alarm sounds only if BOTH sensors trigger. State the gate now needed and give one disadvantage of this design. [3]
Mark scheme
  1. An OR gate is required[1]
  2. Inputs 0,0 give output 0[1]
  3. Inputs 0,1 and 1,0 both give output 1[1]
  4. Inputs 1,1 give output 1[1]
  5. An AND gate would now be needed[1]
  6. The alarm would not sound if only one sensor detected the fire[1]
  7. A real fire could therefore be missed, so the design is less safe[1]

(a) OR gate (b) AND gate — but it fails to warn when only one sensor triggers

Examiner tip. Read the wording carefully. "Either" means OR; "both" means AND. Most marks lost here are lost by reading the requirement too fast.

Exam questions

1 · 5 marks

Multi-part questions with a full mark scheme.

Q1[5 marks]
A single diode is used with a 9.0 V a.c. supply and a resistor.
  1. Sketch the shape of the output voltage across the resistor. [2]
  2. Name this process. [1]
  3. Explain how the output could be made smoother. [2]
Mark scheme
  1. Only the positive halves of each cycle appear[1]
  2. The negative halves are missing, leaving gaps along the axis[1]
  3. Half-wave rectification[1]
  4. Add a capacitor in parallel with the resistor[1]
  5. It charges during each pulse and discharges through the gaps, holding the voltage upa four-diode bridge would also give full-wave rectification[1]

Examiner tip. Half-wave leaves gaps; full-wave flips the negative halves up instead. Sketch the gaps clearly or the examiner cannot tell which you meant.