How A Computer Works

1 Learning Objectives

By the end of the lesson …

  • All Should Understand the role of a switch as a human interface with an electrical circuit.
  • All Should Understand that the behaviour of elecrical circuits is reliable, predictable and logical
  • All Should Be able to define how a transistor can act as a switch.
  • Most Should Be able to complete a truth table for an NAND gate and describe it's operation.
  • Most Should Be able to complete the truth tables for AND, OR and NOT.

2 Transistors

Learn It

The Big Question

  • What is man's greatest invention… Fire? The wheel? The internet? Sliced bread?
  • Transistors can come in many shapes and sizes.


  • They all have something in common - three pins.
  • The transistors we find in computer chips and memory are much smaller - 22nm to be exact which is 0.000000022m


  • The circuit diagram for a transistor is shown below, with the three pins labeled B for Base, C for Collector and E for Emitter.
  • As mentioned in the previous lesson, a transistor can act like a switch. When there is current entering the Base(B) of the transistor, current is allowed to flow through the Collector(C) to the Emitter(E).

Try It

  • Have a play with the transistor below so you understand how applying a voltage to the base of a transistor is equivalent to turning on a switch.

3 Assessment

Badge It - Silver

  • In your own words write up a description of how a transistor can act as a switch. Make sure you are using the words Collector, Base, and Emitter.

4 NAND Gates

Learn It

  • We can combine transistors to make some pretty useful things. One combination of transistors is known as a NAND gate.
  • A NAND gate is made from two transistors combined as shown below.
  • The basic concept of this arrangement, is that if current can't flow through the collector and base of both resistors to Earth, then instead it will flow through the OUT
  • If both transistors allow current through their Collector and Emitter, then no current will flow through OUT
  • Have a play with the arrangement below and make sure you understand how the NAND gate works.

5 Assessment

Badge It - Gold

  • Below is a table showing the states that A and B can have, with a column left blank for the OUT (which has been labeled Q). This is called a Truth Table.
0 0  
1 0  
0 1  
1 1  
  • Copy the table and complete the column labeled Q. (An input or output is ON (1), if it current is flowing through it (red)
  • Now copy and fill in the missing spaces in the description below.


NAND gates have two inputs (A and B) and an output (_). When A and B are both __, then Q is __. If either A or B are __ then Q is __. If A and B are both __ then Q is __.

Badge It - Platinum

  • There is another arrangement of transistors that can produce a table as shown below.
0 0 0
1 0 1
0 1 1
1 1 1
  • Using Circuit Wizard (using transistors, power, a LED and switches), or any graphics package on your computer, try to draw the arrangement of transistors that would produce a table like this.