Please enable JavaScript.
Coggle requires JavaScript to display documents.
SLR1 - Coggle Diagram
SLR1
What are the components of a CPU and what do they do?
-
CU - Contol Unit
-
-
Accepts the next instruction, decodes it, handles its execution, and stores the resulting data back in memory or registers
Sends memory read and write requests to main memory on the control bus, as well as other command and control signals such as bus requests, bus grants, interrupt requests etc
-
-
PC - Program Counter
-
Has a very close relationship with the memory address register. At the start of every new fetch-decode-execute cycle, the address held in the PC is copied to the MAR
-
-
-
Accumulator
-
-
A CPU may have many general purpose registers for storing temporary data while instructions or calculations are being carried out.
typically , the more general purpose registers a processor has the faster it may operate
-
Busses
Address bus - unidirectional flows from the memory address register to main memory carries memory addresses that identify where the data is being read from or written to.
Data Bus - carries binary 1s and 0s that make up the actual information being transmitted around the CPU/computer
Control bus - carries command and control signals to and from every other component of the CPU/computer
How does a CPU work?
Fetch Stage
The program counter is checked, as it holds the address of the next instruction to be executed The address stored is then copied into the memory address register
The address is then sent along the address bus to main memory, where it waits to receive a signal from the control bus
If we want to read the data, the control unit sends a read signal along the control bus to main memory
The contents stored at that address in main memory can now be sent along the data bus to the memory data register
In the process of fetching an instruction the data received by the memory data register from memory now gets copied into the current instruction register
-
Before we proceed to the decode phase we must increment the contents of the program counter so the address it contains points to the next instruction to be executed
Decode Stage
-
-
-
By decoding this instruction, we can see that the operation we need is a load operation
-
In the exam, a simple model will be used to describe the structure of an instruction
You will not be expected to define how an opcode is made up but simply to interpret opcodes in the given context of an exam question.
-
Execute stage
-
-
As we want to read the data that is stored in memory address 0101, the control unit then sends a read signal along the control bus to main memory
The contents stored in memory at address 0101 can now be sent along the data bus to the memory data register
-
-
Program Branching
An if statement can cause a program to branch in more than one direction if a certain criteria is/is not met
In the current instruction register we have an instruction with the opcode 0110 which means branch always
This replaces the value held in the program counter with the contents of the operand from the current instruction register 1001
-
-
-
-