The Processor Flashcards
Define the stored program concept:
The idea that data and instructions for a program are stored together in memory
The control unit:
Supervises the FDE cycle, makes sure data is routed correctly
The ALU:
The arithmetic logic unit - carries out mathematical functions and logical operations, it gets sent an op-code and an operand and performs what is requested by the op-code on the operand (and the contents of the accumulator if necessary)
The clock:
Generates a signal to synchronise the processor and the movement of data, measured in MHz or GHz, typical clock speed today is 2-3GHz, typical clock speed in 1990 was 4-5MHz
The registers:
Limited storage capacity but holds all the results of calculations and all the necessary data and instructions for programs
Specific registers:
Status register - looks at statuses of various components like if an overflow error has occurred
Interrupt register - stores details of signals from other components sent to the processor, like the I/O controller
CIR - current instruction register, stores the instruction currently being executed
PC - program counter, stores the memory address of the next instruction
MBR/MDR - memory buffer/data register, holds the data about to be written or that has just been read to main memory
MAR - stores the memory location about to be written to/just been read from
FDE cycle:
Fetch:
[MAR]
Factors affecting processor speed:
Clock speed - how many instructions are executed per second
Bus width - a short data bus width means several trips will be needed for each instruction, so less data can be moved per second, and a short address bus width means less memory available
Word length - how much data can be handled in one clock pulse
Number of cores: more cores means it can do more FDE cycles at once
Cache size - frequent instructions/data are saved in cache cause it’s fast, so the more space available, the quicker common instructions can be executed
Interrupts basics:
Used if an error occurs or something wants the processor to do something for it, it’s a signal sent to the processor by an external component, examples are the user clicked/moved the mouse, something broke, etc
How do interrupts work:
Before the next instruction is fetched, the processor checks for interrupts - if there are any, the processor will stop and use the ISR (interrupt service routine) which calls the required routine to handle the interrupt - the data being stored about the previous program is placed at the top of the system stack to be retrieved after the interrupt is dealt with
Priority:
When a interrupt is interrupted by another interrupt, the priority of each is checked and the higher one is handled first. If the priority is the same, the first interrupt is handled first
Vectored interrupt mechanism:
A method of handling interrupts by pointing to the address of the first instruction needed to handle it - every interrupt has an associated memory address called a vector that points to the start instruction for handling it, from where it runs the ISR (interrupt service routine)