1.1.1 architecture of the CPU Flashcards
the purpose of the CPU
the purpoe of a CPU is to process data (central processing unit). it does this using the fetch-execute cycle
fetch
the PC hold the address for the instruction
it is copied into the MAR
the MAR carries the address through the address bus (unidirectional) and looks for it in the main memory
the contents of that address are taken to the MDR via he data bus (bidirectional)
the PC increments by one
decode
the data from MDR is stored on cache
the data is taken from the MDR or cache and sent to the CU to decode it
execute
after the CU figures out what it needs to do with the data, it carries out the instruction
at this point the fetch decode execute cycle is completed
FDE
fetch - fetches the instruction from main memory and brings it back to the CPU
decode - inspects the instruction and tries to work out what it needs to be doing
execute - carries out the instruction. this can mean:
going back to main memory to get more data
performing a calculation
soring info back into main memory
this cycle happens billions of times per second which is why our computers get hot
what is a compter?
A computer is an electronic device that takes input, processes data and outputs a result. It may also communicate and store processed data.
the CPU and its four components
arithmetic logic unit (ALU) - this carries out arithmetic calculations and is responsible for making logical decisions
cache - small, very fast memory. typically located very close to the CPU. stores frequently used instructions and data. its quicker for the CPU to access data from cache than from RAM as its closer t the CPU. cache cannot be increades but RAM can. The CPU first checks if the data that’s required is in cache. If it’s not in cache, then it goes all the way to main memory which will take a bit lopnger
cotrol unit (CU) - sends signals to control data flow around the CPU
registers - small, temporary very fast memory with a specific purpose. located inside the CPU
Registers
accumulator - holds the results of calsulaions
memory address register (MAR) - holds the address of where data needs to be fetched from
memory data register (MDR) - holds data fetched from or to be writeen to main memory
program counter (PC) - holds the address of he ext instruction (incraments by one)
von neumann architecture
key characterisics: central processing unit (CPU) cache inputs and outputs interna clock
this architecture compter fetches, decodes and exectes instructions
von neumann allows data and programs to be stored in the same memory space in a binary format