The CPU and The Memory

Memory:

Random Access Memory

A memory is just like a human brain. It is used to store data and instructions. Computer memory is the storage space in computer where data is to be processed and instructions required for processing are stored. RAM is normally associated with volatile types of memory , where stored information is lost if power is removed, although many efforts have been made to develop non-volatile RAM chips. Other types of non-volatile memories exist that allow random access for read operations, but either do not allow write operations or have other kinds of limitations on them.

Central Processing Unit:

CU and ALU interaction with RAM

The CPU is a piece of hardware that carries out the instructions of a computer program. It performs the basic arithmetical, logical, and input/output operations of a computer system. Every instruction, no matter how simple, has to go through the CPU.

A typical CPU has a number of components. It has an arithmetic logic unit (ALU), which performs simple arithmetic and logical operations. A control unit (CU), which manages the various components of the computer. It reads and interprets instructions from memory and transforms them into a series of signals to activate other parts of the computer. The control unit calls upon the arithmetic logic unit to perform the necessary calculations. Also the cpu uses the cache, which serves as high-speed memory where instructions can be copied to and retrieved.

The MMU (Memory Management Unit):

The MMU is a computer hardware component that handles all memory and caching operations associated with the processor. It has two special registers that are accessed by the CPU’s control unit. A data to be sent to main memory or retrieved from memory is stored in the Memory Data Register (MDR). The desired logical memory address is stored in the Memory Address Register (MAR). The address translation is also called address binding and uses a memory map that is programmed by the operating system.

Before memory addresses are loaded on to the system bus, they are translated to physical addresses by the MMU.

Memory hierarchy:

Memory hierarchy is a concept used to discuss performance issues in computer architectural design, algorithm predictions, and lower level programming constructs involving locality of reference. The memory hierarchy in computer storage separates each of its levels based on response time. Since response time, complexity, and capacity are related, the levels may also be distinguished by their performance and controlling technologies.

Register: A special, high-speed storage area within the CPU. All data must be represented in a register before it can be processed. For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is also placed in a register. (The register can contain the address of a memory location where data is stored rather than the actual data itself.)

The number of registers that a CPU has and the size of each (number of bits) help determine the power and speed of a CPU. For example a 32-bit CPU is one in which each register is 32 bits wide. Therefore, each CPU instruction can manipulate 32 bits of data.

L1 : L1 and L2 are levels of cache memory in a computer. If the computer processor can find the data it needs for its next operation in cache memory, it will save time compared to having to get it from random access memory. Level 1 cache is the fastest cache memory, since it is already built within the chip with a zero wait-state interface, making it the most expensive cache among the CPU caches.

L2: Level 2 cache, also referred to as secondary cache, uses the same control logic as Level 1 cache and is also implemented in SRAM. Even thou its slower than L1, it is also much larger.

DRAM: Dynamic random access memory is a type of memory that is typically used for data or program code that a computer processor needs to function. DRAM is a common type of memory used in personal computers, workstations and servers. Random access allows the processor to access any part of the memory directly rather than having to proceed sequentially from a starting place. RAM is located close to a computer’s processor and enables faster access to data than storage media such as hard disk drives and solid-state drives.

DRAM is one option of semiconductor memory that a system designer can use when building a computer. Alternative memory choices include static RAM (SRAM), electrically erasable programmable read-only memory (EEPROM); many systems use more than one type of memory.

— -> paging is a memory management scheme by which a computer stores and retrieves data from secondary storage for use in main memory. In this scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. Paging is an important part of virtual memory implementations in modern operating systems, using secondary storage to let programs exceed the size of available physical memory.

SSD & HDD: These are consider non-volatile Secondary storage and are at the lower level of the storage hierarchy. It commonly refers to hard disk drives , solid-state drives. Typically they provide high capacity, but the data may not be immediately accessible. These devices store virtually all programs and applications stored on a computer, including the operating system, device drivers, applications and general user data.

External Disks, USB, Tape: The main objective of the tertiary storage level is to provide huge storage capacity at low cost. Generally, tertiary storage is built using removable media and are places at the bottom of the memory hierarchy. Common examples of removable media are floppy disks and CD-ROMs, USB, Tapes.