Skip main navigation

£199.99 £139.99 for one year of Unlimited learning. Offer ends on 28 February 2023 at 23:59 (UTC). T&Cs apply

Find out more

From Switches to Transistors

You should already be familiar with performing calculations using 1s and 0s, and that the state of a switch can be used to represent a 1 or a 0. You are now going to look at how this concept developed into the modern computer.

You should already be familiar with performing calculations using 1s and 0s, and that the state of a switch can be used to represent a 1 or a 0. You are now going to look at how this concept developed into the modern computer.


What is a Switch?

A switch is just a device that can either allow electricity to flow through it, or stop electricity from flowing through it. The first switches used in programmable computers were called relays. These are electromechanical devices, and they consisted of moving parts.

What is a Relay?

A relay is little more than an electromagnet attached to a normal switch. By using a current to turn the electromagnet on and off, you can turn the switch on and off. The Z3 was the first programmable computer to be built, in 1941, and it contained 2000 relays. It was capable of executing about five to ten instructions per second, which is pretty slow in comparison to modern computers that have clock speeds in the billions.


An animation of a relay. When the electromagnet is off, the two contacts are held apart by a spring, so no current flows and the lamp connected to the relay is off. When the electromagnet is turned on, the lever is attracted to the electromagnet, pushing the two contacts together, and allowing current to flow. The lamp then lights up.


Triodes or Valves

After the relay switch came the triode, or valve (in the UK). These devices had no moving parts, which meant that they could act as switches much faster. A triode consists of an evacuated glass tube, into which two electrodes are inserted, separated by a grid. One of the electrodes is heated up, and emits electrons. These are attracted to the other electrode, which is positively charged. This completes the circuit and allows a current to flow. However, if the grid between them is negatively charged, it will repel some of the electrons, preventing them from reaching the second electrode and stopping the current.


The image below is a Western Electric VT-1 Triode developed in 1917:


Western Electric VT-1 Triode Vacuum Tube.


The first computer to use these valves was the Colossus, built in 1943. The problem with valves, though, was that just like light bulbs, they could “blow” (stop working) and would need to be replaced.





Following on from valves, came the invention of the transistor. Made from semiconductors, these components could again act like switches without having any moving parts, and were very hard wearing. They could also be made very small, meaning a lot of transistors could be combined together. Transistors are the basis for all modern-day computers.


Transistorer (cropped).


Base, Collector and Emitter

A transistor has three terminals – the base, the collector, and the emitter. A small current at the base of the transistor can allow a large current to flow between the emitter and the collector. This allows transistors to act like tiny switches.


You can see a transistor in operation in this simulation.


A coin battery is connected to several other components. Connected to the positive terminal of the battery are a switch labelled "INPUT" and a resistor. The other side of this resistor is connected to the collector of a transistor, and to an LED, labelled "OUTPUT". Connected to the negative terminal of the battery are the emitter of the transistor, and a resistor, the other side of which is connected to the LED. The second wire from the switch is connected to the base of the transistor.
Link to interactive simulation (You will need to create a Tinkercad account to view it)


You don’t have to understand the circuit, but just notice that the transistor is enabling the button to do the opposite of what you might normally expect. When the button is off, the LED is on. When the button is clicked, it turns the LED off.


Think about this in terms of a Turing machine, and you might start to understand how transistors can be used to build computers.


Imagine a Turing Machine where there are only two cells on the tape. The program might be as follows:



State Symbol Write Move Next State
A 1 None Right B
0 None Right C
B 0 0 Left Halt
1 0 Left Halt
C 0 1 Left Halt
1 1 Left Halt


If the first cell is a 0 (the button is off), the machine would write a 1 in the adjacent cell (turn the LED on). If the first cell is a 1 (the button is on), the machine would write a 0 in the adjacent cell (turn the LED off).

This is only with a single transistor, but with more transistors you can create some incredibly complex instructions. The binary addition Turing machine you looked at earlier can be created with a handful of transistors. The question is, how many transistors does it take to build a modern computer?

You can still get regular-sized transistors today that can be a few millimetres to a few centimetres in size. However, modern technology has enabled us to shrink the size of a transistor down to microscopic sizes.

This is an additional video, hosted on YouTube.

Modern-day computers have transistors that are at the 7 nm scale. That’s 7 billionths of a metre! You could arrange nearly 15000 of these transistors along the width of a human hair.

In 1971, the smallest transistor size was about 10 micrometres, and they’ve been on the decrease ever since. This was predicted by Gordon Moore, a co-founder of Intel. He predicted that the number of transistors that could fit on a processor would double every 18 months or so.

Moore's Law Transistor Count 1971-2016.

This massive increase in the processing power of modern-day computer chips has led to the current technological revolution, which sees so many of us carrying around computers in our pockets, computers being embedded into the most mundane of everyday objects, and supercomputers that can beat humans at incredibly complex games such as Go.

This article is from the free online

How Computers Work: Demystifying Computation

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education