Parts of the CPU

Contents
  1. Stored Program Computers
  2. Von Neumann Architecture
  3. The Fetch Decode Execute Cycle

1. Stored Program Computers

Computers like Colossus, while electrical, and stored data electrically, were programmed mechanically using wires and switches and if you wanted to change the program being run on the computer, it would have to be re-wired.

This was a major problem, as everytime we needed the computer to do something different it required a rebuild.

Von Neumann, a Hungarian engineer and scientist, proposed storing the program (instructions – what tells the computer what to do) electrically along with data. 

His implementation of a “Stored Program Computer” is called Von Neumann Architecture, and is the basis of the architectures computers use to this day.

 


2. Von Neumann Architecture

Von Neumann suggested the following architectrue, where instructions are stored in memory. On modern day computers this memory could be RAM or Secondary storage, however in this architecture refers to a memory store closer to the concept of RAM.

Parts described in the architecture

Term Definition
Arithmetic Logic Unit (ALU) The ALU carries out two main tasks: Carries out Arithmetic (+,-,/,*) and Logic operations (AND, OR, NOT).
Control Unit Controls what the CPU is doing. Sends signals to control the flow of data inside the CPU.
Registers Tiny memory locations built into the CPU. They are VERY fast at moving data around and VERY expensive to make. They can only hold a tiny amount of data.
Memory (Not a part of the CPU but heavily linked) Stores data and instructions. The CPU must fetch both from the memory in order to use them. Memory is much larger than cache and registers, but it is much slower to read and write data to memory.
Busses Tiny wires built into the CPU. Data, instructions and signals can be passed across these between different parts of the CPU.
Clock The Clock determines “how fast” the CPU is. It ticks many times each seconds – this is measured in hz (hertz). A lot of computers can complete billions of ticks every second (1 billion ticks = 1Ghz).

 


3. The Fetch Decode Execute Cycle

The Fetch Decode Execute Cycle is the only thing that a CPU can do. This process begins as soon as a computer is switched on and will only end when it is turned off.

Each step in the Fetch Decode Execute cycle makes use of different parts of a CPU and different busses.

Fetch

All the data and the instructions the CPU needs is stored in Memory (which is outside of the CPU). All the data and instructions have their own unique address for the “memory location” they are in.

When the CPU needs data or instructions it requests them using the address of their memory location. The CPU places the memory location address on the Address Bus.

 

The data or instruction at the memory location address requested by the CPU is sent back to the CPU using the Data Bus. The data or instruction requested is now stored in registers within the CPU.

Decode

The Control Unit inside the CPU figures out what to do with the instructions that has been fetched from memory.

Every CPU has an Instruction Set: A list of every instruction it can carry out. Each instruction has a unique binary number

Execute

The execute stage is where the instruction is carried out. This could be many things: It could be for the ALU to carry out a calculation, to fetch data, fetch another instruction at another memory location, or even to store data in memory.

Once the execute stage has been completed the cycle starts again.