CPU
Facts about the CPU:
CPU is the brain of the computer.
processes all the data+instructions that make the system work.
The processing power of the CPU depends on many characteristics.(clock speed, number of cores, cache size)
Three main parts of the CPU:
CU(control unit)
ALU(arithmetic logic unit)
Cache
controls the CPU
Executes the program instructions.
Controls the flow of data.
does calculations.
+, -, /, x
performs logic operations(AND, OR, NOT, BINARY SHIFTS)
contains the accumulator.
Very fast memory in the CPU.
-slower than registers but faster than RAM.
Stores regularly used data so that the CPU can access it quickly the next time it's needed.
Low capacity and is expensive compared to RAM and secondary storage
there are 3 different levels of cache:
-L1(quickest but has the lowest capacity)
-L2(slower than L1 but can hold more)
-L3(slower than L2 but can hold more)
Von Neumann architecture:
The Control unit contains the PC(program counter)-the PC holds the memory address of the instruction for each cycle.
The ALU(arithmetic logic unit) contains the accumulator -the accumulator stores the results of calculations.
2 registers:
MAR(memory address register)-holds the memory address about to be used by the CPU.(the address might point to data or a CPU instruction.)
MDR(memory data register)-holds the data or instruction .(may have been fetched from memory or be waiting to be written to memory)
Memory-holds the program instruction and the program data
Fetch-Decode-execute cycle
Fetch instruction:
1)copy memory address from the PC to MAR.
2)copy the instruction stored in the MAR address to the MDR.
3)increment(increase) the pc.
Decode instruction:
instruction in the MDR is decoded by the CU.
Execute instruction:
the instruction is performed.(could be to do a calculation in the ALU.)
clock speed:
-This is the number of instructions that a processor can do per second.
-the higher the clock speed the more instructions it can do per second.