Basic processing unit
Organisation and basic processing cycle
Execution of complete instruction:
-
Fetch instruction
- fetch instruction pointed to by PC, put it into IR (instruction register)
- increment PC by number of bytes
- decode IR and execute instruction specified in IR
-
Fetch operand
-
Perform operation
-
Store result
Components:
- CPU bus in the middle — means of communication between different components
- connects every pair of components
- bus width is based on the size of the word (bits), e.g. 32 or 64 depending on the ISA
- bus can only transport that many bits max
- every component can read at the same time
- only one component can write at a certain time
- PC (program counter) — counts instructions, notes which is next
- Processor-memory interface — registers
- Y register — internal, cannot be accessed
- MAR (memory address register) — stores location of various data in memory
- MDR (memory data register) — stores values (data) to be stored
- IR (instruction register) — stores the next instruction
- Decoder — changes (decodes) an instruction into signals
- Register file (R0, R1, R2,…)
- package multiple registers together
- add single gates for input and output -> lower energy requirements
- but with this, only one register can read/write the bus at a time.
- so add another bus
¯\_(ツ)_/¯
energy requirement is the limit
- ALU — computes stuff
Register gating:
- controls who can access the bus
- Put gates before each component to control input/output
Register transfer (e.g. R1 to R3 — all happens at once):
- Addr_out = R1
- R_out
- Addr_in=R3
- R_in
Load from memory:
- Ri_out, MAR_in, read
- MDR_inE, WMFC
- MDR_out, Ri_in
Store to memory:
- Ri_out, MAR_in
- Rj_out, MDR_in, write
- MDR_outE, WMFC