1.1.1 structure and function of the CPU Flashcards
What does the ALU do?
Completes all arithmetic and logical operations
ADD/SUB etc..
AND, OR, NOT…
Purpose of the CU?
Directs the operations of the CPU
* Controls and coordinated CPU activities
* Manages flow of data between CPU and other devices
* Accepts the next instruction
* Decodes instructions
* Stores resulting data back in memory
What is the purpose of the PC
register
Holds address of the next instruction to be executed
Purpose of the ACC
Stores results of calculations (performed by the ALU)
Purpose of the MAR
Holds the address of a location that data is to be read from or written to
Purpose of the MDR
Temporarily stores data that has been read or needs to be written
Purpose of the CIR
Holds the current instruction being executed, divided up into operand and opcode
What is the data bus?
Bi-directional bus used for transporting data and instructions between components
What is the address bus?
Transmits the memory addresses specifying where data is to be sent to or retrieved from
What is the control bus?
Bi-directional bus used to transmit control signals between internal and external components
* Bus requests
* Bus grant
* Memory write
* Memory read
* Interrupt request
What are opcode and operand?
-Opcode: Specifies the type of instruction to be executed
-Operand: Address of the data upon which the operation is to be performed
What is pipelining?
-Completing the FDE cycles of 3 instructions simultaneously
-Reduces the amount of the CPU kept idle
-Can be arithmetic or instruction
What does the fetch stage of the FDE do
- PC is loaded with 0
- Value from the PC is copied to the MAR
- Data from the MAR is sent across the address bus with the instruction to read the data send across the control bus
- Data from that location in memory is sent down the data bus to the MDR
- PC incremented by 1
What happens in the decode stage?
- The data is sent from the MDR to the CIR where it is split into opcode and operand
- This is sent to the CU to be decoded
What happens in the execute stage?
Depends on the instruction being executed:
* If a value is inputted the ACC stores the value
* If outputted, it is the value currently in the ACC
* If a value is loaded from RAM it is sent across the data bus to the MDR
* If it is to be stored it will take the value ftom the ACC, send it to the MDR then across the data bus to RAM
* If branching the comparison will take place in the ALU
Factors affecting CPU performance
- Clock speed- time taken for one clock cycle to complete, Hz
- Number of cores- Independent processor able to do its own FDE cycle. More cores = more FDE cycles at a given time (not all programs able to utilise multiple cores)
- Cache- memory in the CPU’s onboard memory. Accessed faster than main memory.
Level 1 cache- very fast, small capacity (2-64KB)
Level 2 cache- Relatively fast, medium capacity (256KB-2MB)
Level 3- Much larger and slower
Von Neumann architecture
-Single CU, ALU, registers and memory units
-Shared memory and shared data bus used for both data and instructions
*Cheap to develop as CU easier to design
*Programs can be optimised in size
Hardvard architecture
Seperate memory spaces for data and instructions. Commonly used with embedded processors
*Quicker execution as data and instructions can be fetched in parallel
*Memories can be different sizes