CENTRAL PROCESSING UNIT
Central Processing Unit (CPU) or the processor is also often called the brain of computer. CPU consists of Arithmetic Logic Unit (ALU) and Control Unit (CU). In addition, CPU
also has a set of registers which are temporary storage areas for holding data, and instructions.ALU performs the arithmetic and logic operations on the data that is made available to it. CU is
responsible for organizing the processing of data and instructions. CU controls and coordinates
the activity of the other units of computer. CPU uses the registers to store the data, instructions
during processing.
CPU executes the stored program instructions, i.e. instructions a
nd data are stored in memory
before execution. For processing, CPU gets data and instructions from the memory. It interprets
the program instructions and performs the arithmetic and logic operations required for the
processing of data. Then, it sends the processed data or result to the memory. CPU also acts as an
administrator and is responsible for supervising operations of other parts of the computer.
The CPU is fabricated as a single Integrated Circuit (IC) chip, and is also known as themicroprocessor. The microprocessor is plugged into the motherboard of the computer
(Motherboard is a circuit board that has electronic circuit etched on it and connects the
microprocessor with the other hardware components).
also has a set of registers which are temporary storage areas for holding data, and instructions.ALU performs the arithmetic and logic operations on the data that is made available to it. CU is
responsible for organizing the processing of data and instructions. CU controls and coordinates
the activity of the other units of computer. CPU uses the registers to store the data, instructions
during processing.
CPU executes the stored program instructions, i.e. instructions a
before execution. For processing, CPU gets data and instructions from the memory. It interprets
the program instructions and performs the arithmetic and logic operations required for the
processing of data. Then, it sends the processed data or result to the memory. CPU also acts as an
administrator and is responsible for supervising operations of other parts of the computer.
The CPU is fabricated as a single Integrated Circuit (IC) chip, and is also known as themicroprocessor. The microprocessor is plugged into the motherboard of the computer
(Motherboard is a circuit board that has electronic circuit etched on it and connects the
microprocessor with the other hardware components).
Arithmetic Logic Unit
- ALU consists of two units—arithmetic unit and logic unit.
- The arithmetic unit performs arithmetic operations on the data that is made available to it.
subtraction, multiplication and division.
- The logic unit of ALU is responsible for performing logic operations. Logic unit performs comparisons of numbers, letters and special characters. Logic operations include testing for greater than, less than or equal to condition.
- ALU performs arithmetic and logic operations, and uses registers to hold the data that is being processed.
Registers
- Registers are high-speed storage areas within the CPU, but have the least storage capacity. Registers are not referenced by their address, but are directly accessed and manipulated by the CPU during instruction execution.
- Registers store data, instructions, addresses and intermediate results of processing. Registers are often referred to as the CPU’s working memory.
- The data and instructions that require processing must be brought in the registers of CPU before they can be processed. For example, if two numbers are to be added, both numbers are brought in the registers, added and the result is also placed in a register.
- Registers are used for different purposes, with each register serving a specific purpose.
memory to be accessed.o Memory Buffer Register (MBR) temporarily stores data from memory or the data
to be sent to memory.o Data Register (DR) stores the operands and any other data.
- The number of registers and the size of each (number of bits) register in a CPU helps to determine the power and the speed of a CPU.
- The overall number of registers can vary from about ten to many hundreds, depending on the type and complexity of the processor.
- The size of register, also called word size, indicates the amount of data with which the computer can work at any given time. The bigger the size, the more quickly it can process data. The size of a register may be 8, 16, 32 or 64 bits. For example, a 32–bit CPU is one in which each register is 32 bits wide and its CPU can manipulate 32 bits of data at a time. Nowadays, PCs have 32–bit or 64–bit registers.
Control Unit
- The control unit of a computer does not do any actual processing of data. It organizes the processing of data and instructions. It acts as a supervisor and, controls and coordinates the activity of the other units of computer.
- CU tells when to fetch the data and instructions, what to do, where to store the results, the sequencing of events during processing etc.
- CU also holds the CPU’s Instruction Set, which is a list of all operations that the CPU can perform.
The conductor in an orchestra does not perform any work by itself but manages the orchestra and
ensures that the members of orchestra work in proper coordination.
MEMORY UNIT
The memory unit consists of cache memory and primary memory. Primary memory or main
memory of the computer is used to store the data and instructions during execution of the
instructions. Random Access Memory (RAM) and Read Only Memory (ROM) are the primary
memory. In addition to the main memory, there is another kind of storage device known as the
secondary memory. Secondary memory is non-volatile and is used for permanent storage of data
and programs. A program or data that has to be executed is brought into the RAM from the
secondary memory.
memory of the computer is used to store the data and instructions during execution of the
instructions. Random Access Memory (RAM) and Read Only Memory (ROM) are the primary
memory. In addition to the main memory, there is another kind of storage device known as the
secondary memory. Secondary memory is non-volatile and is used for permanent storage of data
and programs. A program or data that has to be executed is brought into the RAM from the
secondary memory.
Cache Memory
- The data and instructions that are required during the processing of data are brought from the secondary storage devices and stored in the RAM. For processing, it is required that the data and instructions are accessed from the RAM and stored in the registers. The time taken to move the data between RAM and CPU registers is large. This affects the speed of processing of computer, and results in decreasing the performance of CPU.
- Cache memory is a very high speed memory placed in between RAM and CPU. Cache memory increases the speed of processing.
- Cache memory is a storage buffer that stores the data that is used more often, temporarily, and makes them available to CPU at a fast rate. During processing, CPU first checks cache for the required data. If data is not found in cache, then it looks in the RAM for data.
- To access the cache memory, CPU does not have to use the motherboard’s system bus for data transfer. (The data transfer speed slows to the motherboard’s capability, when data is passed through system bus. CPU can process data at a much faster rate by avoiding the system bus.)
![]() |
Illustration of cache memeory |
- Cache memory is built into the processor, and may also be located next to it on a separate chip between the CPU and RAM. Cache built into the CPU is faster than separate cache, running at the speed of the microprocessor itself. However, separate cache is roughly twice as fast as RAM.
- The CPU has a built-in Level 1 (L1) cache and Level2 (L2) cache. In addition to the built-in L1 and L2 cache, some CPUs have a separate cache chip on the motherboard. This cache on the motherboard is called Level 3 (L3) cache. Nowadays, high-end processor comes with built-in L3 cache, like in Intel core i7. The L1, L2 and L3 cache store the most recently run instructions, the next ones and the possible ones, respectively. Typically, CPUs have cache size varying from 256KB (L1), 6 MB (L2), to 12MB (L3) cache.
- Cache memory is very expensive, so it is smaller in size. Generally, computers have cache memory of sizes 256 KB to 2 MB.
- Primary memory is the main memory of computer. It is used to store data and instructions during the processing of data. Primary memory is semiconductor memory.
- Primary memory is of two kinds—Random Access Memory (RAM) and Read Only Memory (ROM).
- RAM is volatile. It stores data when the computer is on. The information stored in RAM gets erased when the computer is turned off. RAM provides temporary storage for data and instructions.
- ROM is non-volatile memory, but is a read only memory. The storage in ROM is permanent in nature, and is used for storing standard processing programs that permanently reside in the computer. ROM comes programmed by the manufacturer.
- RAM stores data and instructions during the execution of instructions. The data and instructions that require processing are brought into the RAM from the storage devices like hard disk. CPU accesses the data and the instructions from RAM, as it can access it at a fast speed than the storage devices connected to the input and output unit .
- The input data that is entered using the input unit is stored in RAM, to be made available during the processing of data. Similarly, the output data generated after processing is stored in RAM before being sent to the output device. Any intermediate results generated during the processing of program are stored in RAM.
![]() |
Interaction of CPU with memory |
Secondary Memory
- The secondary memory stores data and instructions permanently. The information can be stored in secondary memory for a long time (years), and is generally permanent in nature unless erased by the user. It is a non-volatile memory.
- It provides back-up storage for data and instructions. Hard disk drive, floppy drive and optical disk drives are some examples of storage devices.
- The data and instructions that are currently not being used by CPU, but may be required later for processing, are stored in secondary memory.
- Secondary memory has a high storage capacity than the primary memory.
- Secondary memory is also cheaper than the primary memory.
- It takes longer time to access the data and instructions stored in secondary memory than in primary memory.
devices.
INSTRUCTION FORMAT
A computer program is a set of instructions that describe the steps to be performed for carryingout a computational task. The program and the data, on which the program operates, are stored in
main memory, waiting to be processed by the processor. This is also called the stored program
concept.
An instruction is designed to perform a task and is an elementary operation that the processor can
accomplish. An instruction is divided into groups called fields. The common fields of an
instruction are— Operation (op) code and Operand code . The remainder of the
instruction fields differs from one computer type to other. The operation code represents action
that the processor must execute. It tells the processor what basic operations to perform. Theoperand code defines the parameters of the action and depends on the operation. It specifies the
locations of the data or the operand on which the operation is to be performed. It can be data or a
memory address.
The number of bits in an instruction varies according to the type of data (could be between 8 and
32 bits). shows the instruction format for ADD command.
INSTRUCTION SET
A processor has a set of instructions that it understands, called as instruction set. An instructionset or an instruction set architecture is a part of the computer architecture. It relates to
programming, instructions, registers, addressing modes, memory architecture, etc. An Instruction
Set is the set of all the basic operations that a processor can accomplish. The instructions in the instruction set are the language that a processor understands. All programs have to communicate with the processor using these instructions. An instruction in the instruction set involves a series of logical operations (may be thousands) that are performed to complete each task. The instruction set is embedded in the processor (hardwired), which determines the machine language for the processor. All programs written in a high-level language are compiled and translated into machine code before execution, which is understood by the processor for which the program has been coded.
Two processors are different if they have different instruction sets. A program run on one
computer may not run on another computer having a different processor. Two processors are
compatible if the same machine level program can run on both the processors. Therefore, thesystem software is developed within the processor’s instruction set.Microarchitecture is the processor design technique used for implementing the Instruction Set.
Computers having different microarchitecture can have a common Instruction Set. Pentium and
Athlon CPU chips implement the x86 instruction set, but have different internal designs.2.6 INSTRUCTION CYCLEThe primary responsibility of a computer processor is to execute a sequential set of instructions
that constitute a program. CPU executes each instruction in a series of steps, called instruction
cycle .
- A instruction cycle involves four steps —
instruction is placed in the Instruction Register. Program Counter holds the
address of next instruction to be fetched and is incremented after each fetch.o Decoding The instruction that is fetched is broken down into parts or decoded.
The instruction is translated into commands so that they correspond to those in theCPU’s instruction set. The instruction set architecture of the CPU defines the wayin which an instruction is decoded.o Executing The decoded instruction or the command is executed. CPU performs
the operation implied by the program instruction. For example, if it is an ADD
instruction, addition is performed.o Storing CPU writes back the results of execution, to the computer’s memory.
Figure 2.8 Instruction cycleFigure 2.9 Steps in instruction cycle
- Instructions are of different categories. Some categories of instructions are—
A CPU performance is measured by the number of instructions it executes in a second, i.e., MIPS(million instructions per second), or BIPS (billion instructions per second)
No comments:
Post a Comment