What is CPU (Central Processing Unit) Architecture
CPU or Central Processing unit can be called the brain of the computer system because the entire processing of data is done here. It is made up of more than one microprocessors which consist of two main parts - Arithmetic and Logical Unit (ALU) and Control Unit(CU).
Arithmetic and Logical Unit
The ALU performs all kinds of calculations, such as arithmetic fadd, subtract, multiply, divide, etc.), comparison (less than, greater than, or equal to), and other operations. The intermediate results of processing may be stored in the main memory, as they might be required again. When the processing completes, the final result is then transferred to the main memory. Hence, the data may move from main memory to the ALU multiple times before the processing is over.
Control Unit
The main function of the CU is to direct and coordinate the computer operations. It interprets the instructions (program) and initiates action to execute them. The CU controls the flow of data through the computer system and directs the ALU, input/output (I/O) devices, and other units. It is, therefore, called the central nervous system of the computer system. In addition, the CU is responsible for fetching, decoding, executing instructions, and storing results.
Registers
A processor register is a computer memory that provides quick access to the data currently being used for processing. The ALU stores all temporary results and the final result in the processor registers. As mentioned earlier, registers are at the top of memory hierarchy and are always preferred to speed up program execution.
Registers are also used to store the instructions of the program currently being executed. There are different types of registers, each with a specific storage function.
Accumulator and general-purpose registers.
These are frequently used to store the data brought from the main memory and the intermediate results during program execution. The number of general purpose registers present varies from processor to processor. When program execution is complete, the result of processing is transferred from the accumulator to the memory through the memory buffer register (MBR).
Special-purpose registers
These include the following:
- The memory address register (MAR) stores the address of the data or instruction to be fetched from the main memory .
- The value stored in the MAR is copied from the program counter.
- The MBR stores the data or instruction fetched from the main fetched from the memory, then the contents of the MBR are copied into the instruction register(IR),. If a data is fetched from the memory, the contents are either transferred to the accumulator or to the I/O register. The MBR is also used while writing contents in the main memory. In this case, the processor first transfer the contents to the MBR, which then writes them into the memory.
- The IR stores the instructions currently being executed. In general, an instruction consists of two parts operation and address of the data on which the operation has to be performed. When the IR is loaded with an instruction, the address of the data is transferred to the MAR and the operation part is given to the CU which interprets it and executes it.
- The U/O register is used to transfer data or instructions to or from an I/O device. An input device transfers data to the I/O register for processing. Correspondingly, any data to be sent to the output device is written in this register.
- The program counter stores the address of the next instruction to be executed.
The size of a register is usually specified by the number of bits it can store. For example, a register can be of 8 bits, 16 bits, 32 bits, or 64 bits. Higher the register size, more the data that can be stored in it
Instruction cycle To execute an instruction, a processor normally follows a set of basic operations that are together known as an instruction cycle (Figure 1.17). The operations performed in an instruction cycle involve the following:
Fetch Retrieving an instruction or a data from memory.
Decode Interpreting the instruction.
Execute Running the corresponding commands to process the data.
Store Writing the results of processing into memory.
Bus Interface Unit
The BIU provides functions for transferring data between the execution unit of the CPU and other components of the computer system that lie outside the CPU. Every computer system has three different types of busses to carry information from one part to the other. These are the data bus, control bus, and address bus.
The BIU puts the contents of the program counter on the address bus. Note that the content of the program when a program is exe counter is the address of the next instruction to be executed. Once the memory receives an address from the BIU, it places the contents at that address on the data bus, which is then transferred to the IR of the processor through the MBR. At this time, the contents of the program counter are modified (e.g., incremented by 1) so that it now stores the address of the next instruction.
Comments
Post a Comment