2.1 Functions of microprocessor
Various functions of m icroprocessor are as follows:
- Microprocessor performs a variety of logical and mathematical operations using its ALU.
- It controls data flow in a system and hence can transfer data from one location to another based on the instructions given to it.
- A microprocessor can take necessary decisions and jump to a new set of instructions based on those decisions.
2.2 Elements of microprocessor
A simple microprocessor consists of following basic elements (see Figure 3.1.3):
- Data Bus: Through data bus, the data flow between
- various storage units
- ALU and memory units
- Address Bus: It controls the flow of memory addresses between ALU and memory unit.
- RD (read) and WR (write) lines set or obtain the addressed locations in the memory.
- Clock line transfers the clock pulse sequence to the processor.
- Reset Line is used to restart execution and reset the processor to zero.
- Address Latch is a register which stores the addresses in the memory.
- Program Counter: It is a register which can increment its value by 1 and keeps the record of number of instructions executed. It can be set to zero when instructed.
- Test Register: It is a register which stores intermediate or in-process data of ALU operations. For example it is required to hold the ‘carry' while ALU is performing ‘addition' operation. It also stores the data which can be accessed by Instruction decoder to make any decision.
- 3-State Buffers: These are tri-state buffers. A tri-state buffer can go to a third state in addition to the states of 1 and 0.
- The instruction register and instruction decoder are responsible for controlling the operations of all other components of a microprocessor.
There are following control lines present in a microprocessor, which are used to communicate instructions and data with the instruction decoder.
- Instruct the A register to latch the value currently on the data bus.
- Instruct the B register to latch the value currently on the data bus.
- Instruct the C register to latch the value currently output by the ALU.
- Instruct the program counter register to latch the value currently on the data bus.
- Instruct the address register to latch the value currently on the data bus.
- Instruct the instruction register to latch the value currently on the data bus.
- Instruct the program counter to increment.
- Instruct the program counter to reset to zero.
- Activate any of the six tri-state buffers (six separate lines).
- Instruct the ALU what operation to perform.
- Instruct the test register to latch the ALU's test bits.
- Activate the RD line.
- Activate the WR line.