Home »
Computer Science Organization
Central Processing Unit (CPU)
In this article, we will learn about the central processing unit with its subunits and registers.
By Shivangi Jain Last updated : April 16, 2024
What is Central Processing Unit (CPU)?
The CPU is the brain of the computer system. It works as an administrator of a system. All the operations within the system are supervised and controlled by the CPU. It interprets and coordinates the instructions. The data and the instructions are temporarily stored in its memory unit. After performing operations, the result of operations can be stored in this memory unit.
The results of the operations are sent towards the output unit for the user. Thus, the CPU controls all internal and external devices, perform arithmetic and logical operations, controls memory usage and control the sequence of operations.
Central Processing Unit Components
For performing all these operations, the CPU has three subunits:
- Arithmetic and logic unit (ALU)
- Control unit
- Memory unit (CPU registers)
1. Arithmetic and Logic Unit (ALU)
- Arithmetic and logic unit is the subunit of the central processing unit as it is given above.
- It performs arithmetic operations like addition, subtraction, and logic operations like OR, AND, invert, exclusive – OR on binary words. The data stored in the memory unit is transferred to ALU. The ALU performs the operations that are the data is processed and the result is stored in an internal memory unit of the CPU. The result of a final operation is transferred from the memory unit to an output unit.
- Arithmetic and logic operations performed by ALU sets flags to represent certain conditions such as equal to condition, zero condition, greater than the condition and so on. These conditions are checked by program instructions to change the sequence of program executions.
2. Control Unit
- The control unit controls all the operations which internally take place within the CPU and also the operations of CPU related to input / output devices. The control unit directs the overall functioning of a computer system.
- This unit also checks the correctness of sequence of operations. It fetches instructions in a program from the primary storage unit, interprets them and generates control signals to ensure correct execution of the program. The control signals generated by the control unit direct the overall functioning of the other units of the computer.
3. CPU Registers
- A register is a group of flip-flops which can be used to store a word. It is a high-speed temporary storage space for holding data, addresses, and instructions during processing the instructions. Registers are not referenced by their addresses, however, they are directly accessed.
- To perform execution of the instructions, the processor contains a number of registers used for temporary storage of data and some special function registers.
- The special function registers include Program Counter (PC), Instruction Register (IR), Memory Address Register (MAR), and Memory Data Register (MDR).
Program Counter (PC) in Central Processing Unit
- A program is a series of instruction stored in the memory. These instructions tell the CPU exactly how to get the desired result.
- It is important that these instructions must be executed in a proper order to get the correct result.
- The sequence of instructions executions is monitored by the program counter.
- It keeps track of which instruction is being executed and what the next instruction will be.
Instruction Register (IR) in Central Processing Unit
- It is used to hold the instruction that is currently being executed.
- The contents of IR are available to the control unit, which generate the timing signals that control the various processing elements involved in executing the instruction.
Memory Address Register (MAR) and Memory Data Register (MDR)
- These registers are used to handle the data transfer between the main memory and the processor.
- The MAR holds the address of the main memory to or from which the data is to be transferred.
- The MDR sometimes also called MBR (Memory Buffer Register) contains the data to be written into or read from the addressed word of the main memory.
References