Basic microprocessors
Outside World ←→I/O←→CPU ←Data memory and program memory
Microprocessor:
- programmable device
- accepts digital input data
- processes the data accordingly to instructions stored in memory
- provides the result as output
- operates on symbols represented in binary numerical system
Main elements
- arithmetic logic unit ALU
- status register
- instruction register
- stack pointer
- program counter
- instruction decoder
- registers
Registers
Each CPU consists of a certain amount of universal registers. They are usually used as a temporary storage for data. In some CPU memory is used instead. Access to the registers and internal memory is much faster than access to the external memory. In some microprocessors there are not many of them.
Program flow
- Normally it is sequential
- CPU executes instructions of consequential program-memory addresses
- with branches we can jump in memory for a short distance
- discontinuities are caused by branching, function calls, interrupts
- with jump we can wherever we want to