1.1.1 Structure and Function of the Processor Flashcards
What does the ALU do?
Performs all maths and logic operations
What does the CU do?
The control unit:
1. Sends signals to coordinate movement of data through the processor during the FDE cycle
2. Controls the buses
3. Decodes instructions
What are registers?
Temporary storage inside the CPU used for a specific purpose. Faster to access than RAM.
What are the registers in the CPU called?
ACC, PC, CIR, MAR, MDR
What does the ACC do?
The accumulator:
1. Acts as temporary storage for data being processed during calculations
2. Acts as a buffer for input and output operations in the processor
3. Is checked for conditional branching operations
What does the MAR do?
Stores the address of the next instruction or data to be accessed in memory
What does the MDR do?
Stores data and instructions which have been accessed from memory
What does the CIR do?
Holds data to be decoded into opcode and operand
What does the PC do?
Stores the address of the next instruction to be processed
What are the three buses?
Control bus, data bus, address bus
What does the control bus do?
Transmits control signals between the CU and other parts of the system
What does the data bus do?
Carries data between different system components
What does the address bus do?
Carries a memory address from the CU to memory
Six examples of control signals
(data) bus request, (data) bus grant, memory write, memory read, interrupt request, clock
What happens in the Fetch step of the FDE cycle
- Value in the PC is copied to the MAR
- Address in the MAR is sent down the address bus at the same time as a memory read signal is sent down the control bus
- The value in stored in the location specified by the address bus is sent to the MDR on the address bus
- The value in the MDR is copied to the CIR
- The value in the PC is incremented by one
What happens during the decode step of the FDE cycle?
The instruction in the CIR is split into opcode and operand.
What happens during the execute step of the FDE cycle?
The instruction specified by the opcode is carried out, possibly using the ALU.
Results are stored in the ACC if necessary.
The value of the PC will change if it is a branching instruction.
What is a word length?
The largest group of digits that can be considered at a single time by the processor.
What is an opcode?
The first part of a machine code instruction, specifies the instruction to carry out.
What is an operand?
The second part of a machine code instruction, specifies the data the instruction will be carried out on.
What are the three LMC branching instructions?
BRA, BRZ, BRP
What does the LMC SUB instruction do?
Performs subtraction using the ALU
Stores the result in the ACC
What does the LMC ADD instruction do?
Performs addition using the ALU
Stores the result in the ACC
What does the LMC STA instruction do
Stores the value in the ACC at a specified memory address
What does the LMC LDA instruction do?
Loads a specified value into the ACC
What does the LMC INP instruction do?
Waits for input
What does the LMC Output instruction do?
Outputs a value
What does the LMC HLT instruction do?
Ends the program
What does the LMC DAT instruction do?
Reserves a memory location for data
What does the LMC BRA instruction do
Branches to the specified location, always
What does the LMC BRZ instruction do?
Branches to the specified location if the value in the ACC is zero.
What does the LMC BRP instruction do?
Branches to the specified location if the value in the ACC is zero or positive.
What are the three factors effecting the speed of the CPU?
Cache size and level, number of cores, clock speed
How does cache effect the speed of the CPU?
Time taken to access instructions in RAM is often a limiting factor in the FDE cycle
Cache is faster to access than RAM because it is closer to the CU
A larger cache means more instructions can be stored and RAM needs to be accessed less frequently
Lower levels of cache are faster to access than higher levels of cache
How does the number of cores effect the speed of the CPU?
The higher the number of cores the more independent FDE cycles can be completed per second, if the software allows for multi-core processing
How does clock speed effect the speed of the CPU?
Higher clock speed means more cycles per second, which means more instructions can be executed per second, so the program takes less time to run.
Clock speed can be increased with overclocking.
Explain pipelining
CPU piplining
An instruction can be fetched as the previous one is being decoded and the one before that is being executed, causing the program to run faster because all parts of the CPU can be used at once.
In the case of a branch the pipeline is flushed.
What are two computer architectures called?
Harvard, Von-Neumann
What are the differences between Harvard and Von-Neumann architecture?
- Harvard has separate memory for instructions and data, VN has shared memory.
- Harvard has separate buses for instructions and data, VN has shared buses.
- In Harvard the size of instruction and data memory is fixed. In VN the amount of the shared memory allocated to instructions or data can change.
- In Harvard the instruction memory may be read only. In VN the instructions and data are stored in the same format.
How is modern computer architecture different from traditional Von-Neumann architecture?
Pipelining, cache, multiple cores, overclocking, seperate instruction and data cache
Which LMC instructions will change the value in the ACC?
ADD, SUB, LDA, INP
Which LMC instructions will change the value in the PC?
BRA, BRZ, BRP