Computer Hardware: How Computers Work

Dr David Greaves

Computer Laboratory

University of Cambridge






Charles Babbage

Born December 26, 1791 in Teignmouth, Devonshire, UK. Died in 1871, London. Known as the 'Father of Computing' for his contributions to the basic design of the computer through his Analytical Machine.

Difference Engine

A mechanical calculator with FIXED (hardwired) program.


Computers and calculators need storage to keep data.
Computers store their program as well.

Storage is in REGISTERS or in MAIN MEMORY.
Digital storage, Babbage used base 10, not binary.



Babbage had grand plans for a PROGRAMMABLE machine: the Analytical Engine.


Programming

A program is a list of instructions:

Four basic types: change a register, load/save register in memory, PC change, I/O.









Jacquard Loom

The loom is controlled with punched cards that describe the pattern to be woven.

The card under the reader is the current point in the program (program counter or PC).

There is no GOTO statement: the instructions are followed in sequence, but perhaps some could be predicated ?


This card reads 'FACTORIAL PROGRAM BY GREAVES'.


I created it using a sort of typewriter like this.

1947: EDVAC

The EDVAC was an early electronic computer that had separate memories for program and data. Main memory held 1024 ten-digit decimal numbers.


Stored Program Computation

First Draft of a Report on the EDVAC (commonly shortened to First Draft) was an incomplete 101-page document written by John von Neumann and distributed on June 30, 1945. Program and data were in the same memory at last.




EDSAC: A stored-program computer.

Sir Maurice Wilkes:

Alan Turing:

EDSAC:  

Electronic Delay Storage Automatic Calculator (EDSAC) was an early British computer. The machine, having been inspired by John von Neumann's seminal First Draft of a Report on the EDVAC, was constructed by Maurice Wilkes and his team at the University of Cambridge Mathematical Laboratory in England. EDSAC was the first practical stored-program electronic computer.

The project was supported by J. Lyons & Co. Ltd., a British firm, who were rewarded with the first commercially applied computer, LEO I, based on the EDSAC design. EDSAC ran its first programs on May 6, 1949, calculating a table of squares and a list of prime numbers.

The EDSAC's memory consisted of 1024 locations, though only 512 locations were initially implemented. Each contained 18 bits.

Since then, really the only developments have been speed, size, electricity used and storage capacity: the design has not changed!.




Electronic Computing Basics: The Telegraph

Morse Code

Morse code tapper.






Serial and Parallel Communication

With eight wires, using binary on each line, you can send one BYTE at a time.




A Relay Station

A relay is a switch operated by an electro-magnet.

Buffering the telegraph.

Viewing it as a logic circuit.

Rather than many miles, the same ideas are used for sending information a few centimeters over a circuit board or a fraction of a millimeter over a silicon chip.




Teletype: Don't need to learn Morse Code. Don't need to write it down at the receiving station!

Modern character set:

Use an 8-bit byte for each character sent.

Compatibility: You can still plug a 1950 mechanical teletype into a recent laptop.

Only one wire in each direction is actually needed: so with a ground earth connection as well, a total of three pins are commonly used on the nine-pin serial connector.






Gate Transfer Curves.

Plots of input and output voltage for the basic components.

Characteristic shape: flat at the edges, sharply changing in the middle: keeps binary digits clean.

Voltage meanings and margins (five volt system):






How To Store One Bit

Electromechanical implementation: Using a relay

A latching-relay can hold one binary digit (one bit):

Alternative Implementation: Electronic

The bi-stable, or flip-flop, made from two inverters in a ring, is the basic means of making registers in silicon chips.

The mechanical and electronic bistables are both volatile, meaning that information is lost when the power is removed.

Besides bistables, most computers today store data as magnetic spots on the hard disk and static electricity charges in Flash and DRAM memories.




A Logic Gate

The simplest function we can compute is implemented by a basic logic gate.

My logic gate is implemented with two relays: while they are both activated by logic ones on their inputs, the output becomes a logic one. Today, gates are made out of field-effect transistors and four transistors are used instead of two relays.




Other Basic Gates

There is also an XOR gate, and versions of AND and OR with inverted outputs called NAND and NOR.




Adder Circuits

A half adder tallies two inputs creating a binary number in the range 0 to 2.
    A  B  |   C  S
    --------------
    0  0  |   0  0
    0  1  |   0  1
    1  0  |   0  1
    1  1  |   1  0 

The full adder: made of two half adders:

A full-adder tallies three inputs creating a binary number in the range 0 to 3.

A full-adder tatto:

Larger adders can be made by cascading full adders:

A three bit-adder is made from three full adders (six half adders).
   A3 A2 A1    B3 B2 B1  |   C4 S3 S2 S1
   -------------------------------------
   1  0  1     0  1  0   |   0  1  1  1     5 + 2 = 7

Three-bit adder schematic symbol:

Gate count: each gate is roughly 4 transistors. A three bit adders is 15 gates = 60 transistors.




Moore's Law

Moore's law describes an important trend in the history of computer hardware: that the number of transistors that can be inexpensively placed on an integrated circuit is increasing exponentially, doubling approximately every two years. The observation was first made by Intel co-founder Gordon E. Moore in a 1965 paper.

The largest chips are about the size of a fingernail.

There are five or six major chips in a Nintendo DS, and dozens of small ones.






Multiplexor: Another Basic Component






Making a transparent latch flip-flop






Putting flip-flops together to make a register.

(These flip-flops are edge-triggered, meaning that they sample their input data on the positive edge of the clock. Internally, they use a pair of transparent latches).




Putting registers together to make a RAM

Illustration of a linear array of registers:

Dynamic RAM>

Larger arrays are made using dynamic technology, using electric charge on a capacitor to store a bit instead of the ring-pair of inverters: .






Other important components: Counter and Clock

The clock generates a regular series of transitions.

A counter increments on each clock pulse.

How to make a counter from an adder and a broadside register:

With ten output wires, the count range is 0 to 4095.

Alternative technique: ripple counter, sequence.




Counter Connected to RAM

The counter output can index a RAM containing instructions.

Put instructions in the RAM and it steps through them in sequence, like stepping through the Jaquard punch cards.






A jumpable counter

Here we add a multiplexor between the adder and the broadside register.

This enables a new value to be seeded.

One of the instructions can be a GOTO, that operates the multiplexor to select a branch destination.




An Execution Unit with Control Unit

The ALU is an arithmetic logic unit: it can compute a variety of functions of its two inputs.




Combining the Execution and Control Units

The combination of control and execution units on a single chip is a called a microprocessor.

A single bus connects the processor to the memory system. This has been called the Von-Neumann bottlneck. It is avoided in today's computers by dedicating a large fraction of the processor chip to cache memories.

A Relay Computer




Our Program Again

The von Neumann computer:











Computer Architecture






The Future

Conventional computers cannot be made any smaller or faster out of silicon: we are running out of atoms!

Today's new computers have multiple conventional computer cores on one chip: for example the "Intel Core 2 Duo" or the AMD "Turion". The cores all sharing the same main memory.

We are expecting the number of cores on the chip to keep growing.




END. (C) 2008-11 David Greaves.