Skip to content. | Skip to navigation

How to build a computer

TransistorsComputers are all around us, but most people have no idea how they work. Find out about the basics.


Modern computers rely on materials called semiconductors. These are partway between insulators (materials that electricity can't flow through) and conductors (materials that electricity flows through well). The most common semiconductor is silicon.

Semiconductors become really useful when they are doped, which means another material is added to them. This affects how conductive they are.

Electric current is the flow of electrons between the atoms in a material. Doping can either add atoms with free electrons that can move through the semiconductor, or add atoms with 'holes' for electrons to move into. The first of these is called n-type and the second is called p-type.

Diodes and transistors

The extra electrons in n-type silicon can easily flow into the extra holes in p-type silicon, but it's much harder for electrons to flow the other way. This means that you can use the two types to control how electricity flows. For example, you can put the two together to create a device which only lets electricity flow through a circuit one way. This is called a diode. A diode might be useful in a solar charger for mobile phones, to make sure power can only flow from the charger to the phone - instead of flowing the other way and draining the battery.

The most important device made from silicon is the transistor. A transistor can use the flow of electricity to one part of it to change how electricity flows through the other parts of it. For example, it can be used as an electronic switch, or to boost an electrical signal.

Logic gates

These simple devices can be put together to make logic gates. These devices answer questions about the wires going into them (the inputs) by turning another wire (the output) on and off.

For example, an AND gate answers the question: 'are all of the inputs switched on?' If they are, then it switches on the output. A NOT gate turns the output on if the input is off, and turns the output off if the input is on.

You can combine these gates to build circuits that do more complicated calculations, such as addition and subtraction. Modern computers use millions of logic gates to do all the calculations it takes to play a film or browse the internet.

Unusual computers

Although nearly every computer in the world uses silicon and electricity for its logic gates, that's not the only way. They can be made using chemical reactions, or even gears and levers. People have even built working computers inside computer games, and scientists have managed to make logic gates by exploiting the way that a certain species of crab moves.

Related Links