the CPU Flashcards
What is the CPU?
The CPU is the central processing unit. It processes all of the data and instructions that make the system work. It is made up of three main parts- the control unit, the arithmetic logic unit and the cache.
What is the control unit and what is its function?(CU)
The control unit is in overall control of the CPU. Its main job is to execute program instructions by following the fetch-decode-execute cycle.
It controls the flow of data inside the CPU to outside the CPU.
What is the arithmetic logic unit and whats is its function?(ALU)
The ALU does all the calculations. It completes simple addition and subtraction, compares the size of numbers and can do multiplications and divisions.
It performs logic operations and binary shifts.
It contains the accumulator register.
What is the Cache and what is its function?
The cache is very fast memory in the CPU. It slower than the registers but faster than RAM.
It stores regularly used data so that the CPU can access it quickly the next time its needed. When the CPU requests data, it checks the cache first to see if the data is there. If not it will fetch it from the RAM.
Do caches have a lower or higher capacity than RAM and secondary storage?
Has very low capacity
Are caches expensive compared to RAM and secondary storage?
They are expensive
What are the different levels of cache memory?
L1, L2 and L3
What are the features of L1?
It is the quickest but has the lowest capacity.
What are the features of L2?
L2 is slower than L1 but can hold more.
What are the features of L3?
L3 is the slowest out of L1 and L2 but can hold the most.
What is a register?
A register is a temporary data store in the CPU. They are super quick to read/write to, quicker than any other form of memory.
What are examples of registers?
Program counter, MAR, MDR and accumulator.
What is the Von Neumann architecture?
It describes a system where the CPU runs programs stored in memory.
What are programs?
Programs consist of instructions and data which are stored in memory addresses.
What is a feature of the Von Neumann architecture?
It only uses one memory for both the data and the instructions.
What is the program counter?
The program counter(PC) holds the memory address of the instruction for each cycle.
What is the accumulator?
The accumulator stores intermediate results of the calculations in the ALU.
What is MAR?
The memory address register(MAR) holds any memory address about to be used by the CPU. The address might point to data or a CPU instruction.
What is MDR?
The memory data register(MDR) holds the actual data or instruction. This may have been fetched from memory or be waiting to be written to memory.
What does the memory hold?
The memory holds the program instructions and the program data.
How does the CPU actually work, what cycle does it follow?
fetch-decode- execute cycle
What does the fetch instruction do?
1) Copy memory address from the program counter
2) Copy the instruction stored in the MAR address to the MDR.
3) Increase the program counter to point to the address of the next instruction, ready for the next cycle.
What does the decode instruction do?
The instrcution in the MDR is decoded by the CU. The CU may then prepare for the next step e.g by loading values into the MAR or MDR.
What does the execute instruction do?
The instruction is performed. This could be:
Load data from memory, write data to memory, do a calculation or logic operatio, change the address or halt the program.