Advanced CPU Design Flashcards
What is a subroutine?
A self-contained piece of code which can be called from the main program
What is the best way to store the return address during a subroutine?
In a stack
What is the main problem with using stacks?
Stack-overflow
How do we help minimise stack-overflow?
Dedicate memory for any elements that overflow
What does the stack pointer register do?
Stores the address of the most recent data element added to the stack
What is an interrupt in programming?
A signal to jump to another piece of code outside the main program
What are the two CPU access modes?
Privileged mode
Restricted mode
What is privileged mode used for?
Used by the kernel and gives it access to memory, real addresses, OS code execution, the stack, and IRQ timer
What is restricted mode used for?
Used by user programs and uses pre-processed virtual addresses
What swaps from privileged mode to restricted mode?
The IRQ timer callback
What is an instruction set?
A complete set of instructions that are understood by a given CPU
What do instruction sets depend on?
Data types, instruction types, addressing modes, and instruction format
What is the FPU?
Floating point unit
Why do we use the FPU?
Floating point operations use so many resources that it is more efficient to have a dedicated unit. However, the FPU is usually built-into the CPU
What is pipe lining?
The CPU breaks instructions down into multiple steps and stores them, this allows the CPU to perform multiple operations simultaneously