The brain of the computer, takes an input, processes data and produces an output
Fetch-Execute Cycle
The cycle that the central processing unit (CPU) runs through billions of times per second to make a computerwork
Fetch-Execute Cycle
1. Fetch stage
2. Decode stage
3. Execute stage
Fetch stage
The next instruction or data must be fetched from the computer's memory (RAM)
Decode stage
The CPU needs to work out what is required from the instruction
Execute stage
The CPU will carry out the instruction that was fetched, such as performing a calculation, storing a result or data back in main memory, or going to main memory to fetch data from a different location
Input
Clicking a button on the gamepad
Processing input
The CPU inside the console follows a set of instructions to carry out the task
Output
The player moving on screen
The important things to remember are: An instruction or data is fetched from memory, the instruction is decoded, the instruction is executed, the cycle repeats billions of times per second
CPU
Central Processing Unit
Components of the CPU
Arithmetic Logic Unit (ALU)
Control Unit (CU)
Cache
Registers
Function of the Arithmetic Logic Unit (ALU)
1. Performs arithmeticoperations
2. Performs logicaldecisions
Function of the Control Unit (CU)
1. Coordinates how data moves around the CPU by sending a signal to control the movement of the data
2. Decodes the instructions fetched from memory
Cache
Very small, very fast memory located in the CPU which is used to provide quick access to frequently used instructions and data
More cache there is
More data can be stored, which speeds up the performance of the CPU
Cache
Prevents the CPU from having to repeatedly fetch frequently used instructions from RAM
Registers
Extremely small, extremely fast memory located in the CPU, each with its very own specific purpose
More details about the individual registers can be found here
Von Neumann Architecture
A design of the CPU which was proposed by Mathematician John Von Neumann in the 1940s, which most general-purpose computers are built upon
Von Neumann Architecture
It outlines how the computer memory, input / output devices and processor all work together
Main registers in Von Neumann Architecture
Program Counter (PC)
Memory Address Register (MAR)
Memory Data Register (MDR)
Accumulator (ACC)
Program Counter (PC)
Holds the memory address of the next instructions to be executed
Increments by 1 as the fetch-decode-execute cycle runs
Memory Address Register (MAR)
Holds the memory address of where data or instructions are to be fetched from
Memory Data Register (MDR)
Stores the data or instruction which has been fetched from memory
Accumulator (ACC)
Stores the results of any calculations that have taken place in the Arithmetic Logic Unit (ALU)
Common characteristics of the CPU
Clock Speed
Cache Size
Number of Cores
Each of these characteristics has a significant impact on the performance of the CPU
Clock Speed
The clock speed is measured in Hertz (Hz) and measures the number of fetch-decode-execute cycles that can take place in 1 second
The faster the clock speed
The more instructions can be fetched and executed per second
Modern computers have a clock speed in Gigahertz (GHz)
Meaning billion
A clock speed of 3.5GHz can perform up to 3.5 billion instructions per second
Cache
Very small, very fast memory on or close to the CPU, used as temporary storage to provide quick access to a copy of frequently used instructions and data
The larger the cache size
The more frequently used instructions or data can be stored
Larger cache size
Results in the CPU having to complete fewer fetch cycles from memory (RAM), speeding up the performance
Cache has a significantly faster read/write speed than RAM
Making it much quicker to retrieve instructions from there instead of from memory (RAM)
Core
A core works like it is its own CPU, with its own Control Unit (CU), Arithmetic Logic Unit (ALU), Accumulator (ACC), and Registers
Multiple core processors
Have multiple separate processing units that can fetch, decode and execute instructions at the same time