The Purpose of the CPU Flashcards
What is the CPU?
Made up of billions of transistors (on-off switches). The CPU processes data, carries out instructions and control the computer’s components
The Fetch-Decode-Execute cycle
- Fetches instructions from memory
- Decodes these instructions
- Then executes them
Arithmetic Logic Unit (ALU)
Responsible for:
- Arithmetic operations (add, subtract etc)
- Logical operators (AND, OR etc)
Control Unit (CU)
It co-ordinates the activity of the CPU by:
- Fetching and decoding instructions from memory
- Sending signals to control how data moves around the components and memory to execute the instructions
Cache Memory
- Temporary storage that the CPU can access very quickly
- Used to store instructions that are frequently or likely to be used
- Faster than extracting the instructions from the memory
Registers
- Memory locations within the CPU that temporarily hold data
- Can be accessed very quickly
- They accept, store, and transfer data and instructions for immediate CPU use
- The registers are used during the Fetch-Decode-Execute cycle
Von Neumann architecture
- Data and instructions are both stored as binary digits
- Data and instructions are both in primary storage (memory)
- Instructions are fetched from memory one at a time and in order (serially)
- The CPU decodes and executes the instruction before moving onto the next
What are the 4 registers in Von Neumann Architecture?
Program Counter (PC)
Memory Data register (MDR)
Memory Address Register (MAR)
Accumulator (ACC)
Program Counter (PC)
- Keeps track of the memory location of the next instruction
- As each instruction gets fetched, the Program Counter increments by 1
Memory Data Register (MDR)
- Stores any data fetched from memory
- Stores any data that is to be transferred and stored in memory
Memory Address Register (MAR)
- Stores the address of the current instruction that is to be fetched from memory
- The memory address of where the data needs to go
Accumulator (ACC)
- Stores the results of any calculations made by the ALU
- Stores the value of inputs and outputs to and from the CPU
What happens in the FETCH stage?
1 The address of the next instruction is copied
from the PC and placed in the MAR
2 The MAR now holds a memory address. The CU
FETCHES the data at that address and copies it
to MDR
3 The PC is incremented by 1 to point to the next instruction
What happens in the DECODE stage?
4 The MDR now contains the instruction. The CU then DECODES the instruction
What happens in the EXECUTE stage?
5 The decoded instruction is EXECUTED. Maybe the ALU has to do a calculation