when a program is run executable binary file is copied from the disk drive into memory
the process of program execution is the retrieval of data & instructions from memory, and the execution of various operations
program execution stops only when the computer is switched off while machine is on, the cycle is continuous! (an infinite loop)
program execution is performed by Control Unit (CU) of the CPU the task of the CU is the instruction cycle (sometimes called the fetch-decode-execute cycle)
the instruction cycle consists of the tasks: the fetch cycle, the indirect cycle, the execute cycle, and the interrupt cycle
the sequence of actions of the instruction cycle:
the list of things needed to specify the function of a CPU are:
Operations (op codes)
Registers (general purpose: R0, R1, .... and special registers: PC, MAR, MBR, ...)
IO Interfacing (how to "talk" to other devices)
Memory Interfacing (how to send/receive information from memory)
Interrupt Processing (what to do during an interrupt request)
Instruction Format
there are several ways to represent an instruction & its operand(s) (inputs the the operation, and sometimes outputs where to store the results)
immediate: an op code & the actual literal value (very limited)
direct: an op code & the address in memory (or a register) where the actual data is located (limited, can't address all of memory)
indirect and other variants: an op code & an address in memory where (how) to get the address of the actual data (can access all memory)
eg: in a 16bit memory (each cell is a two bytes - a word) the instruction format may be:
bit 0 - bit 3: the op code number, there are 16 possible op codes
bit 4 - bit 15: the address for the op code - there are 4096 memory cells can be addressed (indirect addressing is used to get to the rest of memory...)
Micro-Operations
micro operations the lowest level atomic operations that a computer performs