Central Processing Unit

 

THE CENTRAL PROCESSING UNIT (CPU):

The CPU is the brain of a computer system. All major calculations and comparisons performed by a computer are carried out inside its CPU. The CPU is also responsible for activating and controlling the operation of other units of the computer system.

 

The Control Unit: The control unit of the CPU selects and interprets program instructions, and then sees that they are executed. It has some special purpose registers and decoder to perform these activities. The special purpose registers, namely the instruction registers and the program control registers respectively hold the current instruction and the next instruction executed, and in this way the help the control unit in instruction selection. On the other hand the decoder has necessary circuitry to decode and interpret the meaning of every instruction supported by the CPU. Each instruction is accompanied by the microcode – very basic direction, which tells the CPU how to execute the instruction.

 

Although the control nit does not perform any actual processing of the data, it acts as a central nervous system for the other components of the computer. It manages and coordinates the entire computer system, including the input and output units. It obtains the instructions from the program stored in the main memory, interprets the instructions and issues the signals, which causes other units of the system to execute the,          `

 

 

Processor and Memory Architecture of a computer system

 
 



The Arithmetic Logic Unit (ALU) :

The ALU of the CPU is the place, where the actual execution of the instruction takes place, during the data processing operation. That is, when the control unit encounters an instruction, which involves an arithmetic operation (add, subtract, multiply and divide) or logical operation (such as less than, equal to. grater than), it passes control to the ALU. The ALU has some special purpose register to carry out all the arithmetic and logic operations, which are included in the instruction supported by the CPU. For example, control unit might load two numbers into the registers in the ALU. Then it might tell the ALU to add the two numbers (an arithmetic operation) or to check if the two numbers are equal (a logical operation).

 

 

In case of a microcomputer, the entire CPU (both the control unit and the ALU) is contained on a single tiny silicon chip, called a microprocessor.

 

Instruction Set: Every CPU has built in ability to execute a set of machine instructions called its instruction set. Most CPUs have 200 or more instructions (such as add, subtract, and compare) in their instruction set. The machine language designed for a processor (CPU), is based on the list of instructions supported by the CPU in its instruction set.

 

CPUs made by different manufacturers have different instruction sets. In fact, different models of the same manufacturer also have different instruction sets. Manufacturers tend to group their CPUs into “families” which have similar instruction sets. When a new CPU is developed, it is ensured that its instruction set includes all the instructions in the instruction set of its predecessor CPU, plus the some new ones.

 

Registers

As the instructions are interpreted and executed by the CPU, there is movement of information between the various units of the computer system. In order to handle this process satisfactorily, and to speed up the rate of information transfer, the computer uses a number of special memory units, called registers. These registers are used to hold information on a temporary basis, and are part of the CPU (not main memory).

 

The length of a register equals the number of bits it can store. Hence a register that can store 8 bits is normally referred as an 8-bit register. Most CPUs sold today have 32-bit or 64-bit registers. The size of the register is sometimes called the word size. Bigger the word size, the faster the computer can process a set of data. With other parameters being the same, a CPU with 32-bit registers, can process data twice as fast as one with 16-bit registers.

 

Although, the number of registers varies from computer t o computer there are some registers, which are common to all computers the functions of these register are as follows:

 

 

Sr. No

Name of the Register

Function

1

Memory Address (MAR)

Holds the address of the active memory location

2

Memory Buffer (MBR)

Holds information on its way to and from memory

3

Program Control (PC)

Holds the address of the next instruction to be executed

4

Accumulator (A)

Accumulates results and data to be operated upon

5

Instruction (I)

Holds an instruction, while it is being executed

6

Input / Output (I/O)

Communicates with the I/O devices

 

 

 

The execution of an instruction by the CPU during program execution normally involves the following steps:

 

  1. The Control unit takes the address of the next program instruction to be executed from the program control register, and reads the instructions from the corresponding memory address, into the instruction register of the control unit.
  2. The control unit then sends the operation part and the address part of the instruction, to the decoder and the memory address register, respectively.
  3. The decoder interprets the instruction, and accordingly the control unit sends signals to the appropriate unit, which needs to be involved in carrying out the task specified in the instruction. For example, if it is an arithmetic or logic operation, the signal is sent to the ALU. In this case, the control unit also ensures that the data corresponding to the address part of the instruction is loaded in a suitable register in the ALU, before the signal is sent to the ALU. The ALU performs the necessary operation on the data, and signals the control unit as soon as it has finished.
  4. As each instruction is executed, the address of the next instruction to be executed is automatically loaded into the program control register, and Steps 1 to 4 are repeated.

 

 

THE MAIN MEMORY

We saw that the CPU contains the necessary circuitry for data processing and controlling the other components of a computer system. However it does have built in place to store programs and data, which are needed during data processing. CPU does contain several registers for storing data and instructions, but these are very small areas, which can hold only a few bytes at a time, and are just sufficient to hold only one or two instructions and the corresponding data. If the instruction and data of a program being executed by the CPU, were to reside in secondary storage like a disk, and fetched and loaded one by one into the registers of CPU as the program execution proceeded, this would lead to the CPU being idle most of the time, because there is large speed mismatch between the rate at which CPU can process the data and a rate at which data can be transferred from disk to CPU registers. This will lead to slow overall performance, even if the computer system used a very fast CPU. To overcome this problem, there is a need to have a reasonably large storage space, which can hold the instruction and data of the program(s), on which the CPU is currently working. The time to fetch and load data from this storage space into the CPU registers must also be very small as compared to that of disk storage, to reduce the speed mismatch problem with the CPU speed. Every computer has such a storage space, which is known as primary storage, main memory. It is a temporary storage area, which is built into computer hardware, and in which instructions and data of a program reside, mainly when the program is being executed by the CPU. Physically, this memory consists of some chips either on the motherboard, or a small circuit board attached to the motherboard of a computer system. This built in memory allows the CPU to store and retrieve data very quickly. The rate of fetching data from this memory is typically of the order of 50 nanoseconds/byte. Hence rate of data fetching from the main memory is about 100 times faster than that from the high-speed secondary storage like disk.

 

Storage Evaluation Criteria:

Any Storage unit of a computer system is characterized and evaluated based on the following properties:

  1. Storage Capacity: amount of data which can be stored in the storage unit
  2. Access time: This is the time required to locate and retrieve stored data from storage unit, in response to the program instruction. A fast access time is preferred
  3. Cost per bit of storage: Lower cost is desired
  4. Volatile: If the storage unit can retain the data stored in it, even when the power is turned off or interrupted, it is called non-volatile storage. On other end if the date stored is lost, when the power is turned off or interrupted, it is called volatile storage. In almost all computer system, primary storage units are volatile and secondary storage units are non-volatile.
  5. Random Access: If the time to access piece of data from the storage unit is independent of the location of the data in the storage unit, it is called as random access storage or random access memory (RAM). Each separate location of RAM is easy to access as any other location, and takes the same amount of time.

 

 

RAM, ROM, PROM and EPROM

 

Random Access Memory(RAM) :

 

Read-Only Memory(ROM) :

A special type of RAM, called read-only memory (ROM), is a non-volatile memory chip, in which data is stored permanently and cannot be altered by the programmer. In fact, storing data permanently into this kind of memory is called “burning in the data”, because data in such memory is stored by using fuse-links. Once a fuse-link is burnt, it is permanent. The data stored in a ROM chip can only be read and used. That’s why it is called Read Only Memory (ROM). Since ROM chips are non-volatile. ROM are known as field stores, permanent stores or dead stores.

 

ROMs are mainly used to store programs and data, which do not change and are frequently used. For example, wired electronic circuits carry out the most basic operations. However, several higher-level operations that are very frequently used require very complicated electronic electronic circuits for their implementation. Hence instead of building electronic circuits for these operations, special programs are written to perform them. These programs are called micro programs, because they deal with the low-level machine functions, and are essentially substitutes for addition hardware. ROMs are used by computer manufacturers for storing these microprograms, so that they cannot be modified by the user.

 

A good example of a microprogram is the set of instructions needed to make the computer system ready for use. When its power is switched on. This microprograms, called  “system boot program”, contains a set of start-up instructions to check if the system hardware like memory, I/O devices, etc are functioning properly and looks for an operating system and loads its core part in the volatile RAM of the system, to produce the initial display screen prompt. Note that this microprograms is used every time the computer is switched on, and needs to be retained when the computer is switched off. Hence ROM is the ideal storage for storing it.

 

Programmable Read-Only Memory (PROM)

There are two type of read-only memory (ROM) – manufacturer-programmed and user-programmed. A manufacturer programmed ROM is one in which data is burnt in by the manufacturer of the electronic equipment in which it is used. For example, personal computer manufacturer may store the system boot program permanently in the ROM chip used on the motherboard of all the PCs manufactured by it. Similarly a printer manufacturer may store the printer controller software in the ROM chip used on the circuit board of all the printers manufactured by it. Manufacturer-programmed ROMs chips are supplied by the manufacturer of electronic equipment, and it is not possible for the user to modify the programs or data stored inside the ROM chips. On the other hand, a user-programmed ROM is one in which the user can load and store read-only programs and data. That is it is possible for a user to “customize” a system by converting his/her own programs to microprograms, and storing them in a user-programmable chip. Such a ROM is commonly known as “Programmable Read-Only Memory (PROM), because a user can program it. Once user programs are stored in PROM chips, they can usually be executed in a fraction of time previously required. PROMs are programmed to record information using special device, known as PROM-Programmer. However, once the chip has been programmed, the recorded information cannot be changed, i.e. the PROM becomes a ROM, and it is only possible to read the stored information.

 

Erasable Programmable Read-Only Memory (EPROM)

Once information is stored in a ROM chip or a PROM chip, it cannot be altered. However, there is another type of memory chip, called Erasable Programmable Read-Only Memory(EPROM), which overcomes this problem. As the name implies, it is possible to erase information stored in an EPROM chip, and the chip can be reprogrammed to store new information. EPROMs are often used by R&D personnel (Experimenters), who frequently change the microprograms to test the efficiency of the computer system with the new programs, EPROMs are useful in case of those application, where one may like to store a program in a ROM, which would normally not change, but under some unforeseen conditions one may like to alter it. When an EPROM is in use, information stored in it can only be “read”, and the information remains in the chip, until it is erased.

 

EPROM chips are of two types- one in which the stored information is erased by exposing the chip for some time to ultraviolet light, and the other one in which the stored information is erased by using high voltage electric pulses. The former is known as Ultra Violet EPROM (UVEPROM), and the latter is known as Electrically EPROM (EEPROM). It is easier to alter information stored in an EEPROM chip, as compared to an UVEPROM chip. Due to the ease with which stored programs can be altered, EEPROM is also known as flash memory. Flash memory is used in many new I/O and storage devices.

 

Cache Memory:

Even with the use of main memory, the memory-processor speed mismatch becomes a bottleneck in the speed with which the CPU can process instructions because there is 1 to 10 speed mismatches between the processor and the memory.  That is the rate at the data can be fetched from memory is about 10 times slower than the rate at which CPU can process data. Hence in many cases the performance of processors gets limited due to slow speed of main memory. Obviously the overall performance of a processor can be greatly improved by minimizing the memory-processor speed mismatch. Cache memory (pronounced as “cash” memory) is commonly used for minimizing the memory processor mismatch. Cache memory is extremely fast, small memory between CPU and main memory, whose access time is closer to the processing speed of the CPU. It acts as high-speed buffer between CPU and main memory and is used to temporarily store very active data and instructions during processing. Since catch memory is faster than main memory, making data and instructions needed in current processing available in the cache increases the processing speed.