CPU (Central Processing Unit) is the part of the computer that executes instructions. Instructions executed in the CPU could carry out various operations such as arithmetic operations, input/ output operations, etc. over the years, technology used in CPUs has changed tremendously but still the basic operations performed by a CPU have not changed. RAM (Random Access Memory) is the primary memory used in a computer. Its individual memory cells can be accessed in any sequence, and therefore it is called the random access memory. RAMs are divided in to two categories as Static RAM (SRAM) and Dynamic RAM (DRAM).
What is a CPU?
CPU is the part of the computer where the instructions are executed and it is considered as the most important part of a computer system. In a typical personal computer (PC), the CPU is contained within a microprocessor, which is a single chip and today most of the CPUs are implemented as microprocessors. But in large workstations CPU would be made up of single or more printed circuit boards. Modern CPUs come as a component that could be easily connected to the CPU. It is a small, square in shape, and contains metallic pins that would make the connections with the motherboard. Most of the modern CPUs have a mechanism to dissipate heat, such as a small fan connected to the top of the CPU. A CPU mainly comprises of two parts. The Arithmetic Logic Unit (ALU), which is responsible for carrying out arithmetic and logical operations and a Control Unit, which is responsible for fetching instructions from the memory, decoding them to identify what kind of an operations they are and communicating with the other units that are required to execute the instruction (ALU for a arithmetic instruction, Memory for read/ write instructions, etc).
What is a RAM?
RAM is also known as the main memory of a computer. It is a volatile memory in which the data that is stored in the memory is lost when the power is turned off. RAMs are divided in to two categories as Static RAM (SRAM) and Dynamic RAM (DRAM). SRAM uses transistors to store a single bit of data and it does not need to be periodically refreshed. DRAM uses a separate capacitor to store each bit of data and it needs to be periodically refreshed to maintain the charge in the capacitors. In modern computers, RAM is organized in to modules that can be upgraded. This would allow increasing the RAM capacity or fixing damages very easily.
What is the difference between CPU and RAM?
CPU is the main component of a computer system that is responsible for executing instructions, whereas the RAM is the main memory of a computer system. CPU frequently requires data and instructions that are stored in the RAM. To reduce the latency in accessing the RAM, cache memory was introduced. Frequently accessed data in the RAM are placed in the cache memory so that the CPU can quickly access them.