1.1.1 architecture of the CPU

1.1.1a The purpose of the CPU

CPU

The brains of the computer

FDE (Fetch Decode Execute)

Fetch is when the CPU takes in an instruction from the RAM.

Decode is when the CPU looks at the instruction and works out what to do with it.

Execute is when the CPU carries out the instruction.

Extra info: The cycle happens billions of times every second. This is known as clock speed. it is measured in hertz. 3 Ghz (Gigahertz) = 3 billion cycles per second.

1.1.1b Common Components and their functions

click to edit

The control unit

The arithmetic logic unit

The cache

The registers

The clock

The buses

The clock is a tiny quartz crystal inside the CPU which ticks at a steady speed.

Each time the clock ticks the CPU can process one instruction.

A typical clock has a speed of around 3GHz which means the CPU can carry out three thousand million instructions per second.

It is faster to access than RAM, but slower to access than the registers.

The cache is another type of temporary memory.

There can be both an internal cache (Inside the CPU) and an external cache (Outside the CPU)

It controls and monitors the flow of data between the CPU and other hardware components.

It executes the instructions provided by the program.

It controls the way data moves around the CPU.

It performs standard arithmetic operations such as addition, subtraction, etc.

It deals with logic and comparisons such as "Is this value greater than that value?"

The ALU handles the data processing inside the CPU.

A register is a type of temporary memory located inside the CPU.

Their role is to carry data around the system.

The data bus carries data around the system.

A bus is a set of wires or tracks laid down on a printed circuit board.

The address bus carries information on the location of the data.

The control bus handles commands to control devices. e.g. hard disk, monitor, etc.

image

image

image

image

1.1.1c Von Neumann Architecture

MDR Memory Data Register

When the CPU needs to fetch an instruction or data from main memory RAM it is initially stored in the MDR Memory Data Register, it is then moved from the MDR to the relevant register.

Registers - Very fast type of temporary memory, can hold a data value

instruction register

Having fetched an instruction from RAM, (Which is stored in the MDR) it is then transferred to the instruction register to be decoded and executed

program counter

The program counter is used to identify the location of the next instruction to be executed by the CPU.

MAR (Memory Address Register)

the MAR (Memory Address Register) is updated by the program counter to contain the location (address) of the next instruction / data to be fetched from RAM. This address/location is passed to RAM via the address bus.

The accumulator

The accumulator is a register that is used to temporarily store data whilst calculations are being performed within the Arithmetic logic unit (ALU)