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

# 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.

## 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:

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.

## Transistors

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.

## 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.

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.

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.

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.