The CPU is the brains of the computer. In terms of computing power, the CPU is the most important element of a computer system.
The CPU is centrally located on the motherboard. Since the CPU carries out a large share of the work in the computer, data pass continually through it. The data come from the RAM and the units (keyboard, drives etc.). After processing , the data is send back to RAM and units.
The CPU continually receives instructions to be executed. Each instruction is a data processing order. The work itself consists mostly of calculations and data transport:
On Large Machines,
CPUs require one or more printed circuit boards. On personal computers and small workstations, the CPU is housed in a single chip called a microprocessor. Two typical components of a CPU are:
The arithmetic logic unit (ALU): The ALU part of a computer that performs all arithmetic computations, such as addition and multiplication, and all comparison operations. The ALU is one component of the CPU.
The control unit(CU), which extracts instruction from memory and decodes and executes them, calling on the ALU when necessary.
Main Memory: A computer mentioned earlier, a computer executes a program in its main memory, which is another very important component of the stored program in it. In these section, we will learn more about different types of memories used in a computer and their working.
Mostly the modern computer memory is built in the form of a chip of a semi conductor material. It is built in the form of thousand or even millions of cells each capable of storing a bit i-e a 0 or 1. This is shown in figure 5.3. below.
These cells are logically organized into group of 8 bits called a byte. Each byte in the memory has a unique number assigned it is called the address of that byte.It is obvious that a memory is sequence of bytes. Also the CPU or any other component of the computer can access any byte from the main memory by specifying its address.
Different bytes of the main memory can be accessed directly at random the memory takes equal amount of time. So the main memory is direct access storage device. As no mechanical movement is involved in accessing any byte of the memory so the main memory of the computer is very fast as compared to other storage devices like the magnetic and optical disks. There are two main memory.
RAM ( Random Access Memory ): It is usually build by using two different technologies.
DRAM (Dynamic RAM): DRAM stands for dynamic random access memory, a type of memory used in most computers. Dynamic Random Access Memory must have an electric current to maintain electrical state.
SRAM (Static RAM): In SRAM technology, the memory cells are made form digital gates and each cell can hold its value without any need to refresh the data as long as the power is supplied to it. As no refreshing is required to SRAM, these chips are faster than the DRAM chips also utilize less power. Because of these reasons the design of SPAM chip is more complex than the design of DRAM chips. Hence the SRAM chip is more expensive than the design of DRAM chip. In most modern computers this technology is used to build very fast memory inside a CPU.
This memory is known as the cache memory.(Cache memory usually has a very small size as compared to the main memory in the computer but plays a very important role in increasing the performance of a computer system.) This memory arrangement is shown in the figure 5.5 below:
It is important to note that the main memory is volatile (unstable) and the contents of the memory are lost as soon as the electricity supply is cut-off. The CPU can not only read the data stored in RAM but also can write data in the RAM, so RAM is read/write memory. It is used to store all data and instruction of a program while it is being executed.
ROM (Read Only Memory):
As is obvious from this name the contents stored in this memory can be read but new data cannot be written onto it so it is read only. The manufacturer of the ROM writes the data and programs permanently onto it and this data and programs cannot be changed afterwards. ROM contains frequently used instructions and data.
Another commonly found form of ROM is PROM (Programmable Read Only Memory). This form of ROM is initially blank and the user or manufacturer can write data onto it by using special devices. Once the program/data is written onto PROM it can be changed or altered. It is obvious that this kind of ROM will be used for storing user made programs and data should have a very long life time as the data written onto this kind of ROM cannot be changed. Another important form of Read Only Memory is EPROM (Erasable Programmable Read Only Memory).
Like PROM it is initially blank. Programs and data can be written on it by the manufacturer or by erased by using special devices. Unlike PROM, the data written on it can be erased by using special devices using ultraviolet rays. So data/program written on it can be changed and new data can also be added on this form of ROM. As the data written on this kind of ROM can be changed so data that is to be updated can be written onto it but frequently changing data should not be written on this ROM.
Yet another form of ROM is EEPROM (Electrically Erasable Programmable Read Only Memory). This kind of ROM can be re-written by using electrical devices and so data stored on this ROM can be easily modified.
It is important to note that all the forms of ROM described above are non-volatile so the data stored on these chips is not lost when electricity is cut-off. Mostly ROM chips are used to stored frequently used program like operating system routines and data, which is not changed for longer periods of time.